diff --git a/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs b/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs index 3cee7f0..dad5a0c 100644 --- a/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs +++ b/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs @@ -433,7 +433,7 @@ namespace N_m3u8DL_RE.CommandLine Environment.Exit(0); } - var rootCommand = new RootCommand("N_m3u8DL-RE (Beta version) 20221017") + var rootCommand = new RootCommand("N_m3u8DL-RE (Beta version) 20221023") { Input, TmpDir, SaveDir, SaveName, BaseUrl, ThreadCount, DownloadRetryCount, AutoSelect, SkipMerge, SkipDownload, CheckSegmentsCount, BinaryMerge, DelAfterDone, WriteMetaJson, AppendUrlParams, ConcurrentDownload, Headers, /**SavePattern,**/ SubOnly, SubtitleFormat, AutoSubtitleFix, diff --git a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs index 8ff7360..c6bee1f 100644 --- a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs +++ b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs @@ -129,11 +129,28 @@ namespace N_m3u8DL_RE.DownloadManager if (mediainfos.All(m => m.Type == "Audio")) { + var lastKey = streamSpec.ToShortString(); streamSpec.MediaType = MediaType.AUDIO; + var newKey = streamSpec.ToShortString(); + + //需要同步修改Dictionary中的Key + if (LastFileNameDic.Remove(lastKey, out var lastValue1)) + LastFileNameDic[newKey] = lastValue1!; + if (DateTimeDic.Remove(lastKey, out var lastValue2)) + DateTimeDic[newKey] = lastValue2; } else if (mediainfos.All(m => m.Type == "Subtitle")) { + var lastKey = streamSpec.ToShortString(); streamSpec.MediaType = MediaType.SUBTITLES; + var newKey = streamSpec.ToShortString(); + + //需要同步修改Dictionary中的Key + if (LastFileNameDic.Remove(lastKey, out var lastValue1)) + LastFileNameDic[newKey] = lastValue1!; + if (DateTimeDic.Remove(lastKey, out var lastValue2)) + DateTimeDic[newKey] = lastValue2; + if (streamSpec.Extension == null || streamSpec.Extension == "ts") streamSpec.Extension = "vtt"; }