rget 4.13.2 → 4.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/onsen.rb +14 -2
  3. data/rget.gemspec +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bef9d92d8791dfd9e2e4cf6852a30d07bf4bcd8a46a492a443d1d7223ac7877d
4
- data.tar.gz: d03997be575932a0cc303ba44848c5178bd3802efcccfa223507eb0e3b417165
3
+ metadata.gz: 6dbba35e1e280d414d0fc23a842664ae5a53608ec664efa5cddfba3b30fb953f
4
+ data.tar.gz: 9f100b85aa2a709ba941d1d19fe26ec559c1ba2aead4142282dfef2dafcba08b
5
5
  SHA512:
6
- metadata.gz: 208553638033e5d34e9367c7a44da64620bd8f3306b91e70d831a087607a22d5e3467a6ae769678e59ca687b7fb55539ff6b24720e0c2944976b86a2110c09b1
7
- data.tar.gz: d7e6f651fb7c91df44f5fe0947f627bbcef767019719e4405c288bcad668eb3262178526100cb11b49a303720fb0873456c2964cb7cdd2a879ff2be1e6ba6d0c
6
+ metadata.gz: 69781f08c15fa0557f37c72d0a7261c89eb9f3a2e3ccc8f2bb1bbc911add7aa47831ead77d871a238080738c042c61fb2ba3b8c572ae5bca327c84cd8ae3c5bc
7
+ data.tar.gz: ffbedb19ac36aff619b76c9755b77f97495d421ac81422a8332f45061d5c72255ef4266a9a8afb42ef59322515d272e8531d7cd1858eb78d92b565818fc4eea8
data/lib/onsen.rb CHANGED
@@ -12,12 +12,24 @@ class Onsen < HLS
12
12
  def initialize(params, options)
13
13
  super
14
14
  @cover = "//*[@class='newest-content--left']//img[1]/@src" unless @cover
15
+ @offset = 0
15
16
  end
16
17
 
17
18
  def download
19
+ program = File.basename(URI(@url).path)
18
20
  html = URI.open(@url, HEADERS, &:read)
19
- serial = Nokogiri(html).css('.play-video-info td')[0].text.scan(/\d+/)[0].to_i
20
- m3u8 = JSON.parse(html.scan(%r|streaming_url:("https:.*?.m3u8")|).flatten.sort.last)
21
+ serial = 0
22
+ Nokogiri(html).css('.play-video-info tr').each do |tr|
23
+ begin
24
+ serial = tr.css('td')[0].text.scan(/\d+/)[0].to_i
25
+ rescue NoMethodError
26
+ next # the header of tables
27
+ end
28
+ break unless serial == 0
29
+ end
30
+ m3u8 = html.gsub(%r[\\u002F], '/').scan(%r|"(https:[^:]*?.m3u8)"|).flatten.select{|m|
31
+ m.match(%r|/\d+/#{program}.*?-#{serial}\.mp4|)
32
+ }.first
21
33
  hls_download(@label, serial, m3u8, HEADERS)
22
34
  end
23
35
 
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 = "4.13.2"
7
+ spec.version = "4.14.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, onsen, niconico, himalaya, asobi store, stand.fm and youtube.}
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.13.2
4
+ version: 4.14.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: 2022-02-15 00:00:00.000000000 Z
11
+ date: 2022-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  - !ruby/object:Gem::Version
219
219
  version: '0'
220
220
  requirements: []
221
- rubygems_version: 3.3.4
221
+ rubygems_version: 3.3.7
222
222
  signing_key:
223
223
  specification_version: 4
224
224
  summary: Downloading newest radio programs on the web.