mirror of
https://github.com/StrawberryMaster/wayback-machine-downloader.git
synced 2025-12-22 20:26:46 +00:00
Ignore urls with malformed base directories #5
This commit is contained in:
parent
f98ac313c1
commit
e29abc6f3a
@ -79,8 +79,8 @@ class WaybackMachineDownloader
|
|||||||
file_path = backup_path + file_path_elements[0..-1].join('/')
|
file_path = backup_path + file_path_elements[0..-1].join('/')
|
||||||
end
|
end
|
||||||
unless File.exists? file_path
|
unless File.exists? file_path
|
||||||
structure_dir_path dir_path
|
|
||||||
begin
|
begin
|
||||||
|
structure_dir_path dir_path
|
||||||
open(file_path, "wb") do |file|
|
open(file_path, "wb") do |file|
|
||||||
begin
|
begin
|
||||||
open("http://web.archive.org/web/#{timestamp}id_/#{file_url}") do |uri|
|
open("http://web.archive.org/web/#{timestamp}id_/#{file_url}") do |uri|
|
||||||
@ -116,7 +116,7 @@ class WaybackMachineDownloader
|
|||||||
FileUtils::mv file_already_existing, file_already_existing_temporary
|
FileUtils::mv file_already_existing, file_already_existing_temporary
|
||||||
FileUtils::mkdir_p file_already_existing
|
FileUtils::mkdir_p file_already_existing
|
||||||
FileUtils::mv file_already_existing_temporary, file_already_existing_permanent
|
FileUtils::mv file_already_existing_temporary, file_already_existing_permanent
|
||||||
puts "#{file_already_existing} -> #{file_already_existing_permanent}"
|
puts "#{file_already_existing} -> #{file_already_existing_permanent}"
|
||||||
structure_dir_path dir_path
|
structure_dir_path dir_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user