aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-06-26 09:56:14 -0700
committerBryan Newbold <bnewbold@archive.org>2020-06-26 09:56:14 -0700
commitf766aa742dee0b3937a432e3afc4cc48250b1d09 (patch)
tree344d9f5259f230287fdf2677445a7d6973aa3bae /python
parentd47a51c927a57208bea22900b5b5c9f519140a3c (diff)
downloadsandcrawler-f766aa742dee0b3937a432e3afc4cc48250b1d09.tar.gz
sandcrawler-f766aa742dee0b3937a432e3afc4cc48250b1d09.zip
handle non-success case of parsing extract from JSON/dict
Diffstat (limited to 'python')
-rw-r--r--python/sandcrawler/pdfextract.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/sandcrawler/pdfextract.py b/python/sandcrawler/pdfextract.py
index 921c883..3701172 100644
--- a/python/sandcrawler/pdfextract.py
+++ b/python/sandcrawler/pdfextract.py
@@ -53,7 +53,7 @@ class PdfExtractResult:
"""
if record['status'] != 'success':
return PdfExtractResult(
- sha1hex=record['sha1hex'],
+ sha1hex=record.get('sha1hex') or record['key'],
status=record['status'],
error_msg=record.get('error_msg'),
)