From f4e8b3f908d8b85cd0c0093eec396a610f1edc05 Mon Sep 17 00:00:00 2001 From: nilaoda Date: Wed, 27 Jul 2022 01:46:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E7=9B=AE=E6=A0=87=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E6=97=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=90=8E?= =?UTF-8?q?=E7=BC=80=E8=80=8C=E4=B8=8D=E6=98=AF=E7=9B=B4=E6=8E=A5=E8=A6=86?= =?UTF-8?q?=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs b/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs index f4f7381..d58bb54 100644 --- a/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs +++ b/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs @@ -52,6 +52,11 @@ namespace N_m3u8DL_RE.DownloadManager dirName = ConvertUtil.GetValidFileName(dirName, filterSlash: true); var headers = DownloaderConfig.Headers; var output = Path.Combine(saveDir, saveName + $".{streamSpec.Extension ?? "ts"}"); + //检测目标文件是否存在 + while (File.Exists(output)) + { + Logger.WarnMarkUp($"{output} => {output = Path.ChangeExtension(output, $"copy" + Path.GetExtension(output))}"); + } //mp4decrypt var mp4decrypt = DownloaderConfig.DecryptionBinaryPath!;