rget 3.1.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/freshlive.rb +48 -0
- data/lib/webradio.rb +3 -0
- data/rget.gemspec +1 -1
- data/rget.yaml +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3240c75e0ffe2d6e4d37b30c28514a266bf6f97d
|
4
|
+
data.tar.gz: b85968891bcb72cc5ec692b4e9b0b8fc910cd918
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1eabc5b2f5763a9b063a726fe19d9e41cffed3ee862a246ecd7cc26862e0e4e851ead8c473f461da823dc93402edf5e686d961f63976ef6a27089020850ec5af
|
7
|
+
data.tar.gz: 6c747681bde7723bc2538282f56bb2f57e14ec681e5df0fe788492249b7cddb2dc8b63a4133b3ed5d5a571f1eb1ef021684d71b67d00f2cfbbc673572a425054
|
data/lib/freshlive.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'webradio'
|
2
|
+
require 'nokogiri'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
class FreshLive < WebRadio
|
6
|
+
def initialize(url, options)
|
7
|
+
super
|
8
|
+
@archive = URI(File.join(@url + '/archive'))
|
9
|
+
@doc = Nokogiri(open(@archive).read).root
|
10
|
+
end
|
11
|
+
|
12
|
+
def download(name)
|
13
|
+
meta = program_meta(program_id)
|
14
|
+
serial = meta['data']['title'].scan(/\d+$/).first.to_i
|
15
|
+
open("#{name}##{'%02d' % serial}.ts", 'wb') do |w|
|
16
|
+
ts_list(meta['data']['archiveStreamUrl']).each do |u|
|
17
|
+
w.write(open(u, 'rb').read)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def dump
|
23
|
+
tag = Pathname(@url).basename.to_s
|
24
|
+
meta = JSON.parse(@doc.css('script').first)
|
25
|
+
|
26
|
+
return {
|
27
|
+
tag => {
|
28
|
+
'desc' => meta['name'],
|
29
|
+
'url' => @url,
|
30
|
+
'label' => tag
|
31
|
+
}
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
def program_id
|
37
|
+
Pathname(@doc.css('.ProgramTitle a').attr('href').value).basename.to_s
|
38
|
+
end
|
39
|
+
|
40
|
+
def program_meta(id)
|
41
|
+
JSON.parse(open("https://freshlive.tv/proxy/Programs;id=#{id}").read)
|
42
|
+
end
|
43
|
+
|
44
|
+
def ts_list(rate_m3u8)
|
45
|
+
ts_m3u8 = open(rate_m3u8).read.each_line.grep_v(/^#/)[1].chomp
|
46
|
+
open(URI(rate_m3u8) + ts_m3u8).read.each_line.grep_v(/^#/).map{|u|URI(rate_m3u8) + u.chomp}
|
47
|
+
end
|
48
|
+
end
|
data/lib/webradio.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 = "3.
|
7
|
+
spec.version = "3.2.0"
|
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.}
|
data/rget.yaml
CHANGED
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.
|
4
|
+
version: 3.2.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: 2017-05-
|
11
|
+
date: 2017-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- bin/rget
|
142
142
|
- lib/animate.rb
|
143
143
|
- lib/dropbox.rb
|
144
|
+
- lib/freshlive.rb
|
144
145
|
- lib/hibiki.rb
|
145
146
|
- lib/nicovideo.rb
|
146
147
|
- lib/onsen.rb
|