mirror of
https://github.com/Cp0204/quark-auto-save.git
synced 2026-01-13 07:40:45 +08:00
修复剧集编号提取函数误提取季编号为集编号的问题
- 在预处理阶段添加季编号排除逻辑 - 支持排除 S1、Season 1、第1季、第一季等格式
This commit is contained in:
parent
5a4afbe737
commit
6e4d00500b
@ -363,6 +363,18 @@ def extract_episode_number(filename, episode_patterns=None, config_data=None):
|
||||
for pattern in resolution_patterns:
|
||||
filename_without_dates = re.sub(pattern, ' ', filename_without_dates)
|
||||
|
||||
# 预处理:移除季编号标识,避免误提取季编号为集编号
|
||||
season_patterns = [
|
||||
r'[Ss]\d+(?![Ee])', # S1, S01 (但不包括S01E01中的S01)
|
||||
r'[Ss]\s+\d+', # S 1, S 01
|
||||
r'Season\s*\d+', # Season1, Season 1
|
||||
r'第\s*\d+\s*季', # 第1季, 第 1 季
|
||||
r'第\s*[一二三四五六七八九十百千万零两]+\s*季', # 第一季, 第 二 季
|
||||
]
|
||||
|
||||
for pattern in season_patterns:
|
||||
filename_without_dates = re.sub(pattern, ' ', filename_without_dates, flags=re.IGNORECASE)
|
||||
|
||||
# 优先匹配SxxExx格式
|
||||
match_s_e = re.search(r'[Ss](\d+)[Ee](\d+)', filename_without_dates)
|
||||
if match_s_e:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user