soundcloud-downloader 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/soundcloud-downloader.rb +11 -0
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 094fb46b3a2684269648e5dfbe25ac0e26d53dd4
4
- data.tar.gz: 957f3fc82d0b4565f238da6f8fc99115f8a6be8c
3
+ metadata.gz: dc206be31d769f4d0e10c0ed0a26c95dd5516984
4
+ data.tar.gz: f607791f93bea730aeb57388a25548d77e79f9e4
5
5
  SHA512:
6
- metadata.gz: e48c9f3b8517e8e9adca10de0c9b6a8971d40b227a5f836b0acbf41a654e397d1218c0de612ba6829c15553ddc561b7e9b61007a5b2cca0c66016a8dd0632a94
7
- data.tar.gz: d2049d48b7f2cb32741e06d2a8f12eaeca14de6de0b9f986428b90020ca4d6969361d77ac3d7a67f0db521f62d872af232e37ad7d844f6564461483da0d7ba50
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.1.0
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-19 00:00:00.000000000 Z
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: