rget 3.2.0 → 3.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3240c75e0ffe2d6e4d37b30c28514a266bf6f97d
4
- data.tar.gz: b85968891bcb72cc5ec692b4e9b0b8fc910cd918
3
+ metadata.gz: 1a73d406e2be1c8e44a0b98b42f5c0c706a0d994
4
+ data.tar.gz: 1e9bf221bfffbe09d3e3cdad5caa9a3693e58edf
5
5
  SHA512:
6
- metadata.gz: 1eabc5b2f5763a9b063a726fe19d9e41cffed3ee862a246ecd7cc26862e0e4e851ead8c473f461da823dc93402edf5e686d961f63976ef6a27089020850ec5af
7
- data.tar.gz: 6c747681bde7723bc2538282f56bb2f57e14ec681e5df0fe788492249b7cddb2dc8b63a4133b3ed5d5a571f1eb1ef021684d71b67d00f2cfbbc673572a425054
6
+ metadata.gz: cd9a6357437bc1e9d091dcd15a620db0c5e4d6fd37e0d2970aa7b5a75a3fbc0b57721e0c31d1aae46e3ec1ac688ab7d116458bc2221cfc1e6a57b027e3b2d625
7
+ data.tar.gz: 1e4696067f98d441d51b68c5e247667d157e046eb40bd840bd664aefcb9d47bb85184a605329f5caefc1179cf8b6a05b1c91b16d6e636b842a62bade34149c84
data/README.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # rget
2
2
 
3
- Downloading newest radio programs on the web. Supported radio stations are hibiki, animate, onsen, seaside communications and niconico.
3
+ Downloading newest radio programs on the web. Supported radio stations are:
4
+
5
+ * hibiki
6
+ * animate
7
+ * onsen
8
+ * seaside communications
9
+ * niconico
10
+ * freshlive.tv
4
11
 
5
12
  If you want to save files as MP3, needs `ffmpeg` command.
6
13
 
data/bin/nicodl CHANGED
@@ -34,7 +34,7 @@ ARGV.each do |player_url|
34
34
  begin
35
35
  # downloading video
36
36
  video = nico.video(video_id)
37
- file = "#{video.title}.#{video.type}".gsub(%r([\\/\?:*"'><|]), '_')
37
+ file = "#{video.title || 'unknown'}.#{video.type}".gsub(%r([\\/\?:*"'><|]), '_')
38
38
  open(file, 'wb:ASCII-8BIT') do |o|
39
39
  video.get_video{|body|o.write(body)}
40
40
  end
data/lib/nicovideo.rb CHANGED
@@ -24,9 +24,10 @@ class Nicovideo < WebRadio
24
24
  end
25
25
 
26
26
  video = @nico.video(Pathname(URI(player_url).path).basename.to_s)
27
- video.title.tr!('0-9', '0-9')
28
- serial = video.title.scan(/(?:[#第]|[  ]EP|track-)(\d+)|/).flatten.compact[0].to_i
29
- appendix = video.title =~ /おまけ|アフタートーク/ ? 'a' : ''
27
+ title = video.title || alt_title(player_url)
28
+ title.tr!('0-9', '0-9')
29
+ serial = title.scan(/(?:[#第]|[  ]EP|track-)(\d+)|/).flatten.compact[0].to_i
30
+ appendix = title =~ /おまけ|アフタートーク/ ? 'a' : ''
30
31
  @file = "#{name}##{'%02d' % serial}#{appendix}.#{video.type}"
31
32
  @mp3_file = @file.sub(/\....$/, '.mp3')
32
33
  mp3nize(@file, @mp3_file) do
@@ -73,4 +74,9 @@ private
73
74
  return "http://www.nicovideo.jp#{url}"
74
75
  end
75
76
  end
77
+
78
+ def alt_title(player_url)
79
+ html = open(player_url).read
80
+ html.scan(%r|<title>(.*)</title>|m).flatten.first || ''
81
+ end
76
82
  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 = "3.2.0"
7
+ spec.version = "3.2.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, animate, onsen, seaside communications and niconico.}
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: 3.2.0
4
+ version: 3.2.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: 2017-05-12 00:00:00.000000000 Z
11
+ date: 2017-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor