mirror of
https://github.com/StrawberryMaster/wayback-machine-downloader.git
synced 2025-12-17 17:56:44 +00:00
Merge pull request #192 from pabs3/uri-open-compat
Make URI#open cross Ruby versions compatible
This commit is contained in:
commit
fe9893e959
@ -268,7 +268,7 @@ class WaybackMachineDownloader
|
|||||||
structure_dir_path dir_path
|
structure_dir_path dir_path
|
||||||
open(file_path, "wb") do |file|
|
open(file_path, "wb") do |file|
|
||||||
begin
|
begin
|
||||||
URI.open("https://web.archive.org/web/#{file_timestamp}id_/#{file_url}", "Accept-Encoding" => "plain") do |uri|
|
URI("https://web.archive.org/web/#{file_timestamp}id_/#{file_url}").open("Accept-Encoding" => "plain") 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