-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Mementos of redirects in view mode raise "could not be played" error #109
Comments
Ah! It turns out the URL you are using effectively sets the The URL you requested was a redirect, but in view mode, the Wayback Machine gives us a normal webpage (not a redirect) with info about the where the redirect is going and pauses for a few seconds before redirecting with JavaScript. I obviously haven’t done rigorous-enough testing with that playback mode (we almost always use the default, which is That said, did you intend to use
|
Redirects are messy in view mode (see #109). This adds a test for them, even though it currently fails.
When requesting mementos of redirects in `view` mode, we get back a web page that redirects in JavaScript and that is missing some important memento headers, causing us to raise a pretty unexpected error. This attempts to work around the issue and detect that a page is a memento of a redirect. This is a first pass, and probably needs some more cleanup. Fixes #109.
Thank you for this detailed explanation. You're correct that I intended to use |
If you are using for record in client.search('https://somewhere.com/', ...):
get_memento(record, exact=False) # gets `original` mode by default
# or: get_memento(record, mode=wayback.Mode.view, exact=False) |
Thank you, that is indeed easier. I must've missed it when first reading the docs and coding this up. |
When requesting mementos of redirects in `view` mode, we get back a web page that redirects in JavaScript and that is missing some important memento headers, causing us to raise a pretty unexpected error. This attempts to work around the issue and detect that a page is a memento of a redirect when in view mode. This is a first pass, and probably needs some more cleanup. Fixes #109.
Hi, I'm getting an error from this code,
The comment in that section of the WaybackClient code states that this error should only occur if exact is True or if the target URL is outside the target_window. I don't think either of those apply because I'm setting exact to False and the target URL has the same timestamp:
original url / target url (both are 20230212225711)
Anyone know what might cause this?
The text was updated successfully, but these errors were encountered: