rget 2.2.4 → 2.3.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/bin/rget +10 -19
- data/lib/webradio.rb +9 -1
- data/rget.gemspec +1 -1
- data/rget.yaml +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 813d569b8900605477e89efad7ec9c9b40f8a6aa
|
4
|
+
data.tar.gz: ad5ec609930b4d4e682d004422a45e3d2c381f94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e3ed3332af62479a99377879f46875998113b5a638d33bb3e03f9940c07f0bc7c2de34736951f79eb95b6b1c54c702e712bcefa09f2dba83fcff20207555e76
|
7
|
+
data.tar.gz: 045a14ba979a6f425082da7c6dbd234fbe0de85ee61800f8941be096398a58b702904b5691885fe7e639ed7de9d706c1fcbe6f50b2299a92b52fa20b119ab2a4
|
data/bin/rget
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'thor'
|
4
4
|
require 'pathname'
|
5
5
|
require 'yaml'
|
6
|
+
require 'ostruct'
|
6
7
|
require 'webradio'
|
7
8
|
require 'podcast'
|
8
9
|
|
@@ -10,7 +11,7 @@ class GetWebRadio < Thor
|
|
10
11
|
class_option :mp3, type: :boolean, default:true, desc:'convert to mp3 with ffmpeg'
|
11
12
|
class_option :path, type: :string, desc:'store path (accept "dropbox://~")'
|
12
13
|
|
13
|
-
|
14
|
+
config_file = nil
|
14
15
|
[
|
15
16
|
'./rget.yaml',
|
16
17
|
'~/.rget',
|
@@ -18,38 +19,28 @@ class GetWebRadio < Thor
|
|
18
19
|
].each do |file|
|
19
20
|
path = Pathname(file).expand_path
|
20
21
|
if path.exist?
|
21
|
-
|
22
|
+
config_file = path.to_s
|
22
23
|
break
|
23
24
|
end
|
24
25
|
end
|
25
|
-
unless
|
26
|
+
unless config_file
|
26
27
|
$stderr.puts 'config file not found'
|
27
28
|
exit 1
|
28
29
|
end
|
29
30
|
|
30
|
-
YAML::load_file(
|
31
|
+
config = YAML::load_file(config_file)
|
32
|
+
config['programs'].each do |command, params|
|
31
33
|
desc command, params['desc']
|
32
34
|
define_method(command) do
|
35
|
+
url = params['url']
|
36
|
+
opts = OpenStruct.new(config['options'].merge(options))
|
33
37
|
if params['podcast']
|
34
|
-
|
38
|
+
Podcast.new(url, opts){|media|media.download(params['label'])}
|
35
39
|
else
|
36
|
-
|
40
|
+
WebRadio(url, opts){|media|media.download(params['label'])}
|
37
41
|
end
|
38
42
|
end
|
39
43
|
end
|
40
|
-
|
41
|
-
private
|
42
|
-
def process(uri, label)
|
43
|
-
WebRadio(uri, options) do |radio|
|
44
|
-
radio.download(label)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
def podcast(uri, label = nil)
|
49
|
-
Podcast.new(uri, options) do |pod|
|
50
|
-
pod.download(label)
|
51
|
-
end
|
52
|
-
end
|
53
44
|
end
|
54
45
|
|
55
46
|
GetWebRadio.start(ARGV)
|
data/lib/webradio.rb
CHANGED
@@ -80,7 +80,15 @@ private
|
|
80
80
|
|
81
81
|
# convert to mp3
|
82
82
|
print "converting to mp3..."
|
83
|
-
|
83
|
+
ffmpeg = (@options['mp3nize'] || "ffmpeg -i '$1' -ab 64k '$2'").gsub(/\$(.)/){|s|
|
84
|
+
case $1
|
85
|
+
when '1'; src
|
86
|
+
when '2'; dst
|
87
|
+
when '$'; '$'
|
88
|
+
else; s
|
89
|
+
end
|
90
|
+
}
|
91
|
+
result = Open3.capture3(ffmpeg)
|
84
92
|
if result[2].to_i == 0
|
85
93
|
File.delete(src) if delete_src
|
86
94
|
puts "done."
|
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 = "2.
|
7
|
+
spec.version = "2.3.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, animate, onsen, seaside communications, niconico and youtube.}
|
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: 2.
|
4
|
+
version: 2.3.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: 2015-
|
11
|
+
date: 2015-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|