gaqzi-youtube-downloader 0.6.2 → 1.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.
@@ -10,11 +10,10 @@ begin
10
10
  ConfigYT = YAML::load_file(File.join(ENV['HOME'], '.youtube-downloader'))
11
11
  rescue Errno::ENOENT
12
12
  STDERR.puts "No configuration file found, please copy one."
13
- STDERR.puts " cp #{File.dirname(__FILE__)}/.youtube-downloader ~/"
13
+ STDERR.puts " cp #{File.dirname(__FILE__)}/youtube-downloader.conf ~/.youtube-downloader"
14
14
  exit 1
15
15
  end
16
16
 
17
-
18
17
  if ARGV.empty? or ARGV[0].match(/(-h)|((--)?help)/i)
19
18
  puts "Usage: #{$0.split(/\//)[-1]} <youtube url> [command]"
20
19
  puts "Where command is one of the following:"
@@ -90,24 +89,19 @@ def rip_audio(file, name)
90
89
  end
91
90
 
92
91
  def remove(name)
93
- `/usr/bin/env rm #{the_file}`
92
+ `/usr/bin/env rm #{name}`
94
93
  end
95
94
 
96
95
  case ARGV[1]
97
96
  when /audio/i # Just audio
98
- if File.exist? the_file.to_s
99
- `#{download_command}`
100
- else
101
- `/usr/bin/env mkfifo '#{the_file}'`
102
- IO.popen(download_command)
103
- end
97
+ `#{download_command}` unless File.exist? the_file.to_s
104
98
 
105
99
  rip_audio(the_file, name)
106
- remove(name)
100
+ remove(the_file)
107
101
  when /(all)|(rip)/i # Both audio and video
108
- `#{download_command}`
109
- rip_audio(the_file, name)
102
+ `#{download_command}` unless File.exists? the_file.to_s
110
103
 
104
+ rip_audio(the_file, name)
111
105
  `/usr/bin/env touch #{the_file}` if ConfigYT[:touch]
112
106
  else
113
107
  `#{download_command}`
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: 0.6.2
4
+ version: "1.0"
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: 2009-06-06 00:00:00 -07:00
12
+ date: 2009-08-04 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -23,10 +23,11 @@ extra_rdoc_files: []
23
23
 
24
24
  files:
25
25
  - youtube-downloader
26
- - .youtube-downloader
26
+ - youtube-downloader.conf
27
27
  - README
28
28
  has_rdoc: false
29
- homepage: http://github.com/ba/youtube-downloader
29
+ homepage: http://github.com/gaqzi/youtube-downloader
30
+ licenses:
30
31
  post_install_message:
31
32
  rdoc_options: []
32
33
 
@@ -47,7 +48,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
47
48
  requirements: []
48
49
 
49
50
  rubyforge_project:
50
- rubygems_version: 1.2.0
51
+ rubygems_version: 1.3.5
51
52
  signing_key:
52
53
  specification_version: 2
53
54
  summary: Downloads youtube videos and optionally rips audio