rget 4.5.0 → 4.6.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: 18e07797f4bbf813a7a6c72ecd222821e0c08aac2c3ba94cef08c2524e08ac8b
4
- data.tar.gz: a9a221ef18663ca77253ddea413612e28c320de291138530e4c7869871c04284
3
+ metadata.gz: cbb60902a3e7e94cdde04a6e9fcaba67520f77691ed758954f1fc6a85ff36573
4
+ data.tar.gz: 5bec01d8399e3a213dad6f6809af72a69b2bc480be0fd8be4683a6098ca5db05
5
5
  SHA512:
6
- metadata.gz: 89bfda21a389f9b18032fafa58f7bc9142e2be8b804745b076a8f54cf919b7fa29bd61da8b7cc6c9126d8bcc486181696da065c177f801fd9834edcf8437cef9
7
- data.tar.gz: 7c5c3a364f2d094afce9d5c6c1fc58121714c1d55b4f1a69a8a82cb51ee72d164c96b09d0a7f2d25c7442b4cb1059d066953cb83328311163195068a9f0f53b8
6
+ metadata.gz: 49af824ae83d968115f0ae2b7b52a41f0b37fad355516a248ca4c4d61aa378bbfabef7e4848ef585d00e7172d1f3c9b0e3d63e840990e2db80fb9a8afdc3455b
7
+ data.tar.gz: c14371d3ee3fa7167279aca481a4534f17db04fdb75b056aafad9e4e2fdfa8ca519e33fb840ee856e06a17945b7b6e82ab56dcda94d354d7e18673b6dceb280f
data/README.md CHANGED
@@ -6,6 +6,7 @@ Downloading newest radio programs on the web. Supported radio stations are:
6
6
  * onsen
7
7
  * niconico
8
8
  * freshlive.tv
9
+ * himalaya.fm
9
10
 
10
11
  If you want to save files as MP3, needs `ffmpeg` command.
11
12
 
data/lib/himalaya.rb ADDED
@@ -0,0 +1,29 @@
1
+ require 'open-uri'
2
+ require 'json'
3
+
4
+ class Himalaya < WebRadio
5
+ def initialize(params, options)
6
+ super
7
+ @offset = 0
8
+ end
9
+
10
+ def download
11
+ html = open(@url).read
12
+ json_str = html.scan(/__NEXT_DATA__ = (.*)/).flatten.first
13
+ json = JSON.parse(json_str)
14
+ tracks = json['props']['seo']['albumData']['data']['tracks']['list']
15
+ track = tracks[@offset]
16
+
17
+ m4a_url = track['playPathAacv164']
18
+ serial = Time.at(track['createdAt']/1000).strftime('%Y%m%d')
19
+ @cover ||= track['coverLarge']
20
+
21
+ m4a_file = "#{@label}##{serial}.m4a"
22
+ mp3_file = "#{@label}##{serial}.mp3"
23
+ mp3nize(m4a_file, mp3_file) do
24
+ open(m4a_file, 'wb:ASCII-8BIT') do |m4a|
25
+ m4a.write(open(m4a_url).read)
26
+ end
27
+ end
28
+ end
29
+ end
data/lib/webradio.rb CHANGED
@@ -22,6 +22,9 @@ class WebRadio
22
22
  when %r[^https://freshlive\.tv/]
23
23
  require 'freshlive'
24
24
  FreshLive.new(params, options)
25
+ when %r[^http://m\.himalaya\.fm/]
26
+ require 'himalaya'
27
+ Himalaya.new(params, options)
25
28
  else
26
29
  raise "unsupported url: #{params['url']}"
27
30
  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 = "4.5.0"
7
+ spec.version = "4.6.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, onsen, niconico and freshlive.}
10
+ spec.description = %q{Downloading newest radio programs on the web. Supported radio stations are hibiki, onsen, niconico, freshlive and himalaya.}
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"
data/rget.yaml CHANGED
@@ -48,3 +48,7 @@ programs:
48
48
  url: http://feeds.rebuild.fm/rebuildfm
49
49
  label: rebuildfm
50
50
  podcast: true
51
+ taneharu:
52
+ desc: ラジオ「たねさんはるさんとはなそ。(意志)」
53
+ url: http://m.himalaya.fm/jp/podcast/190452
54
+ 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.5.0
4
+ version: 4.6.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: 2018-03-27 00:00:00.000000000 Z
11
+ date: 2018-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -137,7 +137,7 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  description: Downloading newest radio programs on the web. Supported radio stations
140
- are hibiki, onsen, niconico and freshlive.
140
+ are hibiki, onsen, niconico, freshlive and himalaya.
141
141
  email:
142
142
  - t@tdtds.jp
143
143
  executables:
@@ -160,6 +160,7 @@ files:
160
160
  - lib/dropbox.rb
161
161
  - lib/freshlive.rb
162
162
  - lib/hibiki.rb
163
+ - lib/himalaya.rb
163
164
  - lib/nicovideo.rb
164
165
  - lib/onsen.rb
165
166
  - lib/podcast.rb