mirror of
https://github.com/StrawberryMaster/wayback-machine-downloader.git
synced 2025-12-18 10:16:47 +00:00
Ignore urls with particularly long file name #4
This commit is contained in:
parent
919210fe64
commit
47ff4bed13
@ -80,17 +80,21 @@ class WaybackMachineDownloader
|
|||||||
end
|
end
|
||||||
unless File.exists? file_path
|
unless File.exists? file_path
|
||||||
structure_dir_path dir_path
|
structure_dir_path dir_path
|
||||||
open(file_path, "wb") do |file|
|
begin
|
||||||
begin
|
open(file_path, "wb") do |file|
|
||||||
open("http://web.archive.org/web/#{timestamp}id_/#{file_url}") do |uri|
|
begin
|
||||||
file.write(uri.read)
|
open("http://web.archive.org/web/#{timestamp}id_/#{file_url}") do |uri|
|
||||||
|
file.write(uri.read)
|
||||||
|
end
|
||||||
|
rescue OpenURI::HTTPError => e
|
||||||
|
puts "#{file_url} # #{e}"
|
||||||
|
file.write(e.io.read)
|
||||||
|
rescue StandardError => e
|
||||||
|
puts "#{file_url} # #{e}"
|
||||||
end
|
end
|
||||||
rescue OpenURI::HTTPError => e
|
|
||||||
puts "#{file_url} # #{e}"
|
|
||||||
file.write(e.io.read)
|
|
||||||
rescue StandardError => e
|
|
||||||
puts "#{file_url} # #{e}"
|
|
||||||
end
|
end
|
||||||
|
rescue Errno::ENAMETOOLONG => e
|
||||||
|
puts "#{file_url} # #{e}"
|
||||||
end
|
end
|
||||||
puts "#{file_url} -> #{file_path} (#{count}/#{file_list_curated.size})"
|
puts "#{file_url} -> #{file_path} (#{count}/#{file_list_curated.size})"
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user