# 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'
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
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.
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.'