Support feeds handed out as text/html

<http://www.pro-linux.de/rss/index1.xml> and <http://tehrantimes.com/index.php?option=com_ninjarsssyndicator&feed_id=1&format=raw> are on an equal footing…
This commit is contained in:
pictuga 2013-09-16 00:33:24 +02:00
parent 8eb2f7c249
commit 658f51e5a9

View File

@ -385,8 +385,7 @@ def Gather(url, cachePath, progress=False):
except (urllib2.URLError, httplib.HTTPException, socket.timeout):
return False
if con.info().type in ['text/xml', 'application/xml', 'application/rss+xml',
'application/rdf+xml', 'application/atom+xml']:
if xml[:5] == '<?xml' or con.info().type in ['text/xml', 'application/xml', 'application/rss+xml', 'application/rdf+xml', 'application/atom+xml']:
cache.set('xml', xml)
cache.set('etag', con.headers.getheader('etag'))
cache.set('lastmodified', con.headers.getheader('last-modified'))