viddl-rb 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/plugins/vimeo.rb +27 -1
  4. metadata +2 -3
  5. data/Gemfile.lock +0 -237
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8410fb215d58b74b6942b35ac12121004925095f
4
- data.tar.gz: 6fbf24f9bd13ba0a39c89a933bee86c20c448c42
3
+ metadata.gz: ee4284bc6f3bbd221b3bb3c684c378221b1dbcf6
4
+ data.tar.gz: 0883656d2e90d010f30c151c3cafa6b68678470e
5
5
  SHA512:
6
- metadata.gz: 84227fae10d7ca9b3ffa77a3a505c39e36596503b1da1ce379ef5da49033749b8ee9a3722bfaed65e6185cc59b9554acde76ba442b042f10bc58a5588423a5d4
7
- data.tar.gz: 60a7bb221aa8fd75368ddbeafd6a1e52dab74bf7aa5533141b626c5244f9b248aa047534f8dd5409cb58df494dbc6c69b57027b36a0f3760a3112d621e8d2e84
6
+ metadata.gz: 8418fadf2a248f27d0e5f2bd6ae6cf1cea6215379c11d6028bfdc357f97fb63b98bd90f61ba8b4af9ac0353cd4452a738395a445a2e20c1abf3cf38e608b7b67
7
+ data.tar.gz: 1153fe02d664a8e7e67f07d42103afc3ed8b7c0697c5f2c4b0a6836fa4f9071f23e1b92d1bc84172ed191d42312d128bf20157856e94ab5452546d080b7e5e1f
data/README.md CHANGED
@@ -130,8 +130,8 @@ __Co Maintainers:__
130
130
  __Contributors:__
131
131
  * [albertoboni](https://github.com/albertoboni) bandcamp plugin, soundcloud improvements
132
132
  * [divout](https://github.com/divout) aka Ivan K: blip.tv plugin, bugfixes
133
+ * [laserlemon](https://github.com/laserlemon): Adding gemnasium images to readme
133
134
  * [mbajur](https://github.com/mbajur) aka Mike Bajur: The instagram plugin
134
135
  * Sniper: bugfixes
135
136
  * [Serabe](https://github.com/Serabe) aka Sergio Arbeo: packaging viddl as a binary
136
- * [laserlemon](https://github.com/laserlemon): Adding gemnasium images to readme
137
-
137
+ * [simplysoft](https://github.com/simplysoft): Improve vimeo plugin
@@ -12,7 +12,11 @@ class Vimeo < PluginBase
12
12
  video_url = "http://player.vimeo.com/video/#{vimeo_id}"
13
13
  video_page = open(video_url).read
14
14
 
15
- info_json = video_page[/a=(\{.+?);/, 1]
15
+ info_json = find_player_info(video_page)
16
+ unless info_json
17
+ raise CouldNotDownloadVideoError, "Could not find video urls\n" +
18
+ "Please report this bug at github.com/rb2k/viddl-rb so it can be fixed!"
19
+ end
16
20
  parsed = MultiJson.load(info_json)
17
21
 
18
22
  files = parsed["request"]["files"]
@@ -33,5 +37,27 @@ class Vimeo < PluginBase
33
37
 
34
38
  [{:url => download_url, :name => file_name}]
35
39
  end
40
+
41
+ def self.find_player_info(string)
42
+ # Based on http://stackoverflow.com/questions/25273624/ruby-regex-that-will-find-a-json-object-in-the-middle-of-a-string
43
+ # Does also return some JSON primitives, so it not guaranteed that we only get objects, but we do not care as we are only
44
+ # searching for one specific match that we know is a JSON object
45
+ re = /
46
+ (?:
47
+ (?<number> -?(?=[1-9]|0(?!\d))\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)
48
+ (?<boolean> true | false | null )
49
+ (?<string> " (?:[^"\\]++ | \\ ["\\bfnrt\/] | \\ u [0-9a-f]{4} )* " )
50
+ (?<array> \[ (?> \g<json> (?: , \g<json> )* )? \s* \] )
51
+ (?<pair> \s* \g<string> \s* : \g<json> )
52
+ (?<object> \{ (?> \g<pair> (?: , \g<pair> )* )? \s* \} )
53
+ (?<json> \s* (?> \g<number> | \g<boolean> | \g<string> | \g<array> | \g<object> ) \s*)
54
+ ){0}
55
+ \g<object>
56
+ /uix
57
+
58
+
59
+ string.scan(re).flatten.compact.select{|s| s.include? "vimeocdn.com"}.first
60
+ end
61
+
36
62
  end
37
63
 
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.6
4
+ version: 1.0.7
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-10-03 00:00:00.000000000 Z
11
+ date: 2014-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -103,7 +103,6 @@ extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
105
  - Gemfile
106
- - Gemfile.lock
107
106
  - README.md
108
107
  - Rakefile
109
108
  - bin/helper/downloader.rb
@@ -1,237 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- viddl-rb (1.0.1)
5
- mime-types (~> 2.1.0)
6
- multi_json (~> 1.10.0)
7
- nokogiri (~> 1.6.0)
8
- progressbar (~> 0.21)
9
-
10
- GEM
11
- remote: http://rubygems.org/
12
- specs:
13
- ffi2-generators (0.1.1)
14
- mime-types (2.1)
15
- mini_portile (0.5.3)
16
- minitest (5.2.2)
17
- multi_json (1.10.0)
18
- nokogiri (1.6.1)
19
- mini_portile (~> 0.5.0)
20
- progressbar (0.21.0)
21
- racc (1.4.11)
22
- rake (10.1.1)
23
- rest-client (1.6.7)
24
- mime-types (>= 1.16)
25
- rubysl (2.0.15)
26
- rubysl-abbrev (~> 2.0)
27
- rubysl-base64 (~> 2.0)
28
- rubysl-benchmark (~> 2.0)
29
- rubysl-bigdecimal (~> 2.0)
30
- rubysl-cgi (~> 2.0)
31
- rubysl-cgi-session (~> 2.0)
32
- rubysl-cmath (~> 2.0)
33
- rubysl-complex (~> 2.0)
34
- rubysl-continuation (~> 2.0)
35
- rubysl-coverage (~> 2.0)
36
- rubysl-csv (~> 2.0)
37
- rubysl-curses (~> 2.0)
38
- rubysl-date (~> 2.0)
39
- rubysl-delegate (~> 2.0)
40
- rubysl-digest (~> 2.0)
41
- rubysl-drb (~> 2.0)
42
- rubysl-e2mmap (~> 2.0)
43
- rubysl-english (~> 2.0)
44
- rubysl-enumerator (~> 2.0)
45
- rubysl-erb (~> 2.0)
46
- rubysl-etc (~> 2.0)
47
- rubysl-expect (~> 2.0)
48
- rubysl-fcntl (~> 2.0)
49
- rubysl-fiber (~> 2.0)
50
- rubysl-fileutils (~> 2.0)
51
- rubysl-find (~> 2.0)
52
- rubysl-forwardable (~> 2.0)
53
- rubysl-getoptlong (~> 2.0)
54
- rubysl-gserver (~> 2.0)
55
- rubysl-io-console (~> 2.0)
56
- rubysl-io-nonblock (~> 2.0)
57
- rubysl-io-wait (~> 2.0)
58
- rubysl-ipaddr (~> 2.0)
59
- rubysl-irb (~> 2.0)
60
- rubysl-logger (~> 2.0)
61
- rubysl-mathn (~> 2.0)
62
- rubysl-matrix (~> 2.0)
63
- rubysl-mkmf (~> 2.0)
64
- rubysl-monitor (~> 2.0)
65
- rubysl-mutex_m (~> 2.0)
66
- rubysl-net-ftp (~> 2.0)
67
- rubysl-net-http (~> 2.0)
68
- rubysl-net-imap (~> 2.0)
69
- rubysl-net-pop (~> 2.0)
70
- rubysl-net-protocol (~> 2.0)
71
- rubysl-net-smtp (~> 2.0)
72
- rubysl-net-telnet (~> 2.0)
73
- rubysl-nkf (~> 2.0)
74
- rubysl-observer (~> 2.0)
75
- rubysl-open-uri (~> 2.0)
76
- rubysl-open3 (~> 2.0)
77
- rubysl-openssl (~> 2.0)
78
- rubysl-optparse (~> 2.0)
79
- rubysl-ostruct (~> 2.0)
80
- rubysl-pathname (~> 2.0)
81
- rubysl-prettyprint (~> 2.0)
82
- rubysl-prime (~> 2.0)
83
- rubysl-profile (~> 2.0)
84
- rubysl-profiler (~> 2.0)
85
- rubysl-pstore (~> 2.0)
86
- rubysl-pty (~> 2.0)
87
- rubysl-rational (~> 2.0)
88
- rubysl-readline (~> 2.0)
89
- rubysl-resolv (~> 2.0)
90
- rubysl-rexml (~> 2.0)
91
- rubysl-rinda (~> 2.0)
92
- rubysl-rss (~> 2.0)
93
- rubysl-scanf (~> 2.0)
94
- rubysl-securerandom (~> 2.0)
95
- rubysl-set (~> 2.0)
96
- rubysl-shellwords (~> 2.0)
97
- rubysl-singleton (~> 2.0)
98
- rubysl-socket (~> 2.0)
99
- rubysl-stringio (~> 2.0)
100
- rubysl-strscan (~> 2.0)
101
- rubysl-sync (~> 2.0)
102
- rubysl-syslog (~> 2.0)
103
- rubysl-tempfile (~> 2.0)
104
- rubysl-thread (~> 2.0)
105
- rubysl-thwait (~> 2.0)
106
- rubysl-time (~> 2.0)
107
- rubysl-timeout (~> 2.0)
108
- rubysl-tmpdir (~> 2.0)
109
- rubysl-tsort (~> 2.0)
110
- rubysl-un (~> 2.0)
111
- rubysl-uri (~> 2.0)
112
- rubysl-weakref (~> 2.0)
113
- rubysl-webrick (~> 2.0)
114
- rubysl-xmlrpc (~> 2.0)
115
- rubysl-yaml (~> 2.0)
116
- rubysl-zlib (~> 2.0)
117
- rubysl-abbrev (2.0.4)
118
- rubysl-base64 (2.0.0)
119
- rubysl-benchmark (2.0.1)
120
- rubysl-bigdecimal (2.0.2)
121
- rubysl-cgi (2.0.1)
122
- rubysl-cgi-session (2.0.1)
123
- rubysl-cmath (2.0.0)
124
- rubysl-complex (2.0.0)
125
- rubysl-continuation (2.0.0)
126
- rubysl-coverage (2.0.3)
127
- rubysl-csv (2.0.2)
128
- rubysl-english (~> 2.0)
129
- rubysl-curses (2.0.1)
130
- rubysl-date (2.0.6)
131
- rubysl-delegate (2.0.1)
132
- rubysl-digest (2.0.3)
133
- rubysl-drb (2.0.1)
134
- rubysl-e2mmap (2.0.0)
135
- rubysl-english (2.0.0)
136
- rubysl-enumerator (2.0.0)
137
- rubysl-erb (2.0.1)
138
- rubysl-etc (2.0.3)
139
- ffi2-generators (~> 0.1)
140
- rubysl-expect (2.0.0)
141
- rubysl-fcntl (2.0.4)
142
- ffi2-generators (~> 0.1)
143
- rubysl-fiber (2.0.0)
144
- rubysl-fileutils (2.0.3)
145
- rubysl-find (2.0.1)
146
- rubysl-forwardable (2.0.1)
147
- rubysl-getoptlong (2.0.0)
148
- rubysl-gserver (2.0.0)
149
- rubysl-socket (~> 2.0)
150
- rubysl-thread (~> 2.0)
151
- rubysl-io-console (2.0.0)
152
- rubysl-io-nonblock (2.0.0)
153
- rubysl-io-wait (2.0.0)
154
- rubysl-ipaddr (2.0.0)
155
- rubysl-irb (2.0.4)
156
- rubysl-e2mmap (~> 2.0)
157
- rubysl-mathn (~> 2.0)
158
- rubysl-readline (~> 2.0)
159
- rubysl-thread (~> 2.0)
160
- rubysl-logger (2.0.0)
161
- rubysl-mathn (2.0.0)
162
- rubysl-matrix (2.1.0)
163
- rubysl-e2mmap (~> 2.0)
164
- rubysl-mkmf (2.0.1)
165
- rubysl-fileutils (~> 2.0)
166
- rubysl-shellwords (~> 2.0)
167
- rubysl-monitor (2.0.0)
168
- rubysl-mutex_m (2.0.0)
169
- rubysl-net-ftp (2.0.1)
170
- rubysl-net-http (2.0.4)
171
- rubysl-cgi (~> 2.0)
172
- rubysl-erb (~> 2.0)
173
- rubysl-singleton (~> 2.0)
174
- rubysl-net-imap (2.0.1)
175
- rubysl-net-pop (2.0.1)
176
- rubysl-net-protocol (2.0.1)
177
- rubysl-net-smtp (2.0.1)
178
- rubysl-net-telnet (2.0.0)
179
- rubysl-nkf (2.0.1)
180
- rubysl-observer (2.0.0)
181
- rubysl-open-uri (2.0.0)
182
- rubysl-open3 (2.0.0)
183
- rubysl-openssl (2.1.0)
184
- rubysl-optparse (2.0.1)
185
- rubysl-shellwords (~> 2.0)
186
- rubysl-ostruct (2.0.4)
187
- rubysl-pathname (2.0.0)
188
- rubysl-prettyprint (2.0.2)
189
- rubysl-prime (2.0.1)
190
- rubysl-profile (2.0.0)
191
- rubysl-profiler (2.0.1)
192
- rubysl-pstore (2.0.0)
193
- rubysl-pty (2.0.2)
194
- rubysl-rational (2.0.1)
195
- rubysl-readline (2.0.2)
196
- rubysl-resolv (2.0.0)
197
- rubysl-rexml (2.0.2)
198
- rubysl-rinda (2.0.1)
199
- rubysl-rss (2.0.0)
200
- rubysl-scanf (2.0.0)
201
- rubysl-securerandom (2.0.0)
202
- rubysl-set (2.0.1)
203
- rubysl-shellwords (2.0.0)
204
- rubysl-singleton (2.0.0)
205
- rubysl-socket (2.0.1)
206
- rubysl-stringio (2.0.0)
207
- rubysl-strscan (2.0.0)
208
- rubysl-sync (2.0.0)
209
- rubysl-syslog (2.0.1)
210
- ffi2-generators (~> 0.1)
211
- rubysl-tempfile (2.0.1)
212
- rubysl-thread (2.0.2)
213
- rubysl-thwait (2.0.0)
214
- rubysl-time (2.0.3)
215
- rubysl-timeout (2.0.0)
216
- rubysl-tmpdir (2.0.0)
217
- rubysl-tsort (2.0.1)
218
- rubysl-un (2.0.0)
219
- rubysl-fileutils (~> 2.0)
220
- rubysl-optparse (~> 2.0)
221
- rubysl-uri (2.0.0)
222
- rubysl-weakref (2.0.0)
223
- rubysl-webrick (2.0.0)
224
- rubysl-xmlrpc (2.0.0)
225
- rubysl-yaml (2.0.4)
226
- rubysl-zlib (2.0.1)
227
-
228
- PLATFORMS
229
- ruby
230
-
231
- DEPENDENCIES
232
- minitest
233
- racc
234
- rake (~> 10.1.0)
235
- rest-client (~> 1.6.7)
236
- rubysl (~> 2.0)
237
- viddl-rb!