soundcloud-downloader 1.0.1 → 1.1.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 +13 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 094fb46b3a2684269648e5dfbe25ac0e26d53dd4
|
4
|
+
data.tar.gz: 957f3fc82d0b4565f238da6f8fc99115f8a6be8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e48c9f3b8517e8e9adca10de0c9b6a8971d40b227a5f836b0acbf41a654e397d1218c0de612ba6829c15553ddc561b7e9b61007a5b2cca0c66016a8dd0632a94
|
7
|
+
data.tar.gz: d2049d48b7f2cb32741e06d2a8f12eaeca14de6de0b9f986428b90020ca4d6969361d77ac3d7a67f0db521f62d872af232e37ad7d844f6564461483da0d7ba50
|
@@ -52,6 +52,19 @@ module SoundCloud
|
|
52
52
|
@url = nil
|
53
53
|
end
|
54
54
|
|
55
|
+
# Public: Simplest method to download a file
|
56
|
+
#
|
57
|
+
# file_name - The file name as a String
|
58
|
+
# url - The stream URL of the soundclound sound as a String
|
59
|
+
#
|
60
|
+
# Returns a File
|
61
|
+
def download(url, opts = { display_progress: true, file_name: "unknown" })
|
62
|
+
self.resolve(url)
|
63
|
+
self.load opts[:file_name] do |length, position, chunk|
|
64
|
+
SoundCloud::Downloader::Helpers.progress_bar("=", ">", position) if opts[:display_progress]
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
55
68
|
# Public: resolves a soundcloud API url
|
56
69
|
#
|
57
70
|
# url - The URL to resolve as a String.
|