修正排序问题

This commit is contained in:
nilaoda 2022-11-29 15:54:40 +08:00
parent b3cf21df5d
commit a5c7522766
3 changed files with 5 additions and 0 deletions

View File

@ -230,6 +230,7 @@ namespace N_m3u8DL_RE.Parser.Extractor
var initUrl = ParserUtil.CombineURL(segBaseUrl, initialization.Attribute("sourceURL")?.Value!); var initUrl = ParserUtil.CombineURL(segBaseUrl, initialization.Attribute("sourceURL")?.Value!);
var initRange = initialization.Attribute("range")?.Value; var initRange = initialization.Attribute("range")?.Value;
streamSpec.Playlist.MediaInit = new MediaSegment(); streamSpec.Playlist.MediaInit = new MediaSegment();
streamSpec.Playlist.MediaInit.Index = -1; //便于排序
streamSpec.Playlist.MediaInit.Url = initUrl; streamSpec.Playlist.MediaInit.Url = initUrl;
if (initRange != null) if (initRange != null)
{ {
@ -253,6 +254,7 @@ namespace N_m3u8DL_RE.Parser.Extractor
var initUrl = ParserUtil.CombineURL(segBaseUrl, initialization.Attribute("sourceURL")?.Value!); var initUrl = ParserUtil.CombineURL(segBaseUrl, initialization.Attribute("sourceURL")?.Value!);
var initRange = initialization.Attribute("range")?.Value; var initRange = initialization.Attribute("range")?.Value;
streamSpec.Playlist.MediaInit = new MediaSegment(); streamSpec.Playlist.MediaInit = new MediaSegment();
streamSpec.Playlist.MediaInit.Index = -1; //便于排序
streamSpec.Playlist.MediaInit.Url = initUrl; streamSpec.Playlist.MediaInit.Url = initUrl;
if (initRange != null) if (initRange != null)
{ {
@ -312,6 +314,7 @@ namespace N_m3u8DL_RE.Parser.Extractor
{ {
var initUrl = ParserUtil.ReplaceVars(ParserUtil.CombineURL(segBaseUrl, initialization), varDic); var initUrl = ParserUtil.ReplaceVars(ParserUtil.CombineURL(segBaseUrl, initialization), varDic);
streamSpec.Playlist.MediaInit = new MediaSegment(); streamSpec.Playlist.MediaInit = new MediaSegment();
streamSpec.Playlist.MediaInit.Index = -1; //便于排序
streamSpec.Playlist.MediaInit.Url = initUrl; streamSpec.Playlist.MediaInit.Url = initUrl;
} }
//处理分片 //处理分片

View File

@ -372,6 +372,7 @@ namespace N_m3u8DL_RE.Parser.Extractor
playlist.MediaInit = new MediaSegment() playlist.MediaInit = new MediaSegment()
{ {
Url = PreProcessUrl(ParserUtil.CombineURL(BaseUrl, ParserUtil.GetAttribute(line, "URI"))), Url = PreProcessUrl(ParserUtil.CombineURL(BaseUrl, ParserUtil.GetAttribute(line, "URI"))),
Index = -1, //便于排序
}; };
if (line.Contains("BYTERANGE")) if (line.Contains("BYTERANGE"))
{ {

View File

@ -148,6 +148,7 @@ namespace N_m3u8DL_RE.Parser.Extractor
streamSpec.Playlist.MediaInit = new MediaSegment(); streamSpec.Playlist.MediaInit = new MediaSegment();
if (!string.IsNullOrEmpty(codecPrivateData)) if (!string.IsNullOrEmpty(codecPrivateData))
{ {
streamSpec.Playlist.MediaInit.Index = -1; //便于排序
streamSpec.Playlist.MediaInit.Url = $"hex://{codecPrivateData}"; streamSpec.Playlist.MediaInit.Url = $"hex://{codecPrivateData}";
} }