Merge pull request #2038 from Devinaille/fix_subtitle_match

This commit is contained in:
jxxghp 2024-05-09 11:40:03 +08:00 committed by GitHub
commit 6c365f552e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

3
.gitignore vendored
View File

@ -15,4 +15,5 @@ config/user.db
config/sites/** config/sites/**
*.pyc *.pyc
*.log *.log
.vscode .vscode
venv

View File

@ -497,7 +497,7 @@ class TorrentHelper(metaclass=Singleton):
return True return True
# 在副标题中判断是否存在标题、原语种标题、别名、译名 # 在副标题中判断是否存在标题、原语种标题、别名、译名
if torrent.description: if torrent.description:
subtitles = {StringUtils.clear_upper(t) for t in re.split(r'[\s/|]+', subtitles = {StringUtils.clear_upper(t) for t in re.split(r'[\s/【】|]+',
torrent.description) if t} torrent.description) if t}
if media_titles.intersection(subtitles) or media_names.intersection(subtitles): if media_titles.intersection(subtitles) or media_names.intersection(subtitles):
logger.info(f'{mediainfo.title} 通过副标题匹配到资源:{torrent.site_name} - {torrent.title}' logger.info(f'{mediainfo.title} 通过副标题匹配到资源:{torrent.site_name} - {torrent.title}'