viddl-rb 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.txt +1 -1
- data/bin/viddl-rb +4 -1
- data/helper/download-helper.rb +3 -5
- data/plugins/megavideo.rb +0 -4
- data/plugins/vimeo.rb +0 -3
- data/plugins/youtube.rb +0 -4
- metadata +3 -3
data/CHANGELOG.txt
CHANGED
data/bin/viddl-rb
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'helper')
|
3
3
|
|
4
|
+
require "rubygems"
|
5
|
+
require "nokogiri"
|
6
|
+
require "cgi"
|
7
|
+
require "open-uri"
|
4
8
|
require "download-helper.rb"
|
5
9
|
require "plugin-helper.rb"
|
6
10
|
|
7
|
-
|
8
11
|
if ARGV.first.nil?
|
9
12
|
puts "Usage: viddl-rb [URL]!"
|
10
13
|
exit
|
data/helper/download-helper.rb
CHANGED
@@ -25,14 +25,12 @@ def self.save_file(file_uri, file_name)
|
|
25
25
|
unescaped_uri = CGI::unescape(file_uri)
|
26
26
|
result = false
|
27
27
|
if `which wget`.include?("wget")
|
28
|
-
|
29
|
-
|
30
|
-
result = ($?.exitstatus == 0)
|
28
|
+
puts "using wget"
|
29
|
+
result = system("wget \"#{unescaped_uri}\" -O #{file_name}")
|
31
30
|
elsif `which curl`.include?("curl")
|
32
31
|
puts "using curl"
|
33
32
|
#-L means: follow redirects, We set an agent because Vimeo seems to want one
|
34
|
-
|
35
|
-
result = ($?.exitstatus == 0)
|
33
|
+
result = system("curl -A 'Mozilla/2.02 (OS/2; U)' -L \"#{unescaped_uri}\" -o #{file_name}")
|
36
34
|
else
|
37
35
|
open(file_name, 'wb') { |file|
|
38
36
|
file.write(fetch_file(unescaped_uri)); puts
|
data/plugins/megavideo.rb
CHANGED
data/plugins/vimeo.rb
CHANGED
data/plugins/youtube.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: viddl-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-07-16 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
16
|
-
requirement: &
|
16
|
+
requirement: &70157981935280 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70157981935280
|
25
25
|
description: An extendable commandline video downloader for flash video sites. Includes
|
26
26
|
plugins for vimeo, youtube and megavideo
|
27
27
|
email: mail@marc-seeger.de
|