gaqzi-youtube-downloader 0.5 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/youtube-downloader +4 -4
- metadata +2 -2
data/youtube-downloader
CHANGED
@@ -45,7 +45,7 @@ begin
|
|
45
45
|
the_vid.id = l.match(/"t":\s+"([^"]+)/)[1]
|
46
46
|
the_vid.video_id = l.match(/"video_id":\s+"([^"]+)/)[1]
|
47
47
|
elsif l.match(/<title>/)
|
48
|
-
the_vid.title = l.match(/<title>YouTube - (.*)<\/title>/)[1]
|
48
|
+
the_vid.title = l.match(/<title>YouTube - (.*)<\/title>/)[1].gsub(/&/,'&')
|
49
49
|
end
|
50
50
|
|
51
51
|
break if not the_vid.empty?
|
@@ -67,16 +67,16 @@ name = if name.empty?
|
|
67
67
|
the_vid.title
|
68
68
|
else
|
69
69
|
name
|
70
|
-
end.gsub(/(['" ])/, '\\\\\1')
|
70
|
+
end.gsub(/(['" &;<>|$#!])/, '\\\\\1') # Quote these so we can pass to shell
|
71
71
|
the_file = "#{$DOWNLOAD_DIR}/#{name}.#{$FILE_EXTENSION}"
|
72
72
|
|
73
73
|
download_command = case ENV['OSTYPE']
|
74
74
|
when 'darwin' # Mac OS X
|
75
75
|
"/usr/bin/env curl -L -C - -o #{the_file} '#{the_vid}'"
|
76
76
|
when /BSD/i
|
77
|
-
"/usr/bin/env fetch -o
|
77
|
+
"/usr/bin/env fetch -o #{the_file} '#{the_vid}'"
|
78
78
|
else # Linux and whatever, most people got wget installed!
|
79
|
-
"/usr/bin/env wget '#{the_vid}' -c -O
|
79
|
+
"/usr/bin/env wget '#{the_vid}' -c -O #{the_file}"
|
80
80
|
end
|
81
81
|
|
82
82
|
def rip_audio(file, name)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gaqzi-youtube-downloader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Bj\xC3\xB6rn Andersson"
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: .
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-09-
|
12
|
+
date: 2008-09-27 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|