rget 4.5.0 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/himalaya.rb +29 -0
- data/lib/webradio.rb +3 -0
- data/rget.gemspec +2 -2
- data/rget.yaml +4 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbb60902a3e7e94cdde04a6e9fcaba67520f77691ed758954f1fc6a85ff36573
|
4
|
+
data.tar.gz: 5bec01d8399e3a213dad6f6809af72a69b2bc480be0fd8be4683a6098ca5db05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49af824ae83d968115f0ae2b7b52a41f0b37fad355516a248ca4c4d61aa378bbfabef7e4848ef585d00e7172d1f3c9b0e3d63e840990e2db80fb9a8afdc3455b
|
7
|
+
data.tar.gz: c14371d3ee3fa7167279aca481a4534f17db04fdb75b056aafad9e4e2fdfa8ca519e33fb840ee856e06a17945b7b6e82ab56dcda94d354d7e18673b6dceb280f
|
data/README.md
CHANGED
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.
|
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
|
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
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.
|
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-
|
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
|
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
|