From 6e4d00500bce46f6c34b6aec9a100e5e8fa44d0e Mon Sep 17 00:00:00 2001 From: x1ao4 Date: Fri, 8 Aug 2025 20:49:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=89=A7=E9=9B=86=E7=BC=96?= =?UTF-8?q?=E5=8F=B7=E6=8F=90=E5=8F=96=E5=87=BD=E6=95=B0=E8=AF=AF=E6=8F=90?= =?UTF-8?q?=E5=8F=96=E5=AD=A3=E7=BC=96=E5=8F=B7=E4=B8=BA=E9=9B=86=E7=BC=96?= =?UTF-8?q?=E5=8F=B7=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在预处理阶段添加季编号排除逻辑 - 支持排除 S1、Season 1、第1季、第一季等格式 --- quark_auto_save.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/quark_auto_save.py b/quark_auto_save.py index 8f1b5ab..02a98fb 100644 --- a/quark_auto_save.py +++ b/quark_auto_save.py @@ -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: