diff options
author | Bryan Newbold <bnewbold@archive.org> | 2021-10-11 16:29:36 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2021-10-11 16:29:38 -0700 |
commit | 850f97eefa11e52a4a802eaada720f692cda6264 (patch) | |
tree | c8e3d6186aede725e6deb6ceaf73abe5f054aec5 /python | |
parent | 57f879c00b00c6cd4051f54662fea3f96f80ad35 (diff) | |
download | sandcrawler-850f97eefa11e52a4a802eaada720f692cda6264.tar.gz sandcrawler-850f97eefa11e52a4a802eaada720f692cda6264.zip |
spn: avoid 'None' job_id
Thanks Vanglis for reporting these.
Not sure this commit fixes *all* instances of the problem.
Diffstat (limited to 'python')
-rw-r--r-- | python/sandcrawler/ia.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python/sandcrawler/ia.py b/python/sandcrawler/ia.py index c586972..0c3f621 100644 --- a/python/sandcrawler/ia.py +++ b/python/sandcrawler/ia.py @@ -864,7 +864,7 @@ class SavePageNowClient: if resp_json and 'message' in resp_json and 'You have already reached the limit of active sessions' in resp_json['message']: raise SavePageNowBackoffError(resp_json['message']) - elif not resp_json or 'job_id' not in resp_json: + elif not resp_json or 'job_id' not in resp_json or not resp_json['job_id']: raise SavePageNowError( "Didn't get expected 'job_id' field in SPN2 response: {}".format(resp_json)) @@ -874,7 +874,7 @@ class SavePageNowClient: # poll until complete final_json = None for i in range(self.poll_count): - resp = self.v2_session.get("{}/status/{}".format(self.v2endpoint, resp_json['job_id'])) + resp = self.v2_session.get("{}/status/{}".format(self.v2endpoint, job_id)) try: resp.raise_for_status() except: |