diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-03 14:01:33 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-03 16:46:07 -0700 |
commit | 36cedfde374a2643396b070d3116e4b568500e14 (patch) | |
tree | b199868b325897ea5dc2b065192a7eba2daf9c6b /python/fatcat_tools/importers/wayback_static.py | |
parent | 5d29d1336afc90d3575a0379a9e9d9bdac8d1856 (diff) | |
download | fatcat-36cedfde374a2643396b070d3116e4b568500e14.tar.gz fatcat-36cedfde374a2643396b070d3116e4b568500e14.zip |
more involved type wrangling and fixes for importers
Diffstat (limited to 'python/fatcat_tools/importers/wayback_static.py')
-rwxr-xr-x | python/fatcat_tools/importers/wayback_static.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/python/fatcat_tools/importers/wayback_static.py b/python/fatcat_tools/importers/wayback_static.py index 3c619b14..5caed2c7 100755 --- a/python/fatcat_tools/importers/wayback_static.py +++ b/python/fatcat_tools/importers/wayback_static.py @@ -113,15 +113,15 @@ def lookup_cdx( hit = resp.content.decode("utf-8").split("\n")[0] if cdx_output: cdx_output.write(hit + "\n") - cdx = hit.split(" ") - cdx = [x if (x and x != "-") else None for x in cdx] + cdx_chunks = hit.split(" ") + cdx = [x if (x and x != "-") else None for x in cdx_chunks] webcapture_cdx = WebcaptureCdxLine( surt=cdx[0], - timestamp=parse_wbm_timestamp(cdx[1]).isoformat() + "Z", + timestamp=parse_wbm_timestamp(cdx[1] or "").isoformat() + "Z", url=cdx[2], mimetype=cdx[3], - status_code=(cdx[4] and int(cdx[4])) or None, - sha1=b32_hex(cdx[5]), + status_code=int(cdx[4] or ""), + sha1=b32_hex(cdx[5] or ""), sha256=None, ) if verify_hashes: |