From 766bcb13a2ec1991f04e06a79539ba12925de8f4 Mon Sep 17 00:00:00 2001 From: EstrellaXD Date: Sat, 15 Jul 2023 16:15:27 +0800 Subject: [PATCH] fix: cannot match title when title parser item has regex item. --- backend/src/module/downloader/download_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/module/downloader/download_client.py b/backend/src/module/downloader/download_client.py index 203b4705..6b003e1e 100644 --- a/backend/src/module/downloader/download_client.py +++ b/backend/src/module/downloader/download_client.py @@ -1,4 +1,5 @@ import logging +import re from .path import TorrentPath @@ -70,9 +71,10 @@ class DownloadClient(TorrentPath): def set_rule(self, data: BangumiData): data.rule_name = self._rule_name(data) data.save_path = self._gen_save_path(data) + raw_title = re.escape(data.title_raw) rule = { "enable": True, - "mustContain": data.title_raw, + "mustContain": raw_title, "mustNotContain": "|".join(data.filter), "useRegex": True, "episodeFilter": "",