From e9d46cb6a966cdeb7f0164baa7ed69d0ef218ee4 Mon Sep 17 00:00:00 2001 From: pictuga Date: Wed, 18 Mar 2020 16:08:42 +0100 Subject: [PATCH] feeds: move mimetypes into .py from .ini --- morss/feedify.ini | 8 -------- morss/feeds.py | 3 +++ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/morss/feedify.ini b/morss/feedify.ini index 11e4c4d..4e3776a 100644 --- a/morss/feedify.ini +++ b/morss/feedify.ini @@ -3,14 +3,6 @@ mode = xpath path = N/A -mimetype = - text/xml - application/xml - application/rss+xml - application/rdf+xml - application/atom+xml - application/xhtml+xml - ;RSS, rdf:rdf ;RSS, channel ;Atom diff --git a/morss/feeds.py b/morss/feeds.py index 4bc5811..21df9c8 100644 --- a/morss/feeds.py +++ b/morss/feeds.py @@ -241,6 +241,8 @@ class ParserBase(object): class ParserXML(ParserBase): ruleset = 'rss' + mimetype = ['text/xml', 'application/xml', 'application/rss+xml', + 'application/rdf+xml', 'application/atom+xml', 'application/xhtml+xml'] NSMAP = {'atom': 'http://www.w3.org/2005/Atom', 'atom03': 'http://purl.org/atom/ns#', @@ -397,6 +399,7 @@ def parse_time(value): class ParserJSON(ParserBase): ruleset = 'json' + mimetype = ['application/json', 'application/javascript', 'text/javascript'] def parse(self, raw): return json.loads(raw)