fix(parser): handle torrent names without brackets in get_group

Fixes IndexError when parsing torrent names that don't follow the
standard [Group] format. Now returns empty string instead of crashing.

Fixes #973

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Estrella Pan
2026-01-28 20:25:13 +01:00
parent 99c8764484
commit 07093dda8d

View File

@@ -30,7 +30,10 @@ CHINESE_NUMBER_MAP = {
def get_group(name: str) -> str:
return re.split(r"[\[\]]", name)[1]
parts = re.split(r"[\[\]]", name)
if len(parts) > 1:
return parts[1]
return ""
def pre_process(raw_name: str) -> str: