You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, get_memento() can be called in a few different ways:
get_memento(archived_url) requests a memento using the URL, timestamp, and mode that are baked into the URL. (archived_url means a URL like https://web.archive.org/web/[YYYYMMDDHHmmss][mode]/[url])
get_memento(cdx_record, mode=mode) requests a memento with the URL and timestamp from the CDX record object, and the given mode (where mode defaults to original)
get_memento(url, timestamp, mode=mode) requests a memento of the given URL at the given timestamp with the given mode (again, mode is optional and defaults to original)
Folks using this library will usually want mode=Mode.original, which is what we typically do by default. BUT since an archive URL has the mode baked in, we obey whatever mode was in the URL.
The problem is that mode as a concept is a little advanced and requires extra thinking about what you’re asking for. Folks are prone to copying a URL from their browser and dropping it in here to try things out, or accidentally using cdx_record.view_url instead of just passing the CDX record directly without realizing that they are changing modes (or what that even means!). For example, #109 uncovered a legitimate issue with view mode, but the user didn’t actually want to be using view mode at all! (Once I explained that, it turned out the actual issue wasn’t even a blocker for him — he switched to original mode and was good to go.)
So: should calling get_memento(archived_url) ignore the mode that’s in the URL and use whatever one is explicitly set as a parameter instead (as in all other cases, defaulting to original)? For example:
Currently gets you a memento in view mode. The change I’m thinking about would mean you’d get original mode instead here. If you wanted view mode, you’d have to ask for it explicitly:
Mr0grog
changed the title
Should get_memento() assume original mode unless the mode parameter is explicitly set?
Should get_memento() ignore the mode in archive.org URLs?
Mar 8, 2023
Currently,
get_memento()
can be called in a few different ways:get_memento(archived_url)
requests a memento using the URL, timestamp, and mode that are baked into the URL. (archived_url
means a URL likehttps://web.archive.org/web/[YYYYMMDDHHmmss][mode]/[url]
)get_memento(cdx_record, mode=mode)
requests a memento with the URL and timestamp from the CDX record object, and the given mode (where mode defaults tooriginal
)get_memento(url, timestamp, mode=mode)
requests a memento of the given URL at the given timestamp with the given mode (again, mode is optional and defaults tooriginal
)Folks using this library will usually want
mode=Mode.original
, which is what we typically do by default. BUT since an archive URL has the mode baked in, we obey whatever mode was in the URL.The problem is that
mode
as a concept is a little advanced and requires extra thinking about what you’re asking for. Folks are prone to copying a URL from their browser and dropping it in here to try things out, or accidentally usingcdx_record.view_url
instead of just passing the CDX record directly without realizing that they are changing modes (or what that even means!). For example, #109 uncovered a legitimate issue with view mode, but the user didn’t actually want to be using view mode at all! (Once I explained that, it turned out the actual issue wasn’t even a blocker for him — he switched to original mode and was good to go.)So: should calling
get_memento(archived_url)
ignore the mode that’s in the URL and use whatever one is explicitly set as a parameter instead (as in all other cases, defaulting tooriginal
)? For example:Currently gets you a memento in
view
mode. The change I’m thinking about would mean you’d getoriginal
mode instead here. If you wantedview
mode, you’d have to ask for it explicitly:It would also mean all these calls get you the same result, instead of different ones:
The text was updated successfully, but these errors were encountered: