viddl-rb 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/plugins/soundcloud.rb +20 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8410fb215d58b74b6942b35ac12121004925095f
|
4
|
+
data.tar.gz: 6fbf24f9bd13ba0a39c89a933bee86c20c448c42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84227fae10d7ca9b3ffa77a3a505c39e36596503b1da1ce379ef5da49033749b8ee9a3722bfaed65e6185cc59b9554acde76ba442b042f10bc58a5588423a5d4
|
7
|
+
data.tar.gz: 60a7bb221aa8fd75368ddbeafd6a1e52dab74bf7aa5533141b626c5244f9b248aa047534f8dd5409cb58df494dbc6c69b57027b36a0f3760a3112d621e8d2e84
|
data/plugins/soundcloud.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'nokogiri'
|
2
|
-
require '
|
2
|
+
require 'uri'
|
3
3
|
require 'json'
|
4
4
|
|
5
5
|
class Soundcloud < PluginBase
|
@@ -12,7 +12,23 @@ class Soundcloud < PluginBase
|
|
12
12
|
# return the url for original video file and title
|
13
13
|
def self.get_urls_and_filenames(url, options = {})
|
14
14
|
url_and_files = []
|
15
|
-
|
15
|
+
|
16
|
+
doc = Nokogiri::HTML(open(get_http_url(url)))
|
17
|
+
js = doc.at("script:contains('_scPreload')").text
|
18
|
+
|
19
|
+
track_data = JSON.parse js[/_scPreload\s*?=\s*?([\s\S]*?)$/,1].to_s
|
20
|
+
|
21
|
+
track_data['data']['models/audible'].each do |track_data|
|
22
|
+
params = URI.encode_www_form 'app_version' => '6749d1a0',
|
23
|
+
'client_id' => 'b45b1aa10f1ac2941910a7f0d10f8e28',
|
24
|
+
'policy' => 'ALLOW'
|
25
|
+
|
26
|
+
url_and_files << {
|
27
|
+
url: URI("#{track_data['stream_url']}?#{params}").to_s.to_s,
|
28
|
+
name: self.make_filename_safe(track_data['title'].to_s) + '.mp3'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
16
32
|
|
17
33
|
# locate the controller script that contains all the tracks data
|
18
34
|
# this will work for either artist's or track's pages
|
@@ -30,6 +46,6 @@ class Soundcloud < PluginBase
|
|
30
46
|
end
|
31
47
|
|
32
48
|
def self.get_http_url(url)
|
33
|
-
url.sub(/
|
49
|
+
url.sub(/http:\/\//, "https:\/\/")
|
34
50
|
end
|
35
|
-
end
|
51
|
+
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.6
|
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-
|
11
|
+
date: 2014-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|