rget 4.8.0 → 4.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -12
  3. data/lib/nicovideo.rb +1 -1
  4. data/rget.gemspec +1 -1
  5. metadata +2 -4
  6. data/bin/nicodl +0 -95
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 834e0d540f9bd9fdd0bbe9934e42f90ea4f92d21b1f3af517c179f0e26cf003d
4
- data.tar.gz: 199d831fa1f8e869b0cb043423d0078afc6d8a5adbc249de5597583b70e2dfef
3
+ metadata.gz: '0306965ff2fde96075fa3ac6091c574933444350b9c65ab435377308a5c7653d'
4
+ data.tar.gz: 0542dcc90ce49a97575d236c21bd886a45ba21a6b1694ee9e0033f330ce6d28b
5
5
  SHA512:
6
- metadata.gz: 825634c0345fe163c8e4093440c43fd2edee84c520629a4cc674d1ef381acb49b3e7305e0f570ce9f3c6e51298213d42820d8cf7970226becf240c8174cfb19d
7
- data.tar.gz: 63bde6ba6ddd23390f871fb3ee544e693f95581d0b25ffab0b92f2374c6fe91df61577716c8723b95328313419038490f5a1612880cb21433d49bd54512471d6
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
- * RGET\_CONFIG environment variable
17
- * ./rget.yaml
18
- * ~/.rget
19
- * <command path>/../rget.yaml (for gem)
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 (saved movie file)
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
- ### nicodl command
44
- ```
45
- # download nicovideo live program
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
  ```
@@ -66,7 +66,7 @@ private
66
66
  offset = 0
67
67
  begin
68
68
  begin
69
- rss = RSS::Parser.parse(list_url)
69
+ rss = RSS::Parser.parse(open(list_url).read)
70
70
  item = rss.items[offset]
71
71
  video_url = item.link
72
72
  rescue RSS::NotWellFormedError
@@ -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.0"
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.0
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-07 00:00:00.000000000 Z
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