From acff21c00e9793c86d03abd5a165c82561739f7e Mon Sep 17 00:00:00 2001 From: EstrellaXD Date: Sat, 16 Jul 2022 18:19:44 +0800 Subject: [PATCH] =?UTF-8?q?2.5.12=20-=20=E4=BF=AE=E5=A4=8D=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E4=BC=9A=E6=97=A0=E6=B3=95=E6=B7=BB=E5=8A=A0=20contai?= =?UTF-8?q?n=20=E7=9A=84=E9=97=AE=E9=A2=98=20-=20=E5=9C=A8TMDB=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E4=B8=AD=E6=B7=BB=E5=8A=A0=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/parser/title_parser.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/parser/title_parser.py b/src/parser/title_parser.py index dbbc50af..9184de16 100644 --- a/src/parser/title_parser.py +++ b/src/parser/title_parser.py @@ -26,9 +26,9 @@ class TitleParser: logger.warning("Not Matched with TMDB") return title, season if settings.title_language == "zh": - official_title = f"{tmdb_info.title_zh}({tmdb_info.year_number})" + official_title = f"{tmdb_info.title_zh} ({tmdb_info.year_number})" elif settings.title_language == "jp": - official_title = f"{tmdb_info.title_jp}({tmdb_info.year_number})" + official_title = f"{tmdb_info.title_jp} ({tmdb_info.year_number})" season = tmdb_info.last_season return official_title, season @@ -36,6 +36,7 @@ class TitleParser: try: episode = self.raw_parser(raw) title_search = episode.title_zh if episode.title_zh != "" else episode.title_en + title_raw = episode.title_en if episode.title_en != "" else episode.title_zh if settings.enable_tmdb: official_title, season = self.tmdb_parser(title_search, episode.season) else: @@ -43,7 +44,7 @@ class TitleParser: season = episode.season data = { "official_title": official_title, - "title_raw": episode.title_en, + "title_raw": title_raw, "season": season if season is not None else episode.season, "season_raw": episode.season_raw, "group": episode.group, @@ -64,7 +65,7 @@ if __name__ == '__main__': from conf.const_dev import DEV_SETTINGS settings.init(DEV_SETTINGS) T = TitleParser() - raw = "[Lilith-Raws] 在地下城寻求邂逅是否搞错了什么 / Danmachi S04 - 00 [Baha][WEB-DL][1080p][AVC AAC][CHT][MP4]" + raw = "[Lilith-Raws] 在地下城寻求邂逅是否搞错了什么 - 00 [Baha][WEB-DL][1080p][AVC AAC][CHT][MP4]" season = int(re.search(r"\d{1,2}", "S02").group()) dict = T.return_dict(raw) print(dict)