soundcloud-downloader 1.1.0 → 1.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
- data/lib/soundcloud-downloader.rb +11 -0
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dc206be31d769f4d0e10c0ed0a26c95dd5516984
|
|
4
|
+
data.tar.gz: f607791f93bea730aeb57388a25548d77e79f9e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b7fb3c8ecbfc988f1d18be993cf9a19aeb8978ab471fa194448dc746592ee666fb7d157fe2a259b49fb1bd0b37f7b6a03f3bb2ad72a7141790502b6e156fa976
|
|
7
|
+
data.tar.gz: 7c8164e32bb72d589da3d7865b4279b88d5d2aa635973bb6a15557357df67605c36390acd1444c974e30eedcdf8a7639fd2a7059dd3f4341ef99643097ec9dd9
|
|
@@ -35,6 +35,14 @@ module SoundCloud
|
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
+
class Rails
|
|
39
|
+
def self.download!(url, filename)
|
|
40
|
+
send_data open(url).read,
|
|
41
|
+
:type => "audio/mpeg",
|
|
42
|
+
:disposition => "attachment; filename=\"#{filename}.mp3\""
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
38
46
|
class Client
|
|
39
47
|
|
|
40
48
|
attr_reader :client_id, :path, :fs_location, :url
|
|
@@ -79,6 +87,8 @@ module SoundCloud
|
|
|
79
87
|
if res.code == '302'
|
|
80
88
|
@url = res.header['Location']
|
|
81
89
|
end
|
|
90
|
+
|
|
91
|
+
@url
|
|
82
92
|
end
|
|
83
93
|
|
|
84
94
|
# Public: loads a file, either downloading it in the specified directory or in a temporory file
|
|
@@ -149,5 +159,6 @@ module SoundCloud
|
|
|
149
159
|
end
|
|
150
160
|
end
|
|
151
161
|
end
|
|
162
|
+
|
|
152
163
|
end
|
|
153
164
|
end
|
metadata
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: soundcloud-downloader
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gabriel Dehan
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-01-
|
|
11
|
+
date: 2016-01-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
|
-
description: A simple API to download soundcloud songs
|
|
13
|
+
description: A simple API to download soundcloud songs in Ruby and Rails
|
|
14
14
|
email: dehan.gabriel@gmail.com
|
|
15
15
|
executables: []
|
|
16
16
|
extensions: []
|
|
@@ -40,6 +40,6 @@ rubyforge_project:
|
|
|
40
40
|
rubygems_version: 2.4.5.1
|
|
41
41
|
signing_key:
|
|
42
42
|
specification_version: 4
|
|
43
|
-
summary: A simple API to download soundcloud songs
|
|
43
|
+
summary: A simple API to download soundcloud songs in Ruby and Rails
|
|
44
44
|
test_files: []
|
|
45
45
|
has_rdoc:
|