Update wrapper.py
This commit is contained in:
parent
685fc730ed
commit
340475a411
@ -38,7 +38,11 @@ def save(url,UA="pywayback python module"):
|
|||||||
try:
|
try:
|
||||||
response = urlopen(req) #nosec
|
response = urlopen(req) #nosec
|
||||||
except urllib.error.HTTPError as e:
|
except urllib.error.HTTPError as e:
|
||||||
|
if e.code == 502:
|
||||||
|
raise PageNotSavedError(e)
|
||||||
|
elif e.code == 429:
|
||||||
raise TooManyArchivingRequestsError(e)
|
raise TooManyArchivingRequestsError(e)
|
||||||
|
|
||||||
header = response.headers
|
header = response.headers
|
||||||
if "exclusion.robots.policy" in str(header):
|
if "exclusion.robots.policy" in str(header):
|
||||||
raise ArchivingNotAllowed("Can not archive %s. Disabled by site owner." % (url))
|
raise ArchivingNotAllowed("Can not archive %s. Disabled by site owner." % (url))
|
||||||
|
Loading…
Reference in New Issue
Block a user