diff --git a/webarchiv.py b/webarchiv.py index 3076c6481476a4a9786c8007fb42e231b5a92ec8..384e139b8fd279b3082c95c62de2179607450c0a 100644 --- a/webarchiv.py +++ b/webarchiv.py @@ -111,7 +111,7 @@ class WebarchivSession: @staticmethod def _handle_response_errors(r): - if r.status_code == 403: + if r.status_code == 401: print('Forbidden. Invalid Token or ApiKey transmitted', file=sys.stderr) return r elif r.status_code == 400: @@ -125,7 +125,7 @@ class WebarchivSession: r = requests.get(self.base_url.format(op), **kwargs) if r.ok: return r - elif r.status_code == 403 and auto_connect: + elif r.status_code == 401 and auto_connect: self.connect() kwargs['headers'] = { 'Authorization': 'Bearer ' + self.token @@ -155,7 +155,7 @@ class WebarchivSession: r = requests.post(self.base_url.format(op), json=json, **kwargs) if r.status_code == 201: return r - elif r.status_code == 403 and auto_connect: + elif r.status_code == 401 and auto_connect: self.connect() return self._post(op, False, json, **kwargs) else: