diff --git a/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs b/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs index e07fc1f8..52434ca6 100644 --- a/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs +++ b/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs @@ -570,7 +570,9 @@ await Parallel.ForEachAsync(segments, options, async (seg, _) => { File.Delete(file); } - OtherUtil.SafeDeleteDir(tmpDir); + OtherUtil.SafeDeleteDir(tmpDir); + // Logger.Info("Don't Delete {} SimpleDownloadManager.cs Line574",tmpDir); + } //重新读取init信息 @@ -686,7 +688,8 @@ await Parallel.ForEachAsync(dic, async (kp, _) => var file = Path.Combine(DownloaderConfig.DirPrefix, item.Key); if (File.Exists(file)) File.Delete(file); } - OtherUtil.SafeDeleteDir(DownloaderConfig.DirPrefix); + // OtherUtil.SafeDeleteDir(DownloaderConfig.ActualTmpDir); + Logger.Info("Don't Delete {} SimpleDownloadManager.cs Line692",DownloaderConfig.DirPrefix); } //混流 @@ -720,7 +723,9 @@ await Parallel.ForEachAsync(dic, async (kp, _) => Logger.WarnMarkUp("[grey]Cleaning files...[/]"); OutputFiles.ForEach(f => File.Delete(f.FilePath)); var tmpDir = DownloaderConfig.MyOptions.TmpDir ?? Environment.CurrentDirectory; - OtherUtil.SafeDeleteDir(tmpDir); + // OtherUtil.SafeDeleteDir(tmpDir); + Logger.Info("Don't Delete {} SimpleDownloadManager.cs Line727",tmpDir); + } } else diff --git a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs index ca86ab39..1a25e961 100644 --- a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs +++ b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs @@ -167,6 +167,7 @@ private async Task RecordStreamAsync(StreamSpec streamSpec, ProgressTask t var type = streamSpec.MediaType ?? Common.Enum.MediaType.VIDEO; var dirName = $"{task.Id}_{OtherUtil.GetValidFileName(streamSpec.GroupId ?? "", "-")}_{streamSpec.Codecs}_{streamSpec.Bandwidth}_{streamSpec.Language}"; var tmpDir = Path.Combine(DownloaderConfig.DirPrefix, dirName); + // DownloaderConfig.ActualTmpDir = tmpDir; var saveDir = DownloaderConfig.MyOptions.SaveDir ?? Environment.CurrentDirectory; var saveName = DownloaderConfig.MyOptions.SaveName != null ? $"{DownloaderConfig.MyOptions.SaveName}.{streamSpec.Language}".TrimEnd('.') : dirName; var headers = DownloaderConfig.Headers; @@ -877,7 +878,8 @@ await Parallel.ForEachAsync(dic, options, async (kp, _) => var file = Path.Combine(DownloaderConfig.DirPrefix, item.Key); if (File.Exists(file)) File.Delete(file); } - OtherUtil.SafeDeleteDir(DownloaderConfig.DirPrefix); + // OtherUtil.SafeDeleteDir(DownloaderConfig.DirPrefix); + Logger.Info("Don't Delete {} SimpleLoveRecorderManager2.cs Line878",DownloaderConfig.DirPrefix); } //混流 @@ -911,7 +913,8 @@ await Parallel.ForEachAsync(dic, options, async (kp, _) => Logger.WarnMarkUp("[grey]Cleaning files...[/]"); OutputFiles.ForEach(f => File.Delete(f.FilePath)); var tmpDir = DownloaderConfig.MyOptions.TmpDir ?? Environment.CurrentDirectory; - OtherUtil.SafeDeleteDir(tmpDir); + // OtherUtil.SafeDeleteDir(tmpDir); + Logger.Info("Don't Delete {} SimpleLoveRecorderManager2.cs Line913",tmpDir); } } else