From 5b7f613f77c5bc77f071bcb7cc975c5f4dd02c87 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 10 Jan 2020 17:19:32 -0800 Subject: hack/workaround for protocols.io octet PDFs --- python/sandcrawler/ingest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/sandcrawler/ingest.py b/python/sandcrawler/ingest.py index 12d1473..ce3b75e 100644 --- a/python/sandcrawler/ingest.py +++ b/python/sandcrawler/ingest.py @@ -253,8 +253,10 @@ class IngestFileWorker(SandcrawlerWorker): return result if not (resource.hit and file_meta['mimetype'] == "application/pdf"): - result['status'] = "wrong-mimetype" # formerly: "other-mimetype" - return result + # protocols.io PDFs are "application/octet-stream" + if not (file_meta['mimetype'] == "application/octet-stream" and "://protocols.io/" in resource.terminal_url): + result['status'] = "wrong-mimetype" # formerly: "other-mimetype" + return result info = self.process_hit(resource, file_meta) result.update(info) -- cgit v1.2.3