From 21eb7925684615f6e03e3459761ed15ecd024d42 Mon Sep 17 00:00:00 2001 From: Feng4 Date: Sun, 27 Dec 2020 12:41:58 +0800 Subject: [PATCH 1/3] Update core.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【增加】 增加一个新模式:不改变原有路径,只刮削文件 --- core.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/core.py b/core.py index 13a6673..de1b843 100755 --- a/core.py +++ b/core.py @@ -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) From ad133fb06414bdcfbec516e656480104a7ae625f Mon Sep 17 00:00:00 2001 From: Feng4 Date: Sun, 27 Dec 2020 14:34:16 +0800 Subject: [PATCH 2/3] Update core.py --- core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core.py b/core.py index de1b843..5bb977e 100755 --- a/core.py +++ b/core.py @@ -554,13 +554,15 @@ def core_main(file_path, number_th, conf: config.Config): debug_print(json_data) # 创建文件夹 - path = create_folder(rootpath + '/' + conf.success_folder(), json_data.get('location_rule'), json_data, conf) + #path = create_folder(rootpath + '/' + conf.success_folder(), json_data.get('location_rule'), json_data, conf) # main_mode # 1: 刮削模式 / Scraping mode # 2: 整理模式 / Organizing mode # 3:不改变路径刮削 if conf.main_mode() == 1: + # 创建文件夹 + path = create_folder(rootpath + '/' + conf.success_folder(), json_data.get('location_rule'), json_data, conf) if multi_part == 1: number += part # 这时number会被附加上CD1后缀 From cbb2b2a0cac16fa84e839b5c856c893bda1ca843 Mon Sep 17 00:00:00 2001 From: Feng4 Date: Sun, 27 Dec 2020 15:16:37 +0800 Subject: [PATCH 3/3] Update core.py --- core.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core.py b/core.py index 5bb977e..e1de279 100755 --- a/core.py +++ b/core.py @@ -522,7 +522,8 @@ def core_main(file_path, number_th, conf: config.Config): filepath = file_path # 影片的路径 绝对路径 - rootpath = str(pathlib.Path(filepath).parent) + # 下面被注释的变量不需要 + #rootpath= os.getcwd number = number_th json_data = get_data_from_json(number, filepath, conf) # 定义番号 @@ -562,7 +563,7 @@ def core_main(file_path, number_th, conf: config.Config): # 3:不改变路径刮削 if conf.main_mode() == 1: # 创建文件夹 - path = create_folder(rootpath + '/' + conf.success_folder(), json_data.get('location_rule'), json_data, conf) + path = create_folder(conf.success_folder(), json_data.get('location_rule'), json_data, conf) if multi_part == 1: number += part # 这时number会被附加上CD1后缀 @@ -583,7 +584,7 @@ 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) + path = create_folder(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'