mirror of
https://github.com/StrawberryMaster/wayback-machine-downloader.git
synced 2025-12-18 02:06:35 +00:00
Replace exact match by exact url
This commit is contained in:
parent
4eca581257
commit
246441ff17
@ -16,13 +16,13 @@ class WaybackMachineDownloader
|
||||
|
||||
VERSION = "2.0.0"
|
||||
|
||||
attr_accessor :base_url, :exact_match, :directory,
|
||||
attr_accessor :base_url, :exact_url, :directory,
|
||||
:from_timestamp, :to_timestamp, :only_filter, :exclude_filter,
|
||||
:all, :maximum_pages, :threads_count
|
||||
|
||||
def initialize params
|
||||
@base_url = params[:base_url]
|
||||
@exact_match = params[:exact_match]
|
||||
@exact_url = params[:exact_url]
|
||||
@directory = params[:directory]
|
||||
@from_timestamp = params[:from_timestamp].to_i
|
||||
@to_timestamp = params[:to_timestamp].to_i
|
||||
@ -86,7 +86,7 @@ class WaybackMachineDownloader
|
||||
snapshot_list_to_consider = ""
|
||||
snapshot_list_to_consider += get_raw_list_from_api(@base_url, nil)
|
||||
print "."
|
||||
unless @exact_match
|
||||
unless @exact_url
|
||||
@maximum_pages.times do |page_index|
|
||||
snapshot_list = get_raw_list_from_api(@base_url + '/*', page_index)
|
||||
break if snapshot_list.empty?
|
||||
|
||||
@ -39,13 +39,13 @@ class WaybackMachineDownloaderTest < Minitest::Test
|
||||
assert_equal file_expected, @wayback_machine_downloader.get_file_list_by_timestamp[-2]
|
||||
end
|
||||
|
||||
def test_without_exact_match
|
||||
@wayback_machine_downloader.exact_match = false
|
||||
def test_without_exact_url
|
||||
@wayback_machine_downloader.exact_url = false
|
||||
assert @wayback_machine_downloader.get_file_list_curated.size > 1
|
||||
end
|
||||
|
||||
def test_exact_match
|
||||
@wayback_machine_downloader.exact_match = true
|
||||
def test_exact_url
|
||||
@wayback_machine_downloader.exact_url = true
|
||||
assert_equal 1, @wayback_machine_downloader.get_file_list_curated.size
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user