hartator / wayback-machine-downloader

Download an entire website from the Wayback Machine.
Other
5.29k stars 699 forks source link

(Errno::ENOENT)| No such file or directory @ rb_sysope #186

Open Julienvaralda opened 3 years ago

Julienvaralda commented 3 years ago

impossible to execute???


usersession@MacBook ~ % wayback_machine_downloader http://monsite.com Downloading http://monsite.com to websites/monsite.com/ from Wayback Machine archives.

Getting snapshot pages/Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/lib/wayback_machine_downloader/archive_api.rb:8:in initialize': No such file or directory @ rb_sysopen - http://web.archive.org/cdx/search/xd?url=http://monsite.com&fl=timestamp,original&collapse=digest&gzip=false&filter=statuscode:200 (Errno::ENOENT) from /Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/lib/wayback_machine_downloader/archive_api.rb:8:inopen' from /Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/lib/wayback_machine_downloader/archive_api.rb:8:in get_raw_list_from_api' from /Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/lib/wayback_machine_downloader.rb:88:inget_all_snapshots_to_consider' from /Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/lib/wayback_machine_downloader.rb:105:in get_file_list_curated' from /Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/lib/wayback_machine_downloader.rb:168:inget_file_list_by_timestamp' from /Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/lib/wayback_machine_downloader.rb:309:in file_list_by_timestamp' from /Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/lib/wayback_machine_downloader.rb:192:indownload_files' from /Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/bin/wayback_machine_downloader:72:in <top (required)>' from /Users/usersession/.asdf/installs/ruby/3.0.0/bin/wayback_machine_downloader:23:inload' from /Users/usersession/.asdf/installs/ruby/3.0.0/bin/wayback_machine_downloader:23:in <main>' usersession@MacBook-Pro ~ % which ruby /Users/usersession/.asdf/shims/ruby usersession@MacBook-Pro ~ % which wayback_machine_downloader /Users/usersession/.asdf/shims/wayback_machine_downloader

Maturion commented 3 years ago

This is due to a change that came with Ruby 3. I am quoting Stackoverflow here:

open-uri used to (before Ruby 3.0) overwrite Kernel#open with its own version which also supports reading from external URLs rather than simply opening local files or running commands.

Thus, you need to replace open in ../lib/wayback_machine_downloader/archive_api.rb:8 with URI.open and it will work again. This should have been adressed by the latest pull-request but this commit somehow isn't in the Ruby Gem version yet.

pabs3 commented 3 years ago

I think this has been fixed in commit 30475c5 and version 2.3.0, please upgrade.

@hartator you might want to close this issue.