diff --git a/src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs b/src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs index 38cde3ec..81a52adf 100644 --- a/src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs +++ b/src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs @@ -230,6 +230,7 @@ public async Task> ExtractStreamsAsync(string rawText) var initUrl = ParserUtil.CombineURL(segBaseUrl, initialization.Attribute("sourceURL")?.Value!); var initRange = initialization.Attribute("range")?.Value; streamSpec.Playlist.MediaInit = new MediaSegment(); + streamSpec.Playlist.MediaInit.Index = -1; //便于排序 streamSpec.Playlist.MediaInit.Url = initUrl; if (initRange != null) { @@ -253,6 +254,7 @@ public async Task> ExtractStreamsAsync(string rawText) var initUrl = ParserUtil.CombineURL(segBaseUrl, initialization.Attribute("sourceURL")?.Value!); var initRange = initialization.Attribute("range")?.Value; streamSpec.Playlist.MediaInit = new MediaSegment(); + streamSpec.Playlist.MediaInit.Index = -1; //便于排序 streamSpec.Playlist.MediaInit.Url = initUrl; if (initRange != null) { @@ -312,6 +314,7 @@ public async Task> ExtractStreamsAsync(string rawText) { var initUrl = ParserUtil.ReplaceVars(ParserUtil.CombineURL(segBaseUrl, initialization), varDic); streamSpec.Playlist.MediaInit = new MediaSegment(); + streamSpec.Playlist.MediaInit.Index = -1; //便于排序 streamSpec.Playlist.MediaInit.Url = initUrl; } //处理分片 diff --git a/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs b/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs index b33e1d04..46429e81 100644 --- a/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs +++ b/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs @@ -372,6 +372,7 @@ private async Task ParseListAsync() playlist.MediaInit = new MediaSegment() { Url = PreProcessUrl(ParserUtil.CombineURL(BaseUrl, ParserUtil.GetAttribute(line, "URI"))), + Index = -1, //便于排序 }; if (line.Contains("BYTERANGE")) { diff --git a/src/N_m3u8DL-RE.Parser/Extractor/MSSExtractor.cs b/src/N_m3u8DL-RE.Parser/Extractor/MSSExtractor.cs index 692dfa54..e6639a83 100644 --- a/src/N_m3u8DL-RE.Parser/Extractor/MSSExtractor.cs +++ b/src/N_m3u8DL-RE.Parser/Extractor/MSSExtractor.cs @@ -148,6 +148,7 @@ public async Task> ExtractStreamsAsync(string rawText) streamSpec.Playlist.MediaInit = new MediaSegment(); if (!string.IsNullOrEmpty(codecPrivateData)) { + streamSpec.Playlist.MediaInit.Index = -1; //便于排序 streamSpec.Playlist.MediaInit.Url = $"hex://{codecPrivateData}"; }