feeds: add 'mode' to Parsers

master
pictuga 2020-03-18 16:24:08 +01:00
parent 8e3d32f24c
commit 2dd9ae202d
1 changed files with 2 additions and 0 deletions

View File

@ -221,6 +221,7 @@ class ParserBase(object):
class ParserXML(ParserBase): class ParserXML(ParserBase):
default_ruleset = 'rss-channel' default_ruleset = 'rss-channel'
mode = 'xml'
mimetype = ['text/xml', 'application/xml', 'application/rss+xml', mimetype = ['text/xml', 'application/xml', 'application/rss+xml',
'application/rdf+xml', 'application/atom+xml', 'application/xhtml+xml'] 'application/rdf+xml', 'application/atom+xml', 'application/xhtml+xml']
@ -379,6 +380,7 @@ def parse_time(value):
class ParserJSON(ParserBase): class ParserJSON(ParserBase):
default_ruleset = 'json' default_ruleset = 'json'
mode = 'json'
mimetype = ['application/json', 'application/javascript', 'text/javascript'] mimetype = ['application/json', 'application/javascript', 'text/javascript']
def parse(self, raw): def parse(self, raw):