From e29abc6f3af66f34ca4f306f53a94100a69947e0 Mon Sep 17 00:00:00 2001 From: hartator Date: Mon, 24 Aug 2015 18:00:36 -0500 Subject: [PATCH] Ignore urls with malformed base directories #5 --- lib/wayback_machine_downloader.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/wayback_machine_downloader.rb b/lib/wayback_machine_downloader.rb index a2e8892..b4a20d6 100644 --- a/lib/wayback_machine_downloader.rb +++ b/lib/wayback_machine_downloader.rb @@ -79,8 +79,8 @@ class WaybackMachineDownloader file_path = backup_path + file_path_elements[0..-1].join('/') end unless File.exists? file_path - structure_dir_path dir_path begin + structure_dir_path dir_path open(file_path, "wb") do |file| begin 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::mkdir_p file_already_existing 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 end end