From bb6d4c2756b0b461b84450793d9fbb73d1b9065e Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Fri, 10 Oct 2025 16:29:02 +0200 Subject: [PATCH] Re #3486 - Fixing and adding test for RSS/Atom not being converted to text when server sends "text/xml" instead of the "application/atom+xml" header (#3487) --- changedetectionio/processors/magic.py | 29 ++++++++++++++------------- changedetectionio/tests/test_rss.py | 5 +++-- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/changedetectionio/processors/magic.py b/changedetectionio/processors/magic.py index a742b9f88..753aa17c4 100644 --- a/changedetectionio/processors/magic.py +++ b/changedetectionio/processors/magic.py @@ -94,24 +94,21 @@ class guess_stream_type(): self.is_rss = True elif any(s in http_content_header for s in JSON_CONTENT_TYPES): self.is_json = True + elif 'pdf' in magic_content_header: + self.is_pdf = True + elif has_html_patterns or http_content_header == 'text/html': + self.is_html = True + elif any(s in magic_content_header for s in JSON_CONTENT_TYPES): + self.is_json = True + # magic will call a rss document 'xml' + # Rarely do endpoints give the right header, usually just text/xml, so we check also for