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 CHANGED
@@ -1,4 +1,4 @@
1
- === 0.4
1
+ === 0.4.x
2
2
  * New Features
3
3
  * Use wget or curl (if present)
4
4
 
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
@@ -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
- puts "using wget"
29
- IO.popen("wget \"#{unescaped_uri}\" -O #{file_name}", "r") { |pipe| pipe.each {|line| print line}}
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
- IO.popen("curl -A 'Mozilla/2.02 (OS/2; U)' -L \"#{unescaped_uri}\" -o #{file_name}", "r") { |pipe| pipe.each {|line| print line }}
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
@@ -1,8 +1,4 @@
1
1
  class Megavideo < PluginBase
2
- require "cgi"
3
- require "open-uri"
4
- require "nokogiri"
5
-
6
2
  #this will be called by the main app to check weather this plugin is responsible for the url passed
7
3
  def self.matches_provider?(url)
8
4
  url.include?("megavideo.com")
data/plugins/vimeo.rb CHANGED
@@ -1,7 +1,4 @@
1
1
  class Vimeo < PluginBase
2
- require "nokogiri"
3
- require "open-uri"
4
-
5
2
  #this will be called by the main app to check weather this plugin is responsible for the url passed
6
3
  def self.matches_provider?(url)
7
4
  url.include?("vimeo.com")
data/plugins/youtube.rb CHANGED
@@ -1,8 +1,4 @@
1
1
  class Youtube < PluginBase
2
- require "cgi"
3
- require "open-uri"
4
- require "nokogiri"
5
-
6
2
  #this will be called by the main app to check weather this plugin is responsible for the url passed
7
3
  def self.matches_provider?(url)
8
4
  url.include?("youtube.com")
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.1
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: &70145693005120 !ruby/object:Gem::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: *70145693005120
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