rget 4.9.3 → 4.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 222b83cd5f8c3cff4f1b3372ec7488cc2bc4643c66469be1259d123c54e53643
4
- data.tar.gz: d2eda18075858e1e78fe0a862140161edfab2ad886075ba80e8b1a450f0ec617
3
+ metadata.gz: 002a0d55ff230dabdb3c046e67cf09a56f28aae9bbbb44c3bd7de3a4490cc770
4
+ data.tar.gz: 33f86195c750fb5cad0f133fe199fc8a94fe65f6a5bae2b0eb372eb7a34aed6f
5
5
  SHA512:
6
- metadata.gz: 54d7bcead0ea3ddbb7a88afad7e7b95bde817c7272d0c2c4c567925bc41cc5ce35dff780624be93b92a49ec0e74ce9ac6cacf22f4c61c109543d73dc6d320728
7
- data.tar.gz: f722aabcdaa8767d0fecaebedc400c26312ad44c5b8894f1cd3567c0eabbadee13aaeefbcc8a7211779b8427a386725e1a1406b788ae2c791183b2b07727e15a
6
+ metadata.gz: f144e5b3623c29342f278b22de551b3e535f8ce1a699d6454116718a4653bc4425b49ce3f4e8062cc98ca08e4940e6ce77462456161a99144008e9c5a36a7972
7
+ data.tar.gz: cf9a018da02a9651e554cff2237bebbe744aff02073799b10f02806fd55079e051fc123f2c79802694efc030682126b52eb2f128041d553468a8cdc6564a0e0b
@@ -5,7 +5,7 @@ before_install:
5
5
  - gem install bundler -v '> 1.5.0'
6
6
 
7
7
  rvm:
8
- - 2.5.0
8
+ - 2.7.2
9
9
 
10
10
  deploy:
11
11
  provider: rubygems
data/README.md CHANGED
@@ -5,9 +5,9 @@ Downloading newest radio programs on the web. Supported radio stations are:
5
5
  * hibiki
6
6
  * onsen
7
7
  * niconico
8
- * freshlive.tv
9
8
  * himalaya.fm
10
9
  * Asobi Store
10
+ * stand.fm
11
11
 
12
12
  If you want to save files as MP3, needs `ffmpeg` command.
13
13
  To download niconico video, also needs latest `youtube-dl` command (you can get it from `https://yt-dl.org/`), then specify niconico user ID and password to `~/.netrc` as:
@@ -0,0 +1,62 @@
1
+ require 'open-uri'
2
+ require 'nokogiri'
3
+ require 'mechanize'
4
+ require 'json'
5
+
6
+ class StandFm < WebRadio
7
+ def initialize(params, options)
8
+ super
9
+ @offset = 0
10
+ end
11
+
12
+ def download
13
+ uri = URI(@url)
14
+ html = Nokogiri(uri.open.read)
15
+ episode = uri + html.css('#root a[href^="/episodes/"]').map{|e|e.attr('href')}.uniq[@offset]
16
+
17
+ html = episode.open.read
18
+ json = JSON.parse(html.scan(%r[<script>window.__SERVER_STATE__=(.*)</script>]).flatten[0])
19
+ m4a = json['topics'].find{|k,v|v['episodeId'] == File.basename(episode.path)}.last['downloadUrl']
20
+
21
+ doc = Nokogiri(html)
22
+ serial = doc.title.scan(/#(\d+)/).flatten.first.to_i
23
+ @cover = doc.css('meta[property="og:image"]').attr('content').text unless @cover
24
+ m4a_file = "#{@label}##{serial}.m4a"
25
+ mp3_file = "#{@label}##{serial}.mp3"
26
+
27
+ mp3nize(m4a_file, mp3_file) do
28
+ open(m4a_file, 'wb:ASCII-8BIT') do |w|
29
+ w.write(URI(m4a).open.read)
30
+ end
31
+ end
32
+ end
33
+
34
+ def dump
35
+ uri = URI(@url)
36
+ tag = File.basename(uri.path)
37
+ html = Nokogiri(uri.open.read)
38
+ label, = html.css('title').text.split(/ \| /)
39
+ cover = html.css('meta[property="og:image"]').attr('content').text
40
+ return {
41
+ tag => {
42
+ 'desc' => label,
43
+ 'url' => @url,
44
+ 'label' => label,
45
+ 'cover' => cover
46
+ }
47
+ }
48
+ end
49
+
50
+ private
51
+ def find_player(url)
52
+ programs = Nokogiri(URI.open(url).read)
53
+ programs.css('.list-main-product a.wrap').each do |program|
54
+ begin
55
+ return Nokogiri(URI.open("https://asobistore.jp#{program.attr('href')}").read).css('iframe').last.attr('src')
56
+ rescue # access denied because only access by premium members
57
+ next
58
+ end
59
+ end
60
+ raise StandardError.new('movie not found.')
61
+ end
62
+ end
@@ -29,6 +29,9 @@ class WebRadio
29
29
  when %r[^https://asobistore\.jp/]
30
30
  require 'asobistore'
31
31
  AsobiStore.new(params, options)
32
+ when %r[^https://stand\.fm/channels/]
33
+ require 'standfm'
34
+ StandFm.new(params, options)
32
35
  else
33
36
  raise UnsupportError, "unsupported url: #{params['url']}"
34
37
  end
@@ -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 = "4.9.3"
8
- spec.authors = ["TADA Tadashi"]
7
+ spec.version = "4.10.0"
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, onsen, niconico, freshlive, himalaya and asobi store.}
10
+ spec.description = %q{Downloading newest radio programs on the web. Supported radio stations are hibiki, onsen, niconico, himalaya, asobi store and stand.fm.}
11
11
  spec.summary = %q{Downloading newest radio programs on the web.}
12
12
  spec.homepage = "https://github.com/wasamas/rget"
13
13
  spec.license = "GPL"
data/rget.yaml CHANGED
@@ -23,3 +23,7 @@ programs:
23
23
  desc: ル美子さん
24
24
  url: https://ch.nicovideo.jp/luminesan/video?rss=2.0
25
25
  label: ル美子さん
26
+ ranacha:
27
+ desc: らなちゃのひとりごと
28
+ url: https://stand.fm/channels/5f7d9011f04555115d2170ef
29
+ label: らなちゃのひとりごと
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.9.3
4
+ version: 4.10.0
5
5
  platform: ruby
6
6
  authors:
7
- - TADA Tadashi
7
+ - Tada, Tadashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-29 00:00:00.000000000 Z
11
+ date: 2020-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -151,7 +151,7 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  description: Downloading newest radio programs on the web. Supported radio stations
154
- are hibiki, onsen, niconico, freshlive, himalaya and asobi store.
154
+ are hibiki, onsen, niconico, himalaya, asobi store and stand.fm.
155
155
  email:
156
156
  - t@tdtds.jp
157
157
  executables:
@@ -181,6 +181,7 @@ files:
181
181
  - lib/nicovideo.rb
182
182
  - lib/onsen.rb
183
183
  - lib/podcast.rb
184
+ - lib/standfm.rb
184
185
  - lib/webradio.rb
185
186
  - rget.gemspec
186
187
  - rget.yaml