akamhy / waybackpy

Wayback Machine API interface & a command-line tool
https://pypi.org/project/waybackpy/
MIT License
453 stars 32 forks source link

save redirected #92

Closed eggplants closed 3 years ago

eggplants commented 3 years ago

I would like to provide an error to handle this.

import waybackpy
w = waybackpy.Url('http://google.com')
w.save() #=> redirected to https://www.google.com
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/eggplants/.pyenv/versions/3.7.9/lib/python3.7/site-packages/waybackpy/wrapper.py", line 161, in save
    instance=self,
  File "/home/eggplants/.pyenv/versions/3.7.9/lib/python3.7/site-packages/waybackpy/utils.py", line 303, in _archive_url_parser
    raise WaybackError(exc_message)
waybackpy.exceptions.WaybackError: No archive URL found in the API response. If 'http://google.com' can be accessed via your web browser then either Wayback Machine is malfunctioning or it refused to archive your URL.
Header:
save redirected
akamhy commented 3 years ago

it's RedirectSaveError

eggplants commented 3 years ago

Thank you so much