From 73a3a8cf941c48f081d873c32a87fcb1e8c3f7f4 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 18 Apr 2024 11:20:03 +0800 Subject: [PATCH] fix #1914 --- app/helper/torrent.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/helper/torrent.py b/app/helper/torrent.py index d0c820b3..cfa82121 100644 --- a/app/helper/torrent.py +++ b/app/helper/torrent.py @@ -464,12 +464,13 @@ class TorrentHelper(metaclass=Singleton): logger.info(f'{mediainfo.title} 通过别名或译名匹配到资源:{torrent.site_name} - {torrent.title}') return True # 标题拆分 - titles = [StringUtils.clear_upper(t) for t in re.split(r'[\s/【】.\[\]\-]+', - torrent_meta.org_string) if t] - # 在标题中判断是否存在标题、原语种标题 - if media_titles.intersection(titles): - logger.info(f'{mediainfo.title} 通过标题匹配到资源:{torrent.site_name} - {torrent.title}') - return True + if torrent_meta.org_string: + titles = [StringUtils.clear_upper(t) for t in re.split(r'[\s/【】.\[\]\-]+', + torrent_meta.org_string) if t] + # 在标题中判断是否存在标题、原语种标题 + if media_titles.intersection(titles): + logger.info(f'{mediainfo.title} 通过标题匹配到资源:{torrent.site_name} - {torrent.title}') + return True # 在副标题中判断是否存在标题、原语种标题、别名、译名 if torrent.description: subtitles = {StringUtils.clear_upper(t) for t in re.split(r'[\s/|]+',