rget 2.6.0 → 2.7.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/bin/nicodl +49 -36
- data/rget.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c90456779aba13450998afcadce3edbe6cd9ece
|
4
|
+
data.tar.gz: c53800c64c011fae5ee65c5ee35ea121ae242ef9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0aba75ce2fd55381d14f7fcac499abfed5150f797a51e57e5c5daa000e09c4183df070b87192c4047baf7cc6581b3b4cfeeb3423daecabb002e8095ca322dd07
|
7
|
+
data.tar.gz: d53ff24fb9cb41ab6d0a8c5b07a720c827f344557d9dbe6051051b450afff66e0d85107a5c0a580b43ea283f00d0706d8ff0a3e4ee9f1bdc79d0417fefb55b1c
|
data/bin/nicodl
CHANGED
@@ -15,7 +15,17 @@ account = Pit::get('nicovideo', :require => {
|
|
15
15
|
:pass => 'your nicovideo password'
|
16
16
|
})
|
17
17
|
nico = Niconico.new(account[:id], account[:pass])
|
18
|
-
|
18
|
+
retry_count = 0
|
19
|
+
begin
|
20
|
+
nico.login
|
21
|
+
rescue Mechanize::ResponseReadError
|
22
|
+
retry_count += 1
|
23
|
+
if retry_count < 10
|
24
|
+
puts "login faiure. retring(#{retry_count})"
|
25
|
+
sleep 5
|
26
|
+
retry
|
27
|
+
end
|
28
|
+
end
|
19
29
|
|
20
30
|
video_id = Pathname(URI(player_url).path).basename.to_s
|
21
31
|
begin
|
@@ -28,43 +38,46 @@ begin
|
|
28
38
|
rescue Mechanize::ResponseCodeError
|
29
39
|
# live streaming time-shift
|
30
40
|
live = nico.live(video_id)
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
begin
|
42
|
+
live.rtmpdump_commands(video_id).each_with_index do |cmd, i|
|
43
|
+
src = "#{video_id}-#{i+1}.flv"
|
44
|
+
dst = "#{live.title.gsub(%r|/|, '_')}-#{i+1}.mp4"
|
45
|
+
unless File.exist?(src)
|
46
|
+
cmd[cmd.index('-o') + 1] = "./#{src}"
|
47
|
+
begin
|
48
|
+
o, e, s = Open3.capture3(cmd.join(' '))
|
49
|
+
unless s.exitstatus == 0
|
50
|
+
$stderr.puts e
|
51
|
+
next
|
52
|
+
end
|
53
|
+
rescue Errno::ENOENT # rtmdump command not found
|
54
|
+
$stderr.puts $!
|
55
|
+
exit 1
|
56
|
+
end
|
57
|
+
else
|
58
|
+
$stderr.puts "#{src} is existent. skipping."
|
46
59
|
end
|
47
|
-
rescue Errno::ENOENT
|
48
|
-
$stderr.puts $!
|
49
|
-
exit 1
|
50
|
-
end
|
51
|
-
end
|
52
60
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
61
|
+
avconv = 'avconv'
|
62
|
+
args = " -i '#{src}' -acodec copy -vcodec copy '#{dst}'"
|
63
|
+
begin
|
64
|
+
o, e, s = Open3.capture3(avconv + args)
|
65
|
+
unless s.exitstatus == 0
|
66
|
+
$stderr.puts e
|
67
|
+
next
|
68
|
+
end
|
69
|
+
File.delete(src)
|
70
|
+
rescue Errno::ENOENT
|
71
|
+
if avconv == 'ffmpeg'
|
72
|
+
$stderr.puts $!
|
73
|
+
else
|
74
|
+
avconv = 'ffmpeg'
|
75
|
+
retry
|
76
|
+
end
|
77
|
+
end
|
68
78
|
end
|
79
|
+
rescue Niconico::Live::TicketRetrievingFailed
|
80
|
+
$stderr.puts $!
|
81
|
+
exit 2
|
69
82
|
end
|
70
83
|
end
|
data/rget.gemspec
CHANGED
@@ -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 = "2.
|
7
|
+
spec.version = "2.7.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, animate, onsen, seaside communications, niconico and youtube.}
|
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: 2.
|
4
|
+
version: 2.7.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: 2016-
|
11
|
+
date: 2016-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
185
|
version: '0'
|
186
186
|
requirements: []
|
187
187
|
rubyforge_project:
|
188
|
-
rubygems_version: 2.
|
188
|
+
rubygems_version: 2.6.4
|
189
189
|
signing_key:
|
190
190
|
specification_version: 4
|
191
191
|
summary: Downloading newest radio programs on the web.
|