rget 4.7.7 → 4.7.8

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/asobistore.rb +14 -4
  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: 67ae7e0feff45509f86be682672f93b2bc85458e686cf3f77b188549daf7447f
4
- data.tar.gz: 5b63864b67d2c93337f4b48d5a253295b1d72ea3863c03216ee315d9e66916e6
3
+ metadata.gz: e2d7fffaf7e839477db640331a09ef47148ba36c879b683601b1ca1f1ee22eed
4
+ data.tar.gz: b4e028ab5c2e8f75d36d44b32311843ae8ce7678540c88cebafeae265762b6f1
5
5
  SHA512:
6
- metadata.gz: 1e3009d6cbe8c14cc0d6cd42fdfa62077b4be96ee17825df1a8e65f0a4d3cc08610151ec6b37a0b25bbd0c4b88b4fc9c79b7ffdfb70c5da0be7c3861b3d16fd1
7
- data.tar.gz: 558ecd9a332a374f03f3092dea3499ef69516da359662b1c1f912af7f3fffd1122772f965000c9af962a1dd244c87d90d2606c8a931935932001c2ff5d4fe72c
6
+ metadata.gz: 5d1df8ca5f5094f915750b158ecff4f8c173d301e7e047d35db0312fd0b4faf1f5f86e7e176afaa338a550237f7dea35966bd84bfaca885a1459142ba54f3969
7
+ data.tar.gz: da0f7313d1928feaf86b459550c9bf80f5af9fe9d28815466cb7137c0e38653d682ec0e381db0ccd213fe5d41b7a9e6665b8255138bb5d94503a52f8e9150297
data/lib/asobistore.rb CHANGED
@@ -9,10 +9,7 @@ class AsobiStore < WebRadio
9
9
  end
10
10
 
11
11
  def download
12
- list = Nokogiri(open(@url).read)
13
- program = list.css('.list-main-product a.wrap').first.attr('href')
14
- content = Nokogiri(open("https://asobistore.jp#{program}").read)
15
- player = content.css('iframe').last.attr('src')
12
+ player = find_player(@url)
16
13
  html = Nokogiri(open("https:#{player}").read)
17
14
  src_m3u8 = html.css('source').first.attr('src')
18
15
  m3u8 = "#{File.dirname(src_m3u8)}/#{open(src_m3u8).read.match(/^[^#].*/)[0]}"
@@ -52,4 +49,17 @@ class AsobiStore < WebRadio
52
49
  end
53
50
  end
54
51
  end
52
+
53
+ private
54
+ def find_player(url)
55
+ programs = Nokogiri(open(url).read)
56
+ programs.css('.list-main-product a.wrap').each do |program|
57
+ begin
58
+ return Nokogiri(open("https://asobistore.jp#{program.attr('href')}").read).css('iframe').last.attr('src')
59
+ rescue # access denied because only access by premium members
60
+ next
61
+ end
62
+ end
63
+ raise StandardError.new('movie not found.')
64
+ end
55
65
  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 = "4.7.7"
7
+ spec.version = "4.7.8"
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, freshlive, himalaya and asobi store.}
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.7.7
4
+ version: 4.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - TADA Tadashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-01 00:00:00.000000000 Z
11
+ date: 2019-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
203
  - !ruby/object:Gem::Version
204
204
  version: '0'
205
205
  requirements: []
206
- rubygems_version: 3.0.1
206
+ rubygems_version: 3.0.3
207
207
  signing_key:
208
208
  specification_version: 4
209
209
  summary: Downloading newest radio programs on the web.