Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for retrying failed connections, including adding a new --tries option to change the default #6

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

morgant
Copy link

@morgant morgant commented Jun 3, 2024

IMPORTANT: Both PRs #4 & #5 are prerequisites for this PR and should be merged first.

This implements automatic retrying upon a network connection error (not an HTTP 4XX/5XX error), up to 20 times, by default. It also adds a new --tries option which accepts a number of times to try (including the first) to override the default of 20 retries.

This further improves the reliability of the tool, plus helps if there have been any errors due to rate-limiting (see Issue #1).

Example usage:

./bin/wayback_machine_downloader --to 20120222134837 --tries 10 http://www.folklore.org/

…with Ruby 3.x, plus added some CGI.escape() to ensure that the requested URL's query string parameters are handled correctly and not accidentally mixed with the WayBack Machine's query string parameters
…p/wait between requests, plus a '--wait-random' option which will randomize the number of wait seconds by a 0.5x-2x. These options are used by the new WaybackMachineDownloader#wait method which is called during subsequent requests. Issue cocoflan#1
… including a new '--tries' option accepting a number of times to retry if a connection fails for a fatal error (not just an HTTP 4XX/5XX error; the default is 20 retries'). Issue cocoflan#1
…r#download_file as the URI should only be escaped when querying the WaybackMachine API, not when requesting files. Issue cocoflan#3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant