Remove list attribute from the downloader.

Whether to list or download is a program option external to the downloader
This commit is contained in:
Oleg Pudeyev 2017-03-15 17:12:41 -04:00
parent ea73ed5ed6
commit 6b8c1aa194
2 changed files with 2 additions and 3 deletions

View File

@ -58,7 +58,7 @@ end.parse!
if (base_url = ARGV[-1])
options[:base_url] = base_url
wayback_machine_downloader = WaybackMachineDownloader.new options
if wayback_machine_downloader.list
if options[:list]
wayback_machine_downloader.list_files
else
wayback_machine_downloader.download_files

View File

@ -17,7 +17,7 @@ class WaybackMachineDownloader
VERSION = "1.1.5"
attr_accessor :base_url, :directory, :from_timestamp, :to_timestamp,
:only_filter, :exclude_filter, :all, :list, :maximum_pages, :threads_count
:only_filter, :exclude_filter, :all, :maximum_pages, :threads_count
def initialize params
@base_url = params[:base_url]
@ -27,7 +27,6 @@ class WaybackMachineDownloader
@only_filter = params[:only_filter]
@exclude_filter = params[:exclude_filter]
@all = params[:all]
@list = params[:list]
@maximum_pages = params[:maximum_pages] ? params[:maximum_pages].to_i : 100
@threads_count = params[:threads_count].to_i
end