fix: classify Reddit feeds only when URL contains both "reddit.com" and ".rss"

This commit is contained in:
Joakim Hellsén 2025-10-15 04:43:39 +02:00
commit e0894779d3

View file

@ -69,7 +69,7 @@ def extract_domain(url: str) -> str: # noqa: PLR0911
return "YouTube" return "YouTube"
# Special handling for Reddit feeds # Special handling for Reddit feeds
if "reddit.com" in url or re.search(r"/r/[a-zA-Z0-9_]+\.rss", url): if "reddit.com" in url and ".rss" in url:
return "Reddit" return "Reddit"
# Parse the URL and extract the domain # Parse the URL and extract the domain