From de7b982783c44fda9d46a5a9f9c0aa0666cce851 Mon Sep 17 00:00:00 2001 From: lededev Date: Sat, 26 Mar 2022 12:44:03 +0800 Subject: [PATCH] core.py:Copy subtitle files in link mode --- core.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core.py b/core.py index a54968f..0292c90 100644 --- a/core.py +++ b/core.py @@ -503,8 +503,12 @@ def paste_file_to_folder(filepath, path, number, leak_word, c_word, hack_word): sub_filepath = sub_filepath.replace(subname, ".cht" + subname) subname = ".cht" + subname if os.path.isfile(sub_filepath): - shutil.move(sub_filepath, os.path.join(path, f"{number}{leak_word}{c_word}{hack_word}{subname}")) - print('[+]Sub moved!') + if link_mode not in (1, 2): + shutil.move(sub_filepath, os.path.join(path, f"{number}{leak_word}{c_word}{hack_word}{subname}")) + print('[+]Sub moved!') + else: + shutil.copyfile(sub_filepath, os.path.join(path, f"{number}{leak_word}{c_word}{hack_word}{subname}")) + print('[+]Sub Copied!') return True except FileExistsError as fee: