fix: Use regex for detailed handling reddit feeds

This commit is contained in:
mirusu400 2025-10-15 11:21:12 +09:00
commit ccb55e0ad4

View file

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