viddl-rb 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +237 -0
- data/bin/helper/parameter-parser.rb +12 -6
- data/helper/audio-helper.rb +5 -3
- data/lib/viddl-rb.rb +1 -1
- data/plugins/arte_plus_seven.rb +1 -1
- data/plugins/bandcamp.rb +2 -2
- data/plugins/blip.rb +1 -1
- data/plugins/instagram.rb +12 -3
- data/plugins/metacafe.rb +1 -1
- data/plugins/soundcloud.rb +3 -2
- data/plugins/veoh.rb +1 -1
- data/plugins/vimeo.rb +1 -1
- data/plugins/youtube/cipher_guesser.rb +2 -2
- data/plugins/youtube/cipher_io.rb +2 -3
- data/plugins/youtube/ciphers.yml +1 -0
- data/plugins/youtube/url_resolver.rb +2 -2
- data/plugins/youtube/video_resolver.rb +1 -2
- metadata +13 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d215777e25683d6ac2f60e80fbe24595e53b483
|
4
|
+
data.tar.gz: 92a9de5a18af78281c05bebfb2c8788b7683e749
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f69749d90bb44060158f3dbee3f1cb7da589b85888b3a49bbc1f3b0ed7263523e68a39cff9343eaf102ba13cbc15d2d249bec1d8cc0e70372ac0ffb80b25753f
|
7
|
+
data.tar.gz: b83d81a78138fb601d6a2bbcfdf0dc9accffc25878d08527aefa5d1721c9c13be8824b97293a1494589ca21fb90276332bc57c303576fa53df440024c87e0599
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,237 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
viddl-rb (1.0.7)
|
5
|
+
multi_json (~> 1.10.0)
|
6
|
+
nokogiri (~> 1.6.0)
|
7
|
+
progressbar (~> 0.21)
|
8
|
+
rest-client
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: http://rubygems.org/
|
12
|
+
specs:
|
13
|
+
ffi2-generators (0.1.1)
|
14
|
+
mime-types (2.4.3)
|
15
|
+
mini_portile (0.6.1)
|
16
|
+
minitest (5.4.3)
|
17
|
+
multi_json (1.10.1)
|
18
|
+
netrc (0.8.0)
|
19
|
+
nokogiri (1.6.4.1)
|
20
|
+
mini_portile (~> 0.6.0)
|
21
|
+
progressbar (0.21.0)
|
22
|
+
racc (1.4.12)
|
23
|
+
rake (10.1.1)
|
24
|
+
rb-readline (0.5.1)
|
25
|
+
rest-client (1.7.2)
|
26
|
+
mime-types (>= 1.16, < 3.0)
|
27
|
+
netrc (~> 0.7)
|
28
|
+
rubysl (2.1.0)
|
29
|
+
rubysl-abbrev (~> 2.0)
|
30
|
+
rubysl-base64 (~> 2.0)
|
31
|
+
rubysl-benchmark (~> 2.0)
|
32
|
+
rubysl-bigdecimal (~> 2.0)
|
33
|
+
rubysl-cgi (~> 2.0)
|
34
|
+
rubysl-cgi-session (~> 2.0)
|
35
|
+
rubysl-cmath (~> 2.0)
|
36
|
+
rubysl-complex (~> 2.0)
|
37
|
+
rubysl-continuation (~> 2.0)
|
38
|
+
rubysl-coverage (~> 2.0)
|
39
|
+
rubysl-csv (~> 2.0)
|
40
|
+
rubysl-curses (~> 2.0)
|
41
|
+
rubysl-date (~> 2.0)
|
42
|
+
rubysl-delegate (~> 2.0)
|
43
|
+
rubysl-digest (~> 2.0)
|
44
|
+
rubysl-drb (~> 2.0)
|
45
|
+
rubysl-e2mmap (~> 2.0)
|
46
|
+
rubysl-english (~> 2.0)
|
47
|
+
rubysl-enumerator (~> 2.0)
|
48
|
+
rubysl-erb (~> 2.0)
|
49
|
+
rubysl-etc (~> 2.0)
|
50
|
+
rubysl-expect (~> 2.0)
|
51
|
+
rubysl-fcntl (~> 2.0)
|
52
|
+
rubysl-fiber (~> 2.0)
|
53
|
+
rubysl-fileutils (~> 2.0)
|
54
|
+
rubysl-find (~> 2.0)
|
55
|
+
rubysl-forwardable (~> 2.0)
|
56
|
+
rubysl-getoptlong (~> 2.0)
|
57
|
+
rubysl-gserver (~> 2.0)
|
58
|
+
rubysl-io-console (~> 2.0)
|
59
|
+
rubysl-io-nonblock (~> 2.0)
|
60
|
+
rubysl-io-wait (~> 2.0)
|
61
|
+
rubysl-ipaddr (~> 2.0)
|
62
|
+
rubysl-irb (~> 2.1)
|
63
|
+
rubysl-logger (~> 2.0)
|
64
|
+
rubysl-mathn (~> 2.0)
|
65
|
+
rubysl-matrix (~> 2.0)
|
66
|
+
rubysl-mkmf (~> 2.0)
|
67
|
+
rubysl-monitor (~> 2.0)
|
68
|
+
rubysl-mutex_m (~> 2.0)
|
69
|
+
rubysl-net-ftp (~> 2.0)
|
70
|
+
rubysl-net-http (~> 2.0)
|
71
|
+
rubysl-net-imap (~> 2.0)
|
72
|
+
rubysl-net-pop (~> 2.0)
|
73
|
+
rubysl-net-protocol (~> 2.0)
|
74
|
+
rubysl-net-smtp (~> 2.0)
|
75
|
+
rubysl-net-telnet (~> 2.0)
|
76
|
+
rubysl-nkf (~> 2.0)
|
77
|
+
rubysl-observer (~> 2.0)
|
78
|
+
rubysl-open-uri (~> 2.0)
|
79
|
+
rubysl-open3 (~> 2.0)
|
80
|
+
rubysl-openssl (~> 2.0)
|
81
|
+
rubysl-optparse (~> 2.0)
|
82
|
+
rubysl-ostruct (~> 2.0)
|
83
|
+
rubysl-pathname (~> 2.0)
|
84
|
+
rubysl-prettyprint (~> 2.0)
|
85
|
+
rubysl-prime (~> 2.0)
|
86
|
+
rubysl-profile (~> 2.0)
|
87
|
+
rubysl-profiler (~> 2.0)
|
88
|
+
rubysl-pstore (~> 2.0)
|
89
|
+
rubysl-pty (~> 2.0)
|
90
|
+
rubysl-rational (~> 2.0)
|
91
|
+
rubysl-resolv (~> 2.0)
|
92
|
+
rubysl-rexml (~> 2.0)
|
93
|
+
rubysl-rinda (~> 2.0)
|
94
|
+
rubysl-rss (~> 2.0)
|
95
|
+
rubysl-scanf (~> 2.0)
|
96
|
+
rubysl-securerandom (~> 2.0)
|
97
|
+
rubysl-set (~> 2.0)
|
98
|
+
rubysl-shellwords (~> 2.0)
|
99
|
+
rubysl-singleton (~> 2.0)
|
100
|
+
rubysl-socket (~> 2.0)
|
101
|
+
rubysl-stringio (~> 2.0)
|
102
|
+
rubysl-strscan (~> 2.0)
|
103
|
+
rubysl-sync (~> 2.0)
|
104
|
+
rubysl-syslog (~> 2.0)
|
105
|
+
rubysl-tempfile (~> 2.0)
|
106
|
+
rubysl-thread (~> 2.0)
|
107
|
+
rubysl-thwait (~> 2.0)
|
108
|
+
rubysl-time (~> 2.0)
|
109
|
+
rubysl-timeout (~> 2.0)
|
110
|
+
rubysl-tmpdir (~> 2.0)
|
111
|
+
rubysl-tsort (~> 2.0)
|
112
|
+
rubysl-un (~> 2.0)
|
113
|
+
rubysl-uri (~> 2.0)
|
114
|
+
rubysl-weakref (~> 2.0)
|
115
|
+
rubysl-webrick (~> 2.0)
|
116
|
+
rubysl-xmlrpc (~> 2.0)
|
117
|
+
rubysl-yaml (~> 2.0)
|
118
|
+
rubysl-zlib (~> 2.0)
|
119
|
+
rubysl-abbrev (2.0.4)
|
120
|
+
rubysl-base64 (2.0.0)
|
121
|
+
rubysl-benchmark (2.0.1)
|
122
|
+
rubysl-bigdecimal (2.0.2)
|
123
|
+
rubysl-cgi (2.0.1)
|
124
|
+
rubysl-cgi-session (2.0.1)
|
125
|
+
rubysl-cmath (2.0.0)
|
126
|
+
rubysl-complex (2.0.0)
|
127
|
+
rubysl-continuation (2.0.0)
|
128
|
+
rubysl-coverage (2.0.3)
|
129
|
+
rubysl-csv (2.0.2)
|
130
|
+
rubysl-english (~> 2.0)
|
131
|
+
rubysl-curses (2.0.1)
|
132
|
+
rubysl-date (2.0.8)
|
133
|
+
rubysl-delegate (2.0.1)
|
134
|
+
rubysl-digest (2.0.3)
|
135
|
+
rubysl-drb (2.0.1)
|
136
|
+
rubysl-e2mmap (2.0.0)
|
137
|
+
rubysl-english (2.0.0)
|
138
|
+
rubysl-enumerator (2.0.0)
|
139
|
+
rubysl-erb (2.0.1)
|
140
|
+
rubysl-etc (2.0.3)
|
141
|
+
ffi2-generators (~> 0.1)
|
142
|
+
rubysl-expect (2.0.0)
|
143
|
+
rubysl-fcntl (2.0.4)
|
144
|
+
ffi2-generators (~> 0.1)
|
145
|
+
rubysl-fiber (2.0.0)
|
146
|
+
rubysl-fileutils (2.0.3)
|
147
|
+
rubysl-find (2.0.1)
|
148
|
+
rubysl-forwardable (2.0.1)
|
149
|
+
rubysl-getoptlong (2.0.0)
|
150
|
+
rubysl-gserver (2.0.0)
|
151
|
+
rubysl-socket (~> 2.0)
|
152
|
+
rubysl-thread (~> 2.0)
|
153
|
+
rubysl-io-console (2.0.0)
|
154
|
+
rubysl-io-nonblock (2.0.0)
|
155
|
+
rubysl-io-wait (2.0.0)
|
156
|
+
rubysl-ipaddr (2.0.0)
|
157
|
+
rubysl-irb (2.1.0)
|
158
|
+
rb-readline (~> 0.5)
|
159
|
+
rubysl-e2mmap (~> 2.0)
|
160
|
+
rubysl-mathn (~> 2.0)
|
161
|
+
rubysl-thread (~> 2.0)
|
162
|
+
rubysl-logger (2.1.0)
|
163
|
+
rubysl-mathn (2.0.0)
|
164
|
+
rubysl-matrix (2.1.0)
|
165
|
+
rubysl-e2mmap (~> 2.0)
|
166
|
+
rubysl-mkmf (2.0.1)
|
167
|
+
rubysl-fileutils (~> 2.0)
|
168
|
+
rubysl-shellwords (~> 2.0)
|
169
|
+
rubysl-monitor (2.0.0)
|
170
|
+
rubysl-mutex_m (2.0.0)
|
171
|
+
rubysl-net-ftp (2.0.1)
|
172
|
+
rubysl-net-http (2.0.4)
|
173
|
+
rubysl-cgi (~> 2.0)
|
174
|
+
rubysl-erb (~> 2.0)
|
175
|
+
rubysl-singleton (~> 2.0)
|
176
|
+
rubysl-net-imap (2.0.1)
|
177
|
+
rubysl-net-pop (2.0.1)
|
178
|
+
rubysl-net-protocol (2.0.1)
|
179
|
+
rubysl-net-smtp (2.0.1)
|
180
|
+
rubysl-net-telnet (2.0.0)
|
181
|
+
rubysl-nkf (2.0.1)
|
182
|
+
rubysl-observer (2.0.0)
|
183
|
+
rubysl-open-uri (2.0.0)
|
184
|
+
rubysl-open3 (2.0.0)
|
185
|
+
rubysl-openssl (2.2.1)
|
186
|
+
rubysl-optparse (2.0.1)
|
187
|
+
rubysl-shellwords (~> 2.0)
|
188
|
+
rubysl-ostruct (2.0.4)
|
189
|
+
rubysl-pathname (2.1.0)
|
190
|
+
rubysl-prettyprint (2.0.3)
|
191
|
+
rubysl-prime (2.0.1)
|
192
|
+
rubysl-profile (2.0.0)
|
193
|
+
rubysl-profiler (2.0.1)
|
194
|
+
rubysl-pstore (2.0.0)
|
195
|
+
rubysl-pty (2.0.2)
|
196
|
+
rubysl-rational (2.0.1)
|
197
|
+
rubysl-resolv (2.1.0)
|
198
|
+
rubysl-rexml (2.0.4)
|
199
|
+
rubysl-rinda (2.0.1)
|
200
|
+
rubysl-rss (2.0.0)
|
201
|
+
rubysl-scanf (2.0.0)
|
202
|
+
rubysl-securerandom (2.0.0)
|
203
|
+
rubysl-set (2.0.1)
|
204
|
+
rubysl-shellwords (2.0.0)
|
205
|
+
rubysl-singleton (2.0.0)
|
206
|
+
rubysl-socket (2.0.1)
|
207
|
+
rubysl-stringio (2.0.0)
|
208
|
+
rubysl-strscan (2.0.0)
|
209
|
+
rubysl-sync (2.0.0)
|
210
|
+
rubysl-syslog (2.1.0)
|
211
|
+
ffi2-generators (~> 0.1)
|
212
|
+
rubysl-tempfile (2.0.1)
|
213
|
+
rubysl-thread (2.0.2)
|
214
|
+
rubysl-thwait (2.0.0)
|
215
|
+
rubysl-time (2.0.3)
|
216
|
+
rubysl-timeout (2.0.0)
|
217
|
+
rubysl-tmpdir (2.0.1)
|
218
|
+
rubysl-tsort (2.0.1)
|
219
|
+
rubysl-un (2.0.0)
|
220
|
+
rubysl-fileutils (~> 2.0)
|
221
|
+
rubysl-optparse (~> 2.0)
|
222
|
+
rubysl-uri (2.0.0)
|
223
|
+
rubysl-weakref (2.0.0)
|
224
|
+
rubysl-webrick (2.0.0)
|
225
|
+
rubysl-xmlrpc (2.0.0)
|
226
|
+
rubysl-yaml (2.0.4)
|
227
|
+
rubysl-zlib (2.0.1)
|
228
|
+
|
229
|
+
PLATFORMS
|
230
|
+
ruby
|
231
|
+
|
232
|
+
DEPENDENCIES
|
233
|
+
minitest
|
234
|
+
racc
|
235
|
+
rake (~> 10.1.0)
|
236
|
+
rubysl (~> 2.0)
|
237
|
+
viddl-rb!
|
@@ -39,10 +39,10 @@ class ParameterParser
|
|
39
39
|
end
|
40
40
|
|
41
41
|
opts.on("-e", "--extract-audio", "Save video audio to file") do
|
42
|
-
if ViddlRb::UtilityHelper.os_has?(
|
42
|
+
if ['ffmpeg', 'avconf'].any?{ |name| ViddlRb::UtilityHelper.os_has?(name) }
|
43
43
|
options[:extract_audio] = true
|
44
44
|
else
|
45
|
-
raise OptionParser::ParseError.new("to extract audio you need to have ffmpeg on your PATH")
|
45
|
+
raise OptionParser::ParseError.new("to extract audio you need to have ffmpeg/avconf on your PATH")
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -94,10 +94,16 @@ class ParameterParser
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
97
|
+
# removes all options from args
|
98
|
+
optparse.parse!(args)
|
99
|
+
# exit if no video url
|
100
|
+
print_help_and_exit(optparse) if args.empty?
|
101
|
+
# the url is the only element left
|
102
|
+
url = args.first
|
103
|
+
# Seems like some users like to pass non protocol prefixed URIs
|
104
|
+
url = "http://#{url}" unless url.start_with?('http')
|
105
|
+
# raise exception if invalid url
|
106
|
+
validate_url!(url)
|
101
107
|
options[:url] = url
|
102
108
|
options
|
103
109
|
end
|
data/helper/audio-helper.rb
CHANGED
@@ -6,9 +6,11 @@ module ViddlRb
|
|
6
6
|
|
7
7
|
def self.extract(file_name, save_dir)
|
8
8
|
# capture stderr because ffmpeg expects an output param and will error out
|
9
|
+
|
10
|
+
ffmpeg_app_name = ['ffmpeg', 'avconv'].find {|name| ViddlRb::UtilityHelper.os_has?(name)}
|
9
11
|
puts "Gathering information about the downloaded file."
|
10
|
-
escaped_input_file_path = UtilityHelper.make_shellsafe_path(File.join(save_dir, file_name))
|
11
|
-
file_info = Open3.popen3("
|
12
|
+
escaped_input_file_path = UtilityHelper.make_shellsafe_path(File.join(save_dir, file_name))
|
13
|
+
file_info = Open3.popen3("#{ffmpeg_app_name} -i #{escaped_input_file_path}") {|stdin, stdout, stderr, wait_thr| stderr.read }
|
12
14
|
puts "Done gathering information about the downloaded file."
|
13
15
|
|
14
16
|
if !file_info.to_s.empty?
|
@@ -40,7 +42,7 @@ module ViddlRb
|
|
40
42
|
puts "Audio file seems to exist already, removing it before extraction."
|
41
43
|
File.delete(output_file_path)
|
42
44
|
end
|
43
|
-
Open3.popen3("
|
45
|
+
Open3.popen3("#{ffmpeg_app_name} -i #{escaped_input_file_path} -vn -acodec copy #{escaped_output_file_path}") { |stdin, stdout, stderr, wait_thr| stdout.read }
|
44
46
|
puts "Done extracting audio to #{output_file_path}"
|
45
47
|
else
|
46
48
|
raise "ERROR: Error while checking audio track of #{file_path}"
|
data/lib/viddl-rb.rb
CHANGED
data/plugins/arte_plus_seven.rb
CHANGED
@@ -11,7 +11,7 @@ class ArtePlusSeven < PluginBase
|
|
11
11
|
id = self.to_id(url)
|
12
12
|
country = self.extract_country(url)
|
13
13
|
json_url = "http://arte.tv/papi/tvguide/videos/stream/player/#{country}/#{id}_PLUS7-#{country.upcase}/ALL/ALL.json"
|
14
|
-
doc = MultiJson.load(
|
14
|
+
doc = MultiJson.load(RestClient.get(json_url))['videoJsonPlayer']
|
15
15
|
# This can be improved a lot,
|
16
16
|
# check the results on http://floriancrouzat.net/arte/
|
17
17
|
first_http_key = doc['VSR'].keys.find{|k| k.start_with?('HTTP')}
|
data/plugins/bandcamp.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'rest-client'
|
2
2
|
require 'json'
|
3
3
|
|
4
4
|
class Bandcamp < PluginBase
|
@@ -13,7 +13,7 @@ class Bandcamp < PluginBase
|
|
13
13
|
def self.get_urls_and_filenames(url, options = {})
|
14
14
|
# locate the js object with all the tracks data
|
15
15
|
url_and_files = []
|
16
|
-
doc = Nokogiri::HTML(
|
16
|
+
doc = Nokogiri::HTML(RestClient.get(get_http_url(url)))
|
17
17
|
js = doc.at("script:contains('var TralbumData')").text
|
18
18
|
match = /trackinfo\s?:\s?([\s\S]*?\}\])/.match(js)[1]
|
19
19
|
|
data/plugins/blip.rb
CHANGED
@@ -8,7 +8,7 @@ class Blip < PluginBase
|
|
8
8
|
def self.get_urls_and_filenames(url, options = {})
|
9
9
|
id = self.to_id(url)
|
10
10
|
xml_url = "http://blip.tv/rss/#{id}"
|
11
|
-
doc = Nokogiri::XML(
|
11
|
+
doc = Nokogiri::XML(RestClient.get(xml_url))
|
12
12
|
user = doc.at("//channel/item/blip:user").inner_text
|
13
13
|
title = PluginBase.make_filename_safe(doc.at("//channel/item/title").inner_text)
|
14
14
|
download_url = doc.at("//channel/item/media:group/media:content").attributes["url"].value
|
data/plugins/instagram.rb
CHANGED
@@ -6,11 +6,20 @@ class Instagram < PluginBase
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def self.get_urls_and_filenames(url, options = {})
|
9
|
-
video_page =
|
9
|
+
video_page = RestClient.get(url)
|
10
10
|
|
11
|
-
download_url = video_page
|
11
|
+
download_url = video_page[/meta property="og:video" content="(.*\.mp4)/, 1]
|
12
|
+
# Fallback
|
13
|
+
download_url ||= video_page[/"video_url":"(http[^"]+.mp4)"/, 1]
|
12
14
|
|
13
|
-
|
15
|
+
extracted_caption = video_page[/"caption":"([^"]+)"/, 1]
|
16
|
+
if extracted_caption
|
17
|
+
caption = PluginBase.make_filename_safe(extracted_caption)
|
18
|
+
else
|
19
|
+
caption = Time.now.to_i
|
20
|
+
end
|
21
|
+
|
22
|
+
[{:url => download_url, :name => "#{caption}.mp4"}]
|
14
23
|
end
|
15
24
|
end
|
16
25
|
|
data/plugins/metacafe.rb
CHANGED
@@ -14,7 +14,7 @@ class Metacafe < PluginBase
|
|
14
14
|
def self.get_urls_and_filenames(url, options = {})
|
15
15
|
video_id = get_video_id(url)
|
16
16
|
info_url = API_BASE + "item/#{video_id}" #use the API to get the full video url
|
17
|
-
info_doc = Nokogiri::XML(
|
17
|
+
info_doc = Nokogiri::XML(RestClient.get(info_url))
|
18
18
|
|
19
19
|
video_swf_url = get_video_swf_url(info_doc, video_id)
|
20
20
|
|
data/plugins/soundcloud.rb
CHANGED
@@ -13,8 +13,9 @@ class Soundcloud < PluginBase
|
|
13
13
|
def self.get_urls_and_filenames(url, options = {})
|
14
14
|
url_and_files = []
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
client = RestClient::Resource.new(get_http_url(url), :verify_ssl => OpenSSL::SSL::VERIFY_NONE)
|
17
|
+
doc = Nokogiri::HTML(client.get)
|
18
|
+
js = doc.at("script:contains('_scPreload')").text
|
18
19
|
|
19
20
|
track_data = JSON.parse js[/_scPreload\s*?=\s*?([\s\S]*?)$/,1].to_s
|
20
21
|
|
data/plugins/veoh.rb
CHANGED
@@ -10,7 +10,7 @@ class Veoh < PluginBase
|
|
10
10
|
def self.get_urls_and_filenames(url, options = {})
|
11
11
|
veoh_id = url[/\/watch\/([\w\d]+)/, 1]
|
12
12
|
info_url = "#{VEOH_API_BASE}findByPermalink?permalink=#{veoh_id}"
|
13
|
-
info_doc = Nokogiri::XML(
|
13
|
+
info_doc = Nokogiri::XML(RestClient.get(info_url))
|
14
14
|
|
15
15
|
download_url = get_download_url(info_doc)
|
16
16
|
file_name = get_file_name(info_doc, download_url)
|
data/plugins/vimeo.rb
CHANGED
@@ -10,7 +10,7 @@ class Vimeo < PluginBase
|
|
10
10
|
vimeo_id = url[/\d{7,}/]
|
11
11
|
|
12
12
|
video_url = "http://player.vimeo.com/video/#{vimeo_id}"
|
13
|
-
video_page =
|
13
|
+
video_page = RestClient.get(video_url)
|
14
14
|
|
15
15
|
info_json = find_player_info(video_page)
|
16
16
|
unless info_json
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'rest-client'
|
2
2
|
|
3
3
|
class CipherGuesser
|
4
4
|
class CipherGuessError < StandardError; end
|
@@ -15,7 +15,7 @@ class CipherGuesser
|
|
15
15
|
private
|
16
16
|
|
17
17
|
def download_player_javascript(cipher_version)
|
18
|
-
|
18
|
+
RestClient.get(JS_URL % cipher_version)
|
19
19
|
end
|
20
20
|
|
21
21
|
def extract_decipher_function_body(js)
|
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
require 'open-uri'
|
1
|
+
require 'rest-client'
|
3
2
|
require 'net/http'
|
4
3
|
require 'openssl'
|
5
4
|
require 'yaml'
|
@@ -58,7 +57,7 @@ class CipherIO
|
|
58
57
|
end
|
59
58
|
|
60
59
|
def download_server_ciphers
|
61
|
-
YAML.load(
|
60
|
+
YAML.load(RestClient.get(CIPHER_YAML_URL))
|
62
61
|
end
|
63
62
|
|
64
63
|
def save_local_ciphers(ciphers)
|
data/plugins/youtube/ciphers.yml
CHANGED
@@ -42,14 +42,14 @@ class UrlResolver
|
|
42
42
|
def get_video_urls(feed_url)
|
43
43
|
Youtube.notify "Retrieving videos..."
|
44
44
|
urls_titles = {}
|
45
|
-
result_feed = Nokogiri::XML(
|
45
|
+
result_feed = Nokogiri::XML(RestClient.get(feed_url))
|
46
46
|
urls_titles.merge!(grab_urls_and_titles(result_feed))
|
47
47
|
|
48
48
|
#as long as the feed has a next link we follow it and add the resulting video urls
|
49
49
|
loop do
|
50
50
|
next_link = result_feed.search("//feed/link[@rel='next']").first
|
51
51
|
break if next_link.nil?
|
52
|
-
result_feed = Nokogiri::HTML(
|
52
|
+
result_feed = Nokogiri::HTML(RestClient.get(next_link["href"]))
|
53
53
|
urls_titles.merge!(grab_urls_and_titles(result_feed))
|
54
54
|
end
|
55
55
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
class VideoResolver
|
3
2
|
|
4
3
|
class VideoRemovedError < StandardError; end
|
@@ -23,7 +22,7 @@ class VideoResolver
|
|
23
22
|
private
|
24
23
|
|
25
24
|
def load_json(url)
|
26
|
-
html =
|
25
|
+
html = RestClient.get(url)
|
27
26
|
json_data = html[/ytplayer\.config\s*=\s*(\{.+?\});/m, 1]
|
28
27
|
MultiJson.load(json_data)
|
29
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: viddl-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marc Seeger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -53,33 +53,33 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 1.10.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rest-client
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
62
|
-
type: :
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.
|
75
|
+
version: 10.1.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.
|
82
|
+
version: 10.1.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: minitest
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -103,6 +103,7 @@ extensions: []
|
|
103
103
|
extra_rdoc_files: []
|
104
104
|
files:
|
105
105
|
- Gemfile
|
106
|
+
- Gemfile.lock
|
106
107
|
- README.md
|
107
108
|
- Rakefile
|
108
109
|
- bin/helper/downloader.rb
|
@@ -152,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
153
|
version: 1.3.4
|
153
154
|
requirements: []
|
154
155
|
rubyforge_project: viddl-rb
|
155
|
-
rubygems_version: 2.
|
156
|
+
rubygems_version: 2.4.4
|
156
157
|
signing_key:
|
157
158
|
specification_version: 4
|
158
159
|
summary: An extendable commandline video downloader for flash video sites.
|