youtube_transcript2020 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/youtube_transcript2020.rb +14 -1
- metadata +22 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9405f15c45cd185c0ad06d54fb2e7198a39cdef14896051a3b03ea3d14b497fb
|
4
|
+
data.tar.gz: 643f78333b91e3c5ff5ef960d8339a496618bcf3b5d81f41d74d17ffb760d533
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59915336a37bb3c3bdd7d84715c0e254db0f1b20b720c66f5191b6dba38ec072e3abb4e117f5876bcaf89eaa4dcfb7871ab279f36becd1523ba1d56daf230cae
|
7
|
+
data.tar.gz: 53851b499c5a2024303f3da0b1da1da54a0eaf096db197c5ac97035e1ccb125ef581d551fa154c39892decfd5041fe667a2364293db8c1d1f8057ab24757b1ee
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
# file: youtube_transcript2020.rb
|
4
4
|
|
5
|
+
require 'yawc'
|
5
6
|
require 'subunit'
|
6
7
|
require 'simple-config'
|
7
8
|
|
@@ -40,6 +41,10 @@ class YoutubeTranscript2020
|
|
40
41
|
h = {id: @id, title: @title, author: @author}
|
41
42
|
SimpleConfig.new(h).to_s + "\n#{'-'*78}\n\n" + @s
|
42
43
|
end
|
44
|
+
|
45
|
+
def to_text()
|
46
|
+
@a.map(&:last).join("\n")
|
47
|
+
end
|
43
48
|
|
44
49
|
# reads a plain text transcript which has been modified to include headings
|
45
50
|
#
|
@@ -82,7 +87,7 @@ class YoutubeTranscript2020
|
|
82
87
|
<body>
|
83
88
|
<div style="width: 1080px; background: white">
|
84
89
|
<div style="float:left; width: 580px; background: white">
|
85
|
-
<iframe width="560" height="315" src="#{url}
|
90
|
+
<iframe width="560" height="315" src="#{url}&autoplay=1" name="video" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
86
91
|
<h1>#{@title}</h1>
|
87
92
|
</div>
|
88
93
|
<div style="float:right; width: 500px; overflow-y: scroll; height: 400px">
|
@@ -104,6 +109,14 @@ EOF
|
|
104
109
|
|
105
110
|
end
|
106
111
|
|
112
|
+
# returns a Hash object containing the frequenecy of each word
|
113
|
+
# level: 2 (ignores commond words including stop words)
|
114
|
+
# level: 3 (ignores dictionary words)
|
115
|
+
#
|
116
|
+
def to_keywords(level: 2)
|
117
|
+
Yawc.new(self.to_text(), level: level).to_h
|
118
|
+
end
|
119
|
+
|
107
120
|
private
|
108
121
|
|
109
122
|
def fetch_info(id)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: youtube_transcript2020
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,8 +35,28 @@ cert_chain:
|
|
35
35
|
42/R+mfGUgXXd9e36R3+wmfHZSFR6p6I6XKToCKca7buvgP2XgO9I04lTYUr0KLi
|
36
36
|
6ZSQYo0XuSVg3by/5kp1TrrS
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2020-07-
|
38
|
+
date: 2020-07-28 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: yawc
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.2.0
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0.2'
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 0.2.0
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0.2'
|
40
60
|
- !ruby/object:Gem::Dependency
|
41
61
|
name: subunit
|
42
62
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|