diff options
author | Bryan Newbold <bnewbold@archive.org> | 2020-02-22 12:33:37 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2020-02-22 12:33:41 -0800 |
commit | d08aac7381a392cecfe8931821df5e149b58f32a (patch) | |
tree | a0dfa21ce741d3c963d031bd468142202debfcd6 | |
parent | 06d85e6004de36b7162e11d5171e2eab79f9c78a (diff) | |
download | sandcrawler-d08aac7381a392cecfe8931821df5e149b58f32a.tar.gz sandcrawler-d08aac7381a392cecfe8931821df5e149b58f32a.zip |
cdx: handle empty/null CDX response
Sometimes seem to get empty string instead of empty JSON list
-rw-r--r-- | python/sandcrawler/ia.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/python/sandcrawler/ia.py b/python/sandcrawler/ia.py index dbafa01..31f0260 100644 --- a/python/sandcrawler/ia.py +++ b/python/sandcrawler/ia.py @@ -123,6 +123,8 @@ class CdxApiClient: if resp.status_code != 200: raise CdxApiError(resp.text) #print(resp.url, file=sys.stderr) + if not resp.text: + return None rj = resp.json() if len(rj) <= 1: return None |