mirror of
https://github.com/StrawberryMaster/wayback-machine-downloader.git
synced 2025-12-17 17:56:44 +00:00
Use file timestamp to retrieve files instead of user provided timestamp #14
This commit is contained in:
parent
ae96c04a90
commit
355f4c1be7
@ -67,6 +67,7 @@ class WaybackMachineDownloader
|
|||||||
count += 1
|
count += 1
|
||||||
file_url = file_remote_info[:file_url]
|
file_url = file_remote_info[:file_url]
|
||||||
file_id = file_remote_info[:file_id]
|
file_id = file_remote_info[:file_id]
|
||||||
|
file_timestamp = file_remote_info[:timestamp]
|
||||||
file_path_elements = file_id.split('/')
|
file_path_elements = file_id.split('/')
|
||||||
if file_id == ""
|
if file_id == ""
|
||||||
dir_path = backup_path
|
dir_path = backup_path
|
||||||
@ -84,6 +85,7 @@ class WaybackMachineDownloader
|
|||||||
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|
|
||||||
|
open("http://web.archive.org/web/#{file_timestamp}id_/#{file_url}") do |uri|
|
||||||
file.write(uri.read)
|
file.write(uri.read)
|
||||||
end
|
end
|
||||||
rescue OpenURI::HTTPError => e
|
rescue OpenURI::HTTPError => e
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user