viddl-rb 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +27 -27
  3. data/plugins/soundcloud.rb +14 -30
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d215777e25683d6ac2f60e80fbe24595e53b483
4
- data.tar.gz: 92a9de5a18af78281c05bebfb2c8788b7683e749
3
+ metadata.gz: c8704c8fbe774beea79cf1d5042762011bf6d37f
4
+ data.tar.gz: 795aeeaa20ccb0c33d277f9ca33c66faceccfc2b
5
5
  SHA512:
6
- metadata.gz: f69749d90bb44060158f3dbee3f1cb7da589b85888b3a49bbc1f3b0ed7263523e68a39cff9343eaf102ba13cbc15d2d249bec1d8cc0e70372ac0ffb80b25753f
7
- data.tar.gz: b83d81a78138fb601d6a2bbcfdf0dc9accffc25878d08527aefa5d1721c9c13be8824b97293a1494589ca21fb90276332bc57c303576fa53df440024c87e0599
6
+ metadata.gz: bbe705bc0ca0526eb287c4ed6373b0bf1f90a089f61e18f948f293456dd9ebf3e5252f0931cb568fd97758674fcf9026067bf7aacead722f31acdc9f1edb7eb4
7
+ data.tar.gz: 9dfbf373d14dfa40ed3b84c60502094bfeb33d805968570115bfbcd4a57ae096813e93b40bbc1ec061b50ed67dafdbb1fe3e110ea521a43fa30bae49f8fc3f0f
@@ -1,31 +1,28 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- viddl-rb (1.0.7)
4
+ viddl-rb (1.0.1)
5
+ mime-types (~> 2.1.0)
5
6
  multi_json (~> 1.10.0)
6
7
  nokogiri (~> 1.6.0)
7
8
  progressbar (~> 0.21)
8
- rest-client
9
9
 
10
10
  GEM
11
11
  remote: http://rubygems.org/
12
12
  specs:
13
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)
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)
21
20
  progressbar (0.21.0)
22
- racc (1.4.12)
21
+ racc (1.4.11)
23
22
  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)
23
+ rest-client (1.6.7)
24
+ mime-types (>= 1.16)
25
+ rubysl (2.0.15)
29
26
  rubysl-abbrev (~> 2.0)
30
27
  rubysl-base64 (~> 2.0)
31
28
  rubysl-benchmark (~> 2.0)
@@ -59,7 +56,7 @@ GEM
59
56
  rubysl-io-nonblock (~> 2.0)
60
57
  rubysl-io-wait (~> 2.0)
61
58
  rubysl-ipaddr (~> 2.0)
62
- rubysl-irb (~> 2.1)
59
+ rubysl-irb (~> 2.0)
63
60
  rubysl-logger (~> 2.0)
64
61
  rubysl-mathn (~> 2.0)
65
62
  rubysl-matrix (~> 2.0)
@@ -88,6 +85,7 @@ GEM
88
85
  rubysl-pstore (~> 2.0)
89
86
  rubysl-pty (~> 2.0)
90
87
  rubysl-rational (~> 2.0)
88
+ rubysl-readline (~> 2.0)
91
89
  rubysl-resolv (~> 2.0)
92
90
  rubysl-rexml (~> 2.0)
93
91
  rubysl-rinda (~> 2.0)
@@ -129,7 +127,7 @@ GEM
129
127
  rubysl-csv (2.0.2)
130
128
  rubysl-english (~> 2.0)
131
129
  rubysl-curses (2.0.1)
132
- rubysl-date (2.0.8)
130
+ rubysl-date (2.0.6)
133
131
  rubysl-delegate (2.0.1)
134
132
  rubysl-digest (2.0.3)
135
133
  rubysl-drb (2.0.1)
@@ -154,12 +152,12 @@ GEM
154
152
  rubysl-io-nonblock (2.0.0)
155
153
  rubysl-io-wait (2.0.0)
156
154
  rubysl-ipaddr (2.0.0)
157
- rubysl-irb (2.1.0)
158
- rb-readline (~> 0.5)
155
+ rubysl-irb (2.0.4)
159
156
  rubysl-e2mmap (~> 2.0)
160
157
  rubysl-mathn (~> 2.0)
158
+ rubysl-readline (~> 2.0)
161
159
  rubysl-thread (~> 2.0)
162
- rubysl-logger (2.1.0)
160
+ rubysl-logger (2.0.0)
163
161
  rubysl-mathn (2.0.0)
164
162
  rubysl-matrix (2.1.0)
165
163
  rubysl-e2mmap (~> 2.0)
@@ -182,20 +180,21 @@ GEM
182
180
  rubysl-observer (2.0.0)
183
181
  rubysl-open-uri (2.0.0)
184
182
  rubysl-open3 (2.0.0)
185
- rubysl-openssl (2.2.1)
183
+ rubysl-openssl (2.1.0)
186
184
  rubysl-optparse (2.0.1)
187
185
  rubysl-shellwords (~> 2.0)
188
186
  rubysl-ostruct (2.0.4)
189
- rubysl-pathname (2.1.0)
190
- rubysl-prettyprint (2.0.3)
187
+ rubysl-pathname (2.0.0)
188
+ rubysl-prettyprint (2.0.2)
191
189
  rubysl-prime (2.0.1)
192
190
  rubysl-profile (2.0.0)
193
191
  rubysl-profiler (2.0.1)
194
192
  rubysl-pstore (2.0.0)
195
193
  rubysl-pty (2.0.2)
196
194
  rubysl-rational (2.0.1)
197
- rubysl-resolv (2.1.0)
198
- rubysl-rexml (2.0.4)
195
+ rubysl-readline (2.0.2)
196
+ rubysl-resolv (2.0.0)
197
+ rubysl-rexml (2.0.2)
199
198
  rubysl-rinda (2.0.1)
200
199
  rubysl-rss (2.0.0)
201
200
  rubysl-scanf (2.0.0)
@@ -207,14 +206,14 @@ GEM
207
206
  rubysl-stringio (2.0.0)
208
207
  rubysl-strscan (2.0.0)
209
208
  rubysl-sync (2.0.0)
210
- rubysl-syslog (2.1.0)
209
+ rubysl-syslog (2.0.1)
211
210
  ffi2-generators (~> 0.1)
212
211
  rubysl-tempfile (2.0.1)
213
212
  rubysl-thread (2.0.2)
214
213
  rubysl-thwait (2.0.0)
215
214
  rubysl-time (2.0.3)
216
215
  rubysl-timeout (2.0.0)
217
- rubysl-tmpdir (2.0.1)
216
+ rubysl-tmpdir (2.0.0)
218
217
  rubysl-tsort (2.0.1)
219
218
  rubysl-un (2.0.0)
220
219
  rubysl-fileutils (~> 2.0)
@@ -233,5 +232,6 @@ DEPENDENCIES
233
232
  minitest
234
233
  racc
235
234
  rake (~> 10.1.0)
235
+ rest-client (~> 1.6.7)
236
236
  rubysl (~> 2.0)
237
237
  viddl-rb!
@@ -9,39 +9,23 @@ class Soundcloud < PluginBase
9
9
  end
10
10
 
11
11
 
12
- # return the url for original video file and title
12
+ # return the url for original audio file and title
13
13
  def self.get_urls_and_filenames(url, options = {})
14
14
  url_and_files = []
15
15
 
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
19
-
20
- track_data = JSON.parse js[/_scPreload\s*?=\s*?([\s\S]*?)$/,1].to_s
21
-
22
- track_data['data']['models/audible'].each do |track_data|
23
- params = URI.encode_www_form 'app_version' => '6749d1a0',
24
- 'client_id' => 'b45b1aa10f1ac2941910a7f0d10f8e28',
25
- 'policy' => 'ALLOW'
26
-
27
- url_and_files << {
28
- url: URI("#{track_data['stream_url']}?#{params}").to_s.to_s,
29
- name: self.make_filename_safe(track_data['title'].to_s) + '.mp3'
30
- }
31
- end
32
-
33
-
34
- # locate the controller script that contains all the tracks data
35
- # this will work for either artist's or track's pages
36
- doc.css('#main-content-inner .container + script').each do |container|
37
- match = container.text.to_s.match(/\((\{.*\})\)/).to_a
38
- track_data = JSON.parse(match[1])
39
-
40
- file_url = track_data['streamUrl']
41
- file_name = self.make_filename_safe(track_data['title'].to_s) + '.mp3'
42
-
43
- url_and_files << {url: file_url, name: file_name}
44
- end
16
+ track_id_url = "https://api.sndcdn.com/resolve?url=#{URI::encode(url)}&client_id=b45b1aa10f1ac2941910a7f0d10f8e28"
17
+ track_id_response = open(track_id_url, {ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE}).read
18
+ track_id_response_parsed = JSON.parse(track_id_response)
19
+ title = track_id_response_parsed['title']
20
+ track_id = track_id_response_parsed['id']
21
+ download_metadata_url = "https://api.sndcdn.com/i1/tracks/#{track_id}/streams?client_id=b45b1aa10f1ac2941910a7f0d10f8e28"
22
+ download_metadata_response = open(download_metadata_url, {ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE}).read
23
+ download_url = JSON.parse(download_metadata_response)['http_mp3_128_url']
24
+
25
+ url_and_files << {
26
+ url: download_url,
27
+ name: self.make_filename_safe(title) + '.mp3'
28
+ }
45
29
 
46
30
  url_and_files
47
31
  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.8
4
+ version: 1.0.9
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-23 00:00:00.000000000 Z
11
+ date: 2015-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  version: 1.3.4
154
154
  requirements: []
155
155
  rubyforge_project: viddl-rb
156
- rubygems_version: 2.4.4
156
+ rubygems_version: 2.4.3
157
157
  signing_key:
158
158
  specification_version: 4
159
159
  summary: An extendable commandline video downloader for flash video sites.