rget 3.2.2 → 3.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/nicodl +6 -1
- data/lib/nicovideo.rb +6 -5
- data/rget.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1629be674db949cb4fc135e09f2fb0333b93afd
|
4
|
+
data.tar.gz: 2d31880ccb2cd7e51f54698ff352331a51907fc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6927b79d9651ef8d5d18f0e03bb7c15b55779bc9942172b2ea30a0aeab738d26ec9337f7c668b4e4cebb6f1275d0f97c1094262749ec2e18d93850fb78fb4230
|
7
|
+
data.tar.gz: 9f10d8a3da090ece4ae60d16e85083c1c421da16c003c4373d17631e1441a8a1e02e6467f18f1e404f5ec052c18e6a05c07184b66d65cbd9759743acde70c5a1
|
data/bin/nicodl
CHANGED
@@ -5,6 +5,11 @@ require 'niconico'
|
|
5
5
|
require 'pathname'
|
6
6
|
require 'open3'
|
7
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
|
+
|
8
13
|
if ARGV.size == 0
|
9
14
|
$stderr.puts "usage: nicodl <URL> [URL...]"
|
10
15
|
exit -1
|
@@ -34,7 +39,7 @@ ARGV.each do |player_url|
|
|
34
39
|
begin
|
35
40
|
# downloading video
|
36
41
|
video = nico.video(video_id)
|
37
|
-
file = "#{video.title ||
|
42
|
+
file = "#{video.title || alt_title(video_id)}.#{video.type}".gsub(%r([\\/\?:*"'><|]), '_')
|
38
43
|
open(file, 'wb:ASCII-8BIT') do |o|
|
39
44
|
video.get_video{|body|o.write(body)}
|
40
45
|
end
|
data/lib/nicovideo.rb
CHANGED
@@ -23,8 +23,9 @@ class Nicovideo < WebRadio
|
|
23
23
|
raise DownloadError.new('video not found')
|
24
24
|
end
|
25
25
|
|
26
|
-
|
27
|
-
|
26
|
+
video_id = Pathname(URI(player_url).path).basename.to_s
|
27
|
+
video = @nico.video(video_id)
|
28
|
+
title = video.title || alt_title(video_id)
|
28
29
|
title.tr!('0-9', '0-9')
|
29
30
|
serial = title.scan(/(?:[#第]|[ ]EP|track-)(\d+)|/).flatten.compact[0].to_i
|
30
31
|
appendix = title =~ /おまけ|アフタートーク/ ? 'a' : ''
|
@@ -75,8 +76,8 @@ private
|
|
75
76
|
end
|
76
77
|
end
|
77
78
|
|
78
|
-
def alt_title(
|
79
|
-
|
80
|
-
|
79
|
+
def alt_title(video_id)
|
80
|
+
xml = open("http://ext.nicovideo.jp/api/getthumbinfo/#{video_id}").read
|
81
|
+
xml.scan(%r|<title>(.*)</title>|m).flatten.first || video_id
|
81
82
|
end
|
82
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 = "3.2.
|
7
|
+
spec.version = "3.2.3"
|
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.
|
4
|
+
version: 3.2.3
|
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-07-
|
11
|
+
date: 2017-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|