From d21ec069b5531efb222b49ccdd78839159dbf2a5 Mon Sep 17 00:00:00 2001 From: Justin Forest Date: Thu, 9 Oct 2008 20:32:23 +0200 Subject: [PATCH] Correct HTML feed auto-detection (bug 215) It lets feedparser detect the feed type, instead of guessing on headers. Thanks to Edouard Pellerin for reporting this bug. --- src/gpodder/cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gpodder/cache.py b/src/gpodder/cache.py index 67ed1a3c..70c881bb 100644 --- a/src/gpodder/cache.py +++ b/src/gpodder/cache.py @@ -118,8 +118,8 @@ class Cache: content_type = parsed_result.headers.get('content-type', '').lower() # TODO: Also detect OPML feeds and other content types here - if content_type.startswith('text/html'): - log('%s looks like a webpage - trying feed autodiscovery.', url, sender=self) + if parsed_result.version == '': + log('%s looks like a webpage - trying feed autodiscovery (%s).', url, content_type, sender=self) if not hasattr(parsed_result.feed, 'links'): return (False, None) try: -- 2.11.4.GIT