rget 4.8.0 → 4.8.1
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/README.md +18 -12
- data/lib/nicovideo.rb +1 -1
- data/rget.gemspec +1 -1
- metadata +2 -4
- data/bin/nicodl +0 -95
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0306965ff2fde96075fa3ac6091c574933444350b9c65ab435377308a5c7653d'
|
4
|
+
data.tar.gz: 0542dcc90ce49a97575d236c21bd886a45ba21a6b1694ee9e0033f330ce6d28b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2168dc90edd9d75518486a4cfb30fe1ebdba02a9d74923b0525b055ef950f4ace7e9d1dc5aa46e03cdf2ea09f39027581c9329fb5251cfec802ea80548bf63ed
|
7
|
+
data.tar.gz: 44234879f485caeca1571a28572de58ef4ee84ad54b9935f8464ce6c26b1dbba832b0a4a317c4cce732bfcbea63a245cdc092c287b350f4e7d741f9e2ee7e888
|
data/README.md
CHANGED
@@ -10,20 +10,30 @@ Downloading newest radio programs on the web. Supported radio stations are:
|
|
10
10
|
* Abobi Store
|
11
11
|
|
12
12
|
If you want to save files as MP3, needs `ffmpeg` command.
|
13
|
+
To download niconico video, also needs latest `youtube-dl` command (you can get it from `https://yt-dl.org/`), then specify niconico user ID and password to `~/.netrc` as:
|
14
|
+
|
15
|
+
```
|
16
|
+
machine niconico
|
17
|
+
login [your login]
|
18
|
+
password [your password]
|
19
|
+
```
|
13
20
|
|
14
21
|
For customize radio programs, copy `rget.yaml` to `~/.rget` or current work directory and edit it. config file search paths are:
|
15
22
|
|
16
|
-
*
|
17
|
-
*
|
18
|
-
*
|
19
|
-
*
|
23
|
+
* `RGET_CONFIG` environment variable
|
24
|
+
* `./rget.yaml`
|
25
|
+
* `~/.rget`
|
26
|
+
* `<command path>/../rget.yaml` (for gem)
|
20
27
|
|
21
28
|
## Installation
|
22
29
|
```
|
23
30
|
$ gem install rget
|
24
31
|
```
|
32
|
+
|
25
33
|
## Usage
|
26
34
|
### rget command
|
35
|
+
download a recent radio program to .MP3/.MP4 file.
|
36
|
+
|
27
37
|
```
|
28
38
|
# save a template of the radio program configration
|
29
39
|
rget yaml http://example.com/radio >> ~/.rget
|
@@ -31,7 +41,7 @@ rget yaml http://example.com/radio >> ~/.rget
|
|
31
41
|
# download and convert to mp3 THE iDOLM@STER Cinderella Girls Radio
|
32
42
|
rget imas_cg
|
33
43
|
|
34
|
-
# download takamori only (
|
44
|
+
# download takamori only (saving movie file as .MP4)
|
35
45
|
rget takamori --no-mp3
|
36
46
|
|
37
47
|
# srore mp3 file to specified directory
|
@@ -40,13 +50,9 @@ rget suzakinishi --path=/home/hoge/radio
|
|
40
50
|
# store mp3 file to radio folder of Dropbox
|
41
51
|
rget matsui --path=dropbpx://radio
|
42
52
|
```
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
nicodl http://live.nicovideo.jp/watch/lv999999999
|
47
|
-
```
|
48
|
-
### add\_mp3info
|
53
|
+
|
54
|
+
### add\_mp3info command
|
55
|
+
set cover photo into mp3 file and set file name as the title
|
49
56
|
```
|
50
|
-
# set cover photo into mp3 file
|
51
57
|
add_mp3info sample.mp3 cover.jpg
|
52
58
|
```
|
data/lib/nicovideo.rb
CHANGED
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 = "4.8.
|
7
|
+
spec.version = "4.8.1"
|
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.8.
|
4
|
+
version: 4.8.1
|
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-08-
|
11
|
+
date: 2019-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -156,7 +156,6 @@ email:
|
|
156
156
|
- t@tdtds.jp
|
157
157
|
executables:
|
158
158
|
- add_mp3info
|
159
|
-
- nicodl
|
160
159
|
- rget
|
161
160
|
- ulizadl
|
162
161
|
extensions: []
|
@@ -169,7 +168,6 @@ files:
|
|
169
168
|
- README.md
|
170
169
|
- Rakefile
|
171
170
|
- bin/add_mp3info
|
172
|
-
- bin/nicodl
|
173
171
|
- bin/rget
|
174
172
|
- bin/ulizadl
|
175
173
|
- lib/asobistore.rb
|
data/bin/nicodl
DELETED
@@ -1,95 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'pit'
|
4
|
-
require 'niconico'
|
5
|
-
require 'pathname'
|
6
|
-
require 'open3'
|
7
|
-
|
8
|
-
def alt_title(video_id)
|
9
|
-
xml = open("http://ext.nicovideo.jp/api/getthumbinfo/#{video_id}").read
|
10
|
-
xml.scan(%r|<title>(.*)</title>|m).flatten.first || video_id
|
11
|
-
end
|
12
|
-
|
13
|
-
if ARGV.size == 0
|
14
|
-
$stderr.puts "usage: nicodl <URL> [URL...]"
|
15
|
-
exit -1
|
16
|
-
end
|
17
|
-
|
18
|
-
account = Pit::get('nicovideo', :require => {
|
19
|
-
:id => 'your nicovideo id',
|
20
|
-
:pass => 'your nicovideo password'
|
21
|
-
})
|
22
|
-
nico = Niconico.new(account[:id], account[:pass])
|
23
|
-
retry_count = 0
|
24
|
-
begin
|
25
|
-
nico.login
|
26
|
-
rescue Mechanize::ResponseReadError
|
27
|
-
retry_count += 1
|
28
|
-
if retry_count < 10
|
29
|
-
puts "login faiure. retring(#{retry_count})"
|
30
|
-
sleep 5
|
31
|
-
retry
|
32
|
-
end
|
33
|
-
$stderr.puts 'login faiure.'
|
34
|
-
exit -2
|
35
|
-
end
|
36
|
-
|
37
|
-
ARGV.each do |player_url|
|
38
|
-
video_id = Pathname(URI(player_url).path).basename.to_s
|
39
|
-
begin
|
40
|
-
# downloading video
|
41
|
-
video = nico.video(video_id)
|
42
|
-
file = "#{video.title || alt_title(video_id)}.#{video.type}".gsub(%r([\\/\?:*"'><|]), '_')
|
43
|
-
open(file, 'wb:ASCII-8BIT') do |o|
|
44
|
-
video.get_video{|body|o.write(body)}
|
45
|
-
end
|
46
|
-
rescue Mechanize::ResponseCodeError, Errno::EISDIR
|
47
|
-
# live streaming time-shift
|
48
|
-
live = nico.live(video_id)
|
49
|
-
begin
|
50
|
-
live.rtmpdump_commands(video_id).each_with_index do |cmd, i|
|
51
|
-
src = "#{video_id}-#{i+1}.flv"
|
52
|
-
dst = "#{live.title.gsub(%r([\\/\?:*"'><|]), '_')}-#{i+1}.mp4"
|
53
|
-
unless File.exist?(src)
|
54
|
-
cmd[cmd.index('-o') + 1] = "./#{src}"
|
55
|
-
begin
|
56
|
-
o, e, s = Open3.capture3(*cmd)
|
57
|
-
unless s.exitstatus == 0
|
58
|
-
$stderr.puts e
|
59
|
-
next
|
60
|
-
end
|
61
|
-
rescue Errno::ENOENT # rtmdump command not found
|
62
|
-
$stderr.puts $!
|
63
|
-
exit 1
|
64
|
-
end
|
65
|
-
else
|
66
|
-
$stderr.puts "#{src} is existent. skipping."
|
67
|
-
end
|
68
|
-
|
69
|
-
cmd = 'ffmpeg'
|
70
|
-
args = ['-i', src, '-acodec', 'copy', '-vcodec', 'copy', dst]
|
71
|
-
begin
|
72
|
-
o, e, s = Open3.capture3(cmd, *args)
|
73
|
-
unless s.exitstatus == 0
|
74
|
-
$stderr.puts e
|
75
|
-
next
|
76
|
-
end
|
77
|
-
File.delete(src)
|
78
|
-
rescue Errno::ENOENT
|
79
|
-
if cmd == 'avconv'
|
80
|
-
$stderr.puts "ffmpeg or avconv not found."
|
81
|
-
else # retry with avconv command instead of ffmpeg
|
82
|
-
cmd = 'avconv'
|
83
|
-
retry
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
rescue Niconico::Live::TicketRetrievingFailed
|
88
|
-
$stderr.puts $!
|
89
|
-
exit 2
|
90
|
-
rescue Niconico::Live::ReservationNotAccepted
|
91
|
-
$stderr.puts "press 'タイムシフト視聴する' button before getting videos."
|
92
|
-
exit 3
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|