rget 2.0.0 → 2.1.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/lib/webradio.rb +4 -0
- data/lib/youtube.rb +27 -0
- data/rget.gemspec +3 -2
- data/rget.yaml +4 -0
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bbcdd295bd2264f6956c5ec29bc69936b3e1219
|
4
|
+
data.tar.gz: 723353449908d108711640f531098eeb6777ea6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 529dea3909e06650a821dca237d6591e7849f5542c741e268952f50c463cdcf3e1e1423bfda6218708975691bae415537bd7d99816d8a5a44d7eedd76cbe1b97
|
7
|
+
data.tar.gz: 79ffe2a9dbc7c295cf269a7e67f7c5dd720e419b3eee152912304d5054333e639956bc105bb5f6a74e0164b5c62dbdb786d507790c0ed32a131b0d416693f81b
|
data/lib/webradio.rb
CHANGED
@@ -23,6 +23,9 @@ class WebRadio
|
|
23
23
|
when %r[nicovideo\.jp]
|
24
24
|
require 'nicovideo'
|
25
25
|
Nicovideo.new(url, options)
|
26
|
+
when %r[www\.youtube\.com]
|
27
|
+
require 'youtube'
|
28
|
+
YouTube.new(url, options)
|
26
29
|
else
|
27
30
|
raise 'unsupported url.'
|
28
31
|
end
|
@@ -64,6 +67,7 @@ private
|
|
64
67
|
result = Open3.capture3("ffmpeg -i #{src} -ab 64k #{dst}")
|
65
68
|
if result[2].to_i == 0
|
66
69
|
File.delete(src) if delete_src
|
70
|
+
puts "done."
|
67
71
|
else
|
68
72
|
puts "failed."
|
69
73
|
$stderr.puts MediaConvertError.new(result[1])
|
data/lib/youtube.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'webradio'
|
2
|
+
require 'open-uri'
|
3
|
+
require 'nokogiri'
|
4
|
+
|
5
|
+
class YouTube < WebRadio
|
6
|
+
def download(name)
|
7
|
+
list = {}
|
8
|
+
playlist = Nokogiri(open(@url, &:read))
|
9
|
+
playlist.css('#pl-video-list tr').each do |tr|
|
10
|
+
title = tr.attr('data-title')
|
11
|
+
serial = title.scan(/(?:[#第]| EP)(\d+)|/).flatten.compact[0].to_i
|
12
|
+
video_url = tr.css('a').attr('href').to_s
|
13
|
+
list[serial] = video_url
|
14
|
+
end
|
15
|
+
serial = list.keys.sort.last
|
16
|
+
@src = "#{name}##{'%02d' % serial}.mp4"
|
17
|
+
@dst = "#{name}##{'%02d' % serial}.mp3"
|
18
|
+
mp3ize(@src, @dst) do
|
19
|
+
player_url = "http://www.youtube.com#{list[serial]}"
|
20
|
+
result = Open3.capture3("viddl-rb -u -q '*:*:mp4' '#{player_url}'")
|
21
|
+
video_url = result[0].split.last.chomp
|
22
|
+
open(@src, 'wb:ASCII-8BIT') do |o|
|
23
|
+
o.write open(video_url, 'r:ASCII-8BIT', &:read)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/rget.gemspec
CHANGED
@@ -4,10 +4,10 @@ $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.1.0"
|
8
8
|
spec.authors = ["TADA Tadashi"]
|
9
9
|
spec.email = ["t@tdtds.jp"]
|
10
|
-
spec.description = %q{Downloading newest radio programs on the web. Supported radio stations are hibiki, animate, onsen, seaside communications and
|
10
|
+
spec.description = %q{Downloading newest radio programs on the web. Supported radio stations are hibiki, animate, onsen, seaside communications, niconico and youtube.}
|
11
11
|
spec.summary = %q{Downloading newest radio programs on the web.}
|
12
12
|
spec.homepage = "https://bitbucket.org/tdtds/rget"
|
13
13
|
spec.license = "GPL"
|
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.add_runtime_dependency "thor"
|
21
21
|
spec.add_runtime_dependency "nokogiri"
|
22
22
|
spec.add_runtime_dependency "niconico", ">= 1.7.0"
|
23
|
+
spec.add_runtime_dependency "viddl-rb"
|
23
24
|
spec.add_runtime_dependency "pit"
|
24
25
|
|
25
26
|
spec.add_development_dependency "bundler", "~> 1.3"
|
data/rget.yaml
CHANGED
@@ -60,3 +60,7 @@ programs:
|
|
60
60
|
desc: 一番くじ&クレーンキングスペシャル〜響チャレンジ!
|
61
61
|
url: http://ch.nicovideo.jp/search/IDOLM@STER?channel_id=ch346&mode=s&sort=f&order=d&type=video
|
62
62
|
label: 響チャレンジ
|
63
|
+
greenight:
|
64
|
+
desc: 花澤香菜と雨宮天のRADIO GREE NIGHT
|
65
|
+
url: https://www.youtube.com/playlist?list=PLpAhJfIVc-EcAQXGGRlOir7ctL-wNCnoq
|
66
|
+
label: GREENIGHT
|
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.1.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: 2015-02-
|
11
|
+
date: 2015-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 1.7.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: viddl-rb
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: pit
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,7 +123,7 @@ dependencies:
|
|
109
123
|
- !ruby/object:Gem::Version
|
110
124
|
version: '0'
|
111
125
|
description: Downloading newest radio programs on the web. Supported radio stations
|
112
|
-
are hibiki, animate, onsen, seaside communications and
|
126
|
+
are hibiki, animate, onsen, seaside communications, niconico and youtube.
|
113
127
|
email:
|
114
128
|
- t@tdtds.jp
|
115
129
|
executables:
|
@@ -131,6 +145,7 @@ files:
|
|
131
145
|
- lib/seaside-c.rb
|
132
146
|
- lib/uliza.rb
|
133
147
|
- lib/webradio.rb
|
148
|
+
- lib/youtube.rb
|
134
149
|
- rget.gemspec
|
135
150
|
- rget.yaml
|
136
151
|
homepage: https://bitbucket.org/tdtds/rget
|