rget 4.7.9 → 4.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nicovideo.rb +5 -12
  3. data/rget.gemspec +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b85c110b505929985cd92908686b3a2664ca59d7fc6f63518f4e390d447c48c4
4
- data.tar.gz: 2d5ef13d9c67cea85236853a02b4d12366eb08fb5e3647a09a6362038d651f89
3
+ metadata.gz: 834e0d540f9bd9fdd0bbe9934e42f90ea4f92d21b1f3af517c179f0e26cf003d
4
+ data.tar.gz: 199d831fa1f8e869b0cb043423d0078afc6d8a5adbc249de5597583b70e2dfef
5
5
  SHA512:
6
- metadata.gz: 5aa6d44988bcf464f4cead0ff376a5d855c2613af012ea543f5f188b6ba0e02d842fc9c35ac5fb555b7873c01818cdfb0a231875a76234da08c7c3d49cef2c84
7
- data.tar.gz: 5f2ca5cfd3a1f47ee091f08b9de7f6312ac42427b1110ab6c1ee9c017683ef337b84e767b62363fcce5e9d4debf12a6f43364edd6ca8eb327996c19d9d5badf5
6
+ metadata.gz: 825634c0345fe163c8e4093440c43fd2edee84c520629a4cc674d1ef381acb49b3e7305e0f570ce9f3c6e51298213d42820d8cf7970226becf240c8174cfb19d
7
+ data.tar.gz: 63bde6ba6ddd23390f871fb3ee544e693f95581d0b25ffab0b92f2374c6fe91df61577716c8723b95328313419038490f5a1612880cb21433d49bd54512471d6
@@ -34,18 +34,11 @@ class Nicovideo < WebRadio
34
34
  @file = "#{@label}##{'%02d' % serial}#{appendix}.#{video.type}"
35
35
  @mp3_file = @file.sub(/\....$/, '.mp3')
36
36
  mp3nize(@file, @mp3_file) do
37
- open(@file, 'wb:ASCII-8BIT') do |o|
38
- begin
39
- count = 1
40
- video.get_video do |body|
41
- raise DownloadError.new(body) if body == '403 Forbidden'
42
- print '.' if count % 400 == 0
43
- o.write(body)
44
- count += 1
45
- end
46
- rescue Niconico::Video::VideoUnavailableError => e
47
- raise DownloadError.new(e.message)
48
- end
37
+ loop do
38
+ print '.'
39
+ _, err, status = Open3.capture3("youtube-dl -f mp4 -o #{@file} --netrc #{video.url}")
40
+ break if status == 0
41
+ raise DownloadError.new(err) unless err =~ /403: Forbidden/
49
42
  end
50
43
  end
51
44
  end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "rget"
7
- spec.version = "4.7.9"
7
+ spec.version = "4.8.0"
8
8
  spec.authors = ["TADA Tadashi"]
9
9
  spec.email = ["t@tdtds.jp"]
10
10
  spec.description = %q{Downloading newest radio programs on the web. Supported radio stations are hibiki, onsen, niconico, freshlive, himalaya and asobi store.}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rget
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.7.9
4
+ version: 4.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - TADA Tadashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-19 00:00:00.000000000 Z
11
+ date: 2019-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor