From fc838f7e5f908c416d57fc1a3c56f09f672ffd23 Mon Sep 17 00:00:00 2001 From: Plachta Date: Sun, 19 Feb 2023 22:25:37 +0800 Subject: [PATCH] upload files --- voice_upload.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/voice_upload.py b/voice_upload.py index d237fa1..8de1fb2 100644 --- a/voice_upload.py +++ b/voice_upload.py @@ -8,4 +8,7 @@ if not os.path.exists(upload_path): os.mkdir(upload_path) for filename in uploaded.keys(): #将上传的文件移动到指定的位置上 - shutil.move(os.path.join(basepath, filename), os.path.join(upload_path, "custom_character_voice.zip")) + if filename.endswith(".zip"): + shutil.move(os.path.join(basepath, filename), os.path.join(upload_path, "custom_character_voice.zip")) + elif filename.endswith(".rar"): + shutil.move(os.path.join(basepath, filename), os.path.join(upload_path, "custom_character_voice.rar")) \ No newline at end of file