mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-03-20 03:46:40 +08:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user