From f7f4ab314b8adf80db53700da5157e460f7eaccb Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Wed, 8 Feb 2023 09:32:57 +0100 Subject: [PATCH] PDF text conversion - fix bug where it detected a site as a PDF file incorrectly Re #1392 #1393 --- changedetectionio/model/Watch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/changedetectionio/model/Watch.py b/changedetectionio/model/Watch.py index f2210dc2..4f367a71 100644 --- a/changedetectionio/model/Watch.py +++ b/changedetectionio/model/Watch.py @@ -153,7 +153,9 @@ class model(dict): @property def is_pdf(self): # content_type field is set in the future - return '.pdf' in self.get('url', '').lower() or 'pdf' in self.get('content_type', '').lower() + # https://github.com/dgtlmoon/changedetection.io/issues/1392 + # Not sure the best logic here + return self.get('url', '').lower().endswith('.pdf') or 'pdf' in self.get('content_type', '').lower() @property def label(self):