From fc42888f5a163f4a5484291fa88fa78f6ad568eb Mon Sep 17 00:00:00 2001 From: ymm Date: Wed, 19 Feb 2025 21:36:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A4=E6=96=AD=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/__init__.py b/__init__.py index d9148b2..e9e5ef6 100644 --- a/__init__.py +++ b/__init__.py @@ -373,6 +373,9 @@ class VodToLocalNode: # 生成一个临时目录路径名并创建该目录 self.create_directory(os.path.join(os.path.dirname(os.path.abspath(__file__)), "download", f"{sub_app_id}")) output_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "download", f"{sub_app_id}", f"{file_id}.mp4" ) + # 判断文件是否存在 + if os.path.exists(output_dir): + return output_dir return self._download_file(url=media_url, save_path=output_dir, timeout=60 * 10) def _download_file(self, url: str, save_path: str, timeout: int=30):