From 102afe58cf778f6b653a5b89c750c721fc43f1d0 Mon Sep 17 00:00:00 2001 From: EstrellaXD Date: Sat, 30 Jul 2022 16:28:04 +0800 Subject: [PATCH] =?UTF-8?q?2.5.22=20-=20=E4=BF=AE=E5=A4=8D=20normal=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=B8=8D=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/renamer.py | 3 ++- src/parser/analyser/raw_parser.py | 4 ++-- src/parser/analyser/rename_parser.py | 4 +--- src/parser/title_parser.py | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/core/renamer.py b/src/core/renamer.py index 8f38d0b1..e00f1783 100644 --- a/src/core/renamer.py +++ b/src/core/renamer.py @@ -42,7 +42,7 @@ class Renamer: else: season = 1 except Exception as e: - logger.warning(e) + logger.debug(e) logger.debug("No Season info") season = 1 folder_name = path_parts[1] if path_parts[0] == "/" else path_parts[0] @@ -68,6 +68,7 @@ class Renamer: continue except Exception as e: logger.warning(f"{path_name} rename failed") + logger.warning(f"Folder name: {folder_name}, Season: {season}, Suffix: {suffix}") logger.debug(e) if settings.remove_bad_torrent: self.client.delete_torrent(torrent_hash) diff --git a/src/parser/analyser/raw_parser.py b/src/parser/analyser/raw_parser.py index e1d5188d..13d88889 100644 --- a/src/parser/analyser/raw_parser.py +++ b/src/parser/analyser/raw_parser.py @@ -162,6 +162,6 @@ class RawParser: if __name__ == "__main__": test = RawParser() - test_txt = "[SWSUB][7月新番][Love Live! 红小学员][无修正][001][GB_JP][AVC][1080P][网盘][无修正] [331.6MB] [复制磁连]" + test_txt = "[梦蓝字幕组]New Doraemon 哆啦A梦新番[716][2022.07.23][AVC][10080P][GB_JP]" ep = test.analyse(test_txt) - print(f"en:{ep.title_en}, zh:{ep.title_zh}, jp:{ep.title_jp}") + print(f"en:{ep.title_en}, zh:{ep.title_zh}, jp:{ep.title_jp}, group:{ep.group}") diff --git a/src/parser/analyser/rename_parser.py b/src/parser/analyser/rename_parser.py index 9fdc5d79..b511f031 100644 --- a/src/parser/analyser/rename_parser.py +++ b/src/parser/analyser/rename_parser.py @@ -92,13 +92,11 @@ class DownloadParser: "no_season_pn": self.rename_no_season_pn, "none": self.rename_none } - logger.debug(f"Raw name: {name}, rename method: {method}") - logger.debug(f"Folder Name: {folder_name}, File type: {suffix}, Season {season}") return method_dict[method.lower()](rename_info) if __name__ == "__main__": - name = "[Nekomoe kissaten][Isekai Ojisan][01][1080p][JPSC][v2].mp4" + name = "[Lilith-Raws] Tate no Yuusha no Nariagari S02 - 02 [Baha][WEB-DL][1080p][AVC AAC][CHT][MP4]" rename = DownloadParser() new_name = rename.download_rename(name, "异世界舅舅(2022)", 1, ".mp4", "normal") print(new_name) diff --git a/src/parser/title_parser.py b/src/parser/title_parser.py index ad83d72a..32d2aad6 100644 --- a/src/parser/title_parser.py +++ b/src/parser/title_parser.py @@ -68,7 +68,7 @@ if __name__ == '__main__': from conf.const_dev import DEV_SETTINGS settings.init(DEV_SETTINGS) T = TitleParser() - raw = "[Lilith-Raws] 在地下城寻求邂逅是否搞错了什么/Danmachi S4[01][Baha][WEB-DL][1080p][AVC AAC][CHT][MP4]" + raw = "[梦蓝字幕组]New Doraemon 哆啦A梦新番[716][2022.07.23][AVC][10080P][GB_JP]" season = int(re.search(r"\d{1,2}", "S02").group()) _dict = T.return_dict(raw) print(_dict)