From 402fd52f40840dd0cf1c2ca423df952c4180000c Mon Sep 17 00:00:00 2001 From: sparky Date: Tue, 6 Oct 2026 11:31:20 +0200 Subject: [PATCH] fix(sonar): drop redundant optional group in audio-link regex (python:S5842) Co-Authored-By: Claude Sonnet 5.5 --- routes/sources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/sources.py b/routes/sources.py index 9f9453b..18a1125 100644 --- a/routes/sources.py +++ b/routes/sources.py @@ -290,7 +290,7 @@ def _generic_audio_page_source(url: str) -> dict: page_title = _plain_text(title.group(1)) if title else source_name seen = set() items = [] - for match in re.finditer(r"""(?:src|href)=["']([^"']+\.(?:mp3|wav|ogg|flac|m4a|aac)(?:[^"']*)?)["']""", body, re.I): + for match in re.finditer(r"""(?:src|href)=["']([^"']+\.(?:mp3|wav|ogg|flac|m4a|aac)[^"']*)["']""", body, re.I): audio_url = urljoin(url, unescape(match.group(1))) if audio_url in seen: continue