Update core.py

【增加】
增加一个新模式:不改变原有路径,只刮削文件
This commit is contained in:
Feng4
2020-12-27 12:41:58 +08:00
committed by GitHub
parent 4c31eee978
commit 21eb792568

40
core.py
View File

@@ -559,6 +559,7 @@ def core_main(file_path, number_th, conf: config.Config):
# main_mode
# 1: 刮削模式 / Scraping mode
# 2: 整理模式 / Organizing mode
# 3不改变路径刮削
if conf.main_mode() == 1:
if multi_part == 1:
number += part # 这时number会被附加上CD1后缀
@@ -579,5 +580,44 @@ def core_main(file_path, number_th, conf: config.Config):
# 移动文件
paste_file_to_folder(filepath, path, number, c_word, conf)
elif conf.main_mode() == 2:
# 创建文件夹
path = create_folder(rootpath + '/' + conf.success_folder(), json_data.get('location_rule'), json_data, conf)
# 移动文件
paste_file_to_folder_mode2(filepath, path, multi_part, number, part, c_word, conf)
poster_path = path + '/' + number + c_word + '-poster.jpg'
thumb_path = path + '/' + number + c_word + '-thumb.jpg'
if conf.is_watermark():
add_mark(poster_path, thumb_path, cn_sub, leak, uncensored, conf)
elif conf.main_mode() == 3:
path = file_path.rsplit('/', 1)[0]
path = file_path.rsplit('\\', 1)[0]
if multi_part == 1:
number += part # 这时number会被附加上CD1后缀
# 检查小封面, 如果image cut为3则下载小封面
if imagecut == 3:
small_cover_check(path, number, json_data.get('cover_small'), c_word, conf, filepath, conf.failed_folder())
# creatFolder会返回番号路径
image_download(json_data.get('cover'), number, c_word, path, conf, filepath, conf.failed_folder())
# 下载预告片
if json_data.get('trailer'):
trailer_download(json_data.get('trailer'), c_word, number, path, filepath, conf, conf.failed_folder())
# 下载剧照 data, path, conf: config.Config, filepath, failed_folder
if json_data.get('extrafanart'):
extrafanart_download(json_data.get('extrafanart'), path, conf, filepath, conf.failed_folder())
# 裁剪图
cutImage(imagecut, path, number, c_word)
# 打印文件
print_files(path, c_word, json_data.get('naming_rule'), part, cn_sub, json_data, filepath, conf.failed_folder(),
tag, json_data.get('actor_list'), liuchu)
poster_path = path + '/' + number + c_word + '-poster.jpg'
thumb_path = path + '/' + number + c_word + '-thumb.jpg'
if conf.is_watermark():
add_mark(poster_path, thumb_path, cn_sub, leak, uncensored, conf)