From 03edab6a6cd2c462aef8e9d36a9e206852b32341 Mon Sep 17 00:00:00 2001 From: f18326186224 Date: Fri, 24 May 2024 16:06:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E7=A0=B4=E8=A7=A3ncm=E6=9C=89?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E7=9B=B4=E6=8E=A5=E7=94=9F=E6=88=90mp3?= =?UTF-8?q?=E6=96=87=E4=BB=B6=20=E8=BF=99=E7=A7=8D=E6=83=85=E5=86=B5?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E7=9B=B4=E6=8E=A5=E6=94=BE=E5=85=A5dist?= =?UTF-8?q?=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mk/__main__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mk/__main__.py b/mk/__main__.py index e0a3873..e2fd80b 100644 --- a/mk/__main__.py +++ b/mk/__main__.py @@ -266,7 +266,12 @@ def handle_unblock_music(unhandled_audio_paths,parent_dir,dist_path): subprocess.run(um_command, shell=True) # 删除原文件 os.unlink(path) - flac2alac(os.path.join(temp_path,audio_name.rsplit('.',1)[0]+'.flac'),dist_path) + # 判断生成的是什么格式的文件 + if os.path.exists(os.path.join(temp_path,audio_name.rsplit('.',1)[0]+'.flac')): + # 生成的是flac文件 + flac2alac(os.path.join(temp_path,audio_name.rsplit('.',1)[0]+'.flac'),dist_path) + elif os.path.exists(os.path.join(temp_path,audio_name.rsplit('.',1)[0]+'.mp3')): + shutil.move(os.path.join(temp_path,audio_name.rsplit('.',1)[0]+'.mp3'),os.path.join(dist_path,audio_name.rsplit('.',1)[0]+'.mp3')) except subprocess.CalledProcessError as e: print(e) elif audio_name.endswith('flac'):