rget 2.3.2 → 2.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/rget +8 -4
- data/lib/onsen.rb +8 -4
- data/lib/webradio.rb +1 -0
- data/rget.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db7ca2a7888ae0141a1478525ec3c3338dcf1645
|
4
|
+
data.tar.gz: 385a19c4d0af62a476932ed5207db91c514ae5ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca0503e920246e6cc73ba39e801c110aa3dc10c6b8a33c42d965d4988007470fb81212524f56e91bbe2306cfc4c120afa2baa8645613710a169108a905822fa1
|
7
|
+
data.tar.gz: 513ec0cdd6f96859030d77cf1f5348e89d95cdb86a64f584136b9cd2dc7bec9dbe6444c3847b214c1781421d6779342c3f77f81df1fdedf39d30443b3945f132
|
data/bin/rget
CHANGED
@@ -34,10 +34,14 @@ class GetWebRadio < Thor
|
|
34
34
|
define_method(command) do
|
35
35
|
url = params['url']
|
36
36
|
opts = OpenStruct.new(config['options'].merge(options))
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
begin
|
38
|
+
if params['podcast']
|
39
|
+
Podcast.new(url, opts){|media|media.download(params['label'])}
|
40
|
+
else
|
41
|
+
WebRadio(url, opts){|media|media.download(params['label'])}
|
42
|
+
end
|
43
|
+
rescue WebRadio::NotFoundError => e
|
44
|
+
$stderr.puts e.message
|
41
45
|
end
|
42
46
|
end
|
43
47
|
end
|
data/lib/onsen.rb
CHANGED
@@ -11,10 +11,14 @@ class Onsen < WebRadio
|
|
11
11
|
private
|
12
12
|
def onsen_download(name, program_id)
|
13
13
|
html = Nokogiri(open('http://onsen.ag/', 'User-Agent' => 'iPhone', &:read))
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
begin
|
15
|
+
serial = html.css("##{program_id}").text.scan(/#(\d+)/).flatten.first
|
16
|
+
mp3_url = html.css('form[target=_self]').select {|form|
|
17
|
+
form.attr('action') =~ %r[/#{program_id}\w+\.mp3]
|
18
|
+
}.first.attr('action')
|
19
|
+
rescue NoMethodError
|
20
|
+
raise NotFoundError.new("no radio program in #{program_id}.")
|
21
|
+
end
|
18
22
|
mp3_file = "#{name}##{serial}.mp3"
|
19
23
|
mp3ize(mp3_file, mp3_file, false) do
|
20
24
|
open(mp3_file, 'wb:ASCII-8BIT') do |mp3|
|
data/lib/webradio.rb
CHANGED
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.3.
|
7
|
+
spec.version = "2.3.3"
|
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.}
|