X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=bin%2Fwhatever-dl;h=146dbeca69cc48087eefb2914f0e065c7fe8322f;hb=8e886df259246365023322b78f58e4037cb536a4;hp=448db85289b0dcd0009d4c448184c5945d155ba9;hpb=9a5310260a276a57c084d07de2bb97d78ce2a8ff;p=dead%2Fwhatever-dl.git diff --git a/bin/whatever-dl b/bin/whatever-dl index 448db85..146dbec 100755 --- a/bin/whatever-dl +++ b/bin/whatever-dl @@ -32,7 +32,7 @@ require 'getoptlong' # Thus, our require statements will work regardless of # how or from where the script was run. executable = Pathname.new(__FILE__).realpath.to_s -$: << File.dirname(executable) + '/../' +$LOAD_PATH << File.dirname(executable) + '/../' # Load our config file. require 'bin/configuration' @@ -95,7 +95,7 @@ if (__FILE__ == $0) then end # Warn about nonsensical options. - if options[:continue] and not (Configuration::DOWNLOAD_METHOD == :wget) + if options[:continue] and not Configuration::DOWNLOAD_METHOD == :wget puts 'WARNING: The --continue flag does nothing unless DOWNLOAD_METHOD is :wget.' end @@ -120,9 +120,9 @@ if (__FILE__ == $0) then video_url = site.get_video_url() if video_url.nil? - puts 'Error retrieving video URL.' - exit(EXIT_COULDNT_GET_VIDEO_URL) - end + puts 'Error retrieving video URL:' + puts "Site not supported, and the generic parser couldn't find any videos." + exit(EXIT_COULDNT_GET_VIDEO_URL) end # The Downloader class is a factory; it should decide # which subclass we get. @@ -135,6 +135,7 @@ if (__FILE__ == $0) then begin downloader.download(video_url, site.get_video_filename(), + site.headers(), continue=options[:continue]) rescue Errno::ECONNREFUSED => e puts 'The connection to the server (to download the video file) was refused. Check your connection, and try again later.'