- 修复 normal 方法不生效的问题
This commit is contained in:
EstrellaXD
2022-07-30 16:28:04 +08:00
parent 55399dbe7d
commit 102afe58cf
4 changed files with 6 additions and 7 deletions

View File

@@ -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)

View File

@@ -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}")

View File

@@ -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)

View File

@@ -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)