Fix crash in Save Page Now, when run without mocks

This commit is contained in:
Val Lorentz 2022-09-24 22:37:22 +02:00
parent 9782ec22ec
commit 8139bf5410

View File

@ -123,7 +123,9 @@ class Session:
)
def _save_page_now(self, url: str) -> models.WebPageSnapshot:
response = self._session.get(f"https://web.archive.org/save/{url}")
response = self._session.get(
f"https://web.archive.org/save/{url}", allow_redirects=False
)
response.raise_for_status() # TODO: retry
wayback_url = response.headers["Location"]
return self._fetch_wayback_snapshot(url, wayback_url)