Merge branch 'master' into dejal

This commit is contained in:
David Sinclair 2024-11-04 18:08:44 -07:00
commit b0876789c6

View file

@ -44,7 +44,7 @@ class FeedFinder(object):
logging.warn("Error while getting '{0}'".format(url))
logging.warn("{0}".format(e))
return None
if not skip_user_agent and r.status_code == 403:
if not skip_user_agent and r.status_code in [403, 204]:
return self.get_feed(url, skip_user_agent=True)
return r.text
@ -133,8 +133,9 @@ def find_feeds(url, check_all=False, user_agent=None):
return sort_urls(urls)
# Guessing potential URLs.
fns = ["atom.xml", "index.atom", "index.rdf", "rss.xml", "index.xml", "index.rss", "index.json"]
urls += list(filter(finder.is_feed, [urlparse.urljoin(url, f) for f in fns]))
if not any(ignored_domain in url for ignored_domain in ["openrss", "feedburner"]):
fns = ["atom.xml", "index.atom", "index.rdf", "rss.xml", "index.xml", "index.rss", "index.json"]
urls += list(filter(finder.is_feed, [urlparse.urljoin(url, f) for f in fns]))
return sort_urls(urls)