From ccb55e0ad4d8f5cea661217b4cdadfa5f68deb51 Mon Sep 17 00:00:00 2001 From: mirusu400 Date: Wed, 15 Oct 2025 11:21:12 +0900 Subject: [PATCH 1/2] fix: Use regex for detailed handling reddit feeds --- discord_rss_bot/feeds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord_rss_bot/feeds.py b/discord_rss_bot/feeds.py index 8e9212c..892666d 100644 --- a/discord_rss_bot/feeds.py +++ b/discord_rss_bot/feeds.py @@ -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 From e0894779d3dda23fe2306282074308ff77e2227f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Wed, 15 Oct 2025 04:43:39 +0200 Subject: [PATCH 2/2] fix: classify Reddit feeds only when URL contains both "reddit.com" and ".rss" --- discord_rss_bot/feeds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord_rss_bot/feeds.py b/discord_rss_bot/feeds.py index 892666d..ff38a6c 100644 --- a/discord_rss_bot/feeds.py +++ b/discord_rss_bot/feeds.py @@ -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 re.search(r"/r/[a-zA-Z0-9_]+\.rss", url): + if "reddit.com" in url and ".rss" in url: return "Reddit" # Parse the URL and extract the domain