From 4e144487dbb758a47f80a8b7cab05e43b3722083 Mon Sep 17 00:00:00 2001 From: pictuga Date: Thu, 25 Oct 2018 01:17:24 +0200 Subject: [PATCH] Test for feedify support first Otherwise might never be called if the content-type is also supported --- morss/morss.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/morss/morss.py b/morss/morss.py index 8d4274b..c48a733 100644 --- a/morss/morss.py +++ b/morss/morss.py @@ -338,15 +338,15 @@ def FeedFetch(url, options): contenttype = con.info().get('Content-Type', '').split(';')[0] - if re.match(b'\s*<\?xml', xml) is not None or contenttype in crawler.MIMETYPE['xml']: - rss = feeds.parse(xml) - - elif feedify.supported(url): + if feedify.supported(url): # using config file-based feedify feed = feedify.Builder(url, xml) feed.build() rss = feed.feed + elif re.match(b'\s*<\?xml', xml) is not None or contenttype in crawler.MIMETYPE['xml']: + rss = feeds.parse(xml) + elif options.items: # using argument-based feedify rule = {'items': options.items}