diff --git a/README.md b/README.md index accb43ab..69403d75 100644 --- a/README.md +++ b/README.md @@ -185,7 +185,7 @@ docker pull jxxghp/moviepilot:latest 在`设定`-`规则`中设定,规则说明: -- 仅支持使用内置规则进行排列组合,内置规则有:`BLU`、`4K`、`1080P`、`CNSUB`、`SPECSUB`、`H265`、`H264`、`DOLBY`、`HDR`、`REMUX`、`WEBDL`、`FREE` +- 仅支持使用内置规则进行排列组合,内置规则有:`蓝光原盘`、`4K`、`1080P`、`中文字幕`、`特效字幕`、`H265`、`H264`、`杜比`、`HDR`、`REMUX`、`WEB-DL`、`免费`、`国语配音` 等 - `&`表示与,`|`表示或,`!`表示非,`>`表示优先级层级 - 符合任一层级规则的资源将被标识选中,匹配成功的层级做为该资源的优先级,排越前面优先级超高 - 不符合过滤规则所有层级规则的资源将不会被选中 diff --git a/app/helper/torrent.py b/app/helper/torrent.py index d0f931ee..7afde106 100644 --- a/app/helper/torrent.py +++ b/app/helper/torrent.py @@ -182,6 +182,7 @@ class TorrentHelper: """ _meta = _context.meta_info _torrent = _context.torrent_info + _media = _context.media_info # 站点优先级 _site_order = 999 - (_torrent.site_order or 0) # 季数 @@ -192,13 +193,13 @@ class TorrentHelper: priority = self.system_config.get(SystemConfigKey.TorrentsPriority) if priority != "site": # 排序:标题、资源类型、做种、季集 - return "%s%s%s%s" % (str(_torrent.title).ljust(100, ' '), + return "%s%s%s%s" % (str(_media.title).ljust(100, ' '), str(_torrent.pri_order).rjust(3, '0'), str(_torrent.seeders).rjust(10, '0'), "%s%s" % (_season_len, _episode_len)) else: # 排序:标题、资源类型、站点、做种、季集 - return "%s%s%s%s%s" % (str(_torrent.title).ljust(100, ' '), + return "%s%s%s%s%s" % (str(_media.title).ljust(100, ' '), str(_torrent.pri_order).rjust(3, '0'), str(_site_order).rjust(3, '0'), str(_torrent.seeders).rjust(10, '0'), diff --git a/app/modules/filter/__init__.py b/app/modules/filter/__init__.py index 72314b26..9086f841 100644 --- a/app/modules/filter/__init__.py +++ b/app/modules/filter/__init__.py @@ -32,7 +32,7 @@ class FilterModule(_ModuleBase): }, # 中字 "CNSUB": { - "include": [r'[中国國繁简](/|\s|\\|\|)?[繁简英粤]|[英简繁](/|\s|\\|\|)?[中繁简]|繁體|简体|[中国國][字配]|国语|國語|中文'], + "include": [r'[中国國繁简](/|\s|\\|\|)?[繁简英粤]|[英简繁](/|\s|\\|\|)?[中繁简]|繁體|简体|[中国國][字配]|国语|國語|中文|中字'], "exclude": [] }, # 特效字幕 @@ -52,12 +52,12 @@ class FilterModule(_ModuleBase): }, # 杜比 "DOLBY": { - "include": [r"DOLBY|DOVI|\s+DV$|\s+DV\s+"], + "include": [r"DOLBY|DOVI|[\s.]+DV[\s.]+|杜比"], "exclude": [] }, # HDR "HDR": { - "include": [r"\s+HDR\s+|HDR10|HDR10\+"], + "include": [r"[\s.]+HDR[\s.]+|HDR10|HDR10\+"], "exclude": [] }, # 重编码 @@ -73,6 +73,11 @@ class FilterModule(_ModuleBase): # 免费 "FREE": { "downloadvolumefactor": 0 + }, + # 国语配音 + "CNVOI": { + "include": [r'国语配音|国配'], + "exclude": [] } } @@ -176,7 +181,7 @@ class FilterModule(_ModuleBase): return self.__match_rule(torrent, rule_group) elif isinstance(rule_group, list) and len(rule_group) == 1: # 只有一个规则项 - return self.__match_rule(torrent, rule_group[0]) + return self.__match_group(torrent, rule_group[0]) elif rule_group[0] == "not": # 非操作 return not self.__match_group(torrent, rule_group[1:]) @@ -201,7 +206,7 @@ class FilterModule(_ModuleBase): # FREE规则 downloadvolumefactor = self.rule_set[rule_name].get("downloadvolumefactor") # 匹配项 - content = f"{torrent.title} {torrent.description}" + content = f"{torrent.title} {torrent.description} {' '.join(torrent.labels or [])}" for include in includes: if not re.search(r"%s" % include, content, re.IGNORECASE): # 未发现包含项