]> gitweb.michael.orlitzky.com - dead/whatever-dl.git/blobdiff - src/open_uri_downloader.rb
Allow the downloaders to take advantage of the websites' headers.
[dead/whatever-dl.git] / src / open_uri_downloader.rb
index 06c9b3d3b26d9b46ca5b070402bd3f7ce494bbd6..e55c0fa7d0e60635b29b1d27b2f843f27da2d873 100644 (file)
@@ -20,7 +20,7 @@ require 'src/uri_utilities'
 
 class OpenUriDownloader < Downloader
 
-  def download(url, outfile, continue=false)
+  def download(url, outfile, headers = {}, continue = false)
     if File.exists?(outfile)
       raise IOError.new("Output file already exists. Please remove #{outfile}, and try again.")
     end
@@ -31,7 +31,7 @@ class OpenUriDownloader < Downloader
     puts "Fetching #{url}"
     puts "Saving as #{outfile}."
     puts ''
-    uu.download_with_progress_bar(uri, outfile)
+    uu.download_with_progress_bar(uri, outfile, headers)
   end
   
 end