feeds: move mimetypes into .py from .ini

master
pictuga 2020-03-18 16:08:42 +01:00
parent 7644c550ec
commit e9d46cb6a9
2 changed files with 3 additions and 8 deletions

View File

@ -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

View File

@ -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)