soundyoink 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/soundyoink/audio.rb +3 -4
- data/lib/soundyoink/downloader.rb +2 -1
- 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: 374e3d6dbb02237cea4513235ae85b146de88324
|
4
|
+
data.tar.gz: dc3556d8e1853d3bdf602dc33dbf05066b9dffe9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 911339a7a1c0b2ac47af5d8e6be1c41179324932ad4488f7642b49953f83747e630779dc3073c62e07b29d805a6d1e497bef99dc76e7938191e6943b094758b9
|
7
|
+
data.tar.gz: 00744af0e119983923a93aadb555d8794f859bbaeb8082a3f6c0c3786912dc39e8e92f5fb647aacea527d67f587da29931314a1627bc69e8f723f2a55f37ae2e
|
data/lib/soundyoink/audio.rb
CHANGED
@@ -20,19 +20,18 @@ module Soundyoink
|
|
20
20
|
# it already exists and is over 10 KB.
|
21
21
|
def download
|
22
22
|
return nil if already_exists?
|
23
|
-
bar = ProgressBar.create(title: 'Downloading',
|
24
|
-
length: 70,
|
25
|
-
format: '%t |%B| %p%')
|
23
|
+
bar = ProgressBar.create(title: 'Downloading', format: '%t |%B| %p%')
|
26
24
|
filesize = nil
|
27
25
|
puts @filename
|
28
26
|
target = open(@file_url, 'rb',
|
29
27
|
content_length_proc: -> (size) { filesize = size },
|
30
28
|
progress_proc: lambda do |accumulated|
|
29
|
+
# Set bar.progress to the 'percent complete' figure
|
31
30
|
bar.progress = (accumulated.to_f / filesize * 100).to_i
|
32
31
|
end
|
33
32
|
)
|
34
33
|
File.open(@filename, 'wb') do |f|
|
35
|
-
while chunk = target.read(
|
34
|
+
while chunk = target.read(1_000_000)
|
36
35
|
f.write(chunk)
|
37
36
|
end
|
38
37
|
end
|
@@ -24,7 +24,8 @@ module Soundyoink
|
|
24
24
|
def add_profile(profile)
|
25
25
|
open(profile).read
|
26
26
|
.scan(%r{(https://[^.]+[.]net/u/[^"]+)})
|
27
|
-
.flatten
|
27
|
+
.flatten
|
28
|
+
.map { |a| @audios << Audio.new(a) }
|
28
29
|
end
|
29
30
|
|
30
31
|
# +@workers+ number of threads work on the +@audios+ queue in parallel.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soundyoink
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Plant
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Command-line utility for downloading SG material, either specific titles
|
14
14
|
or entire user histories.
|