优化未识别到分片的场景

This commit is contained in:
nilaoda 2022-07-10 12:41:33 +08:00
parent f799a8ba89
commit 4b11a163c3
1 changed files with 14 additions and 0 deletions

View File

@ -348,6 +348,20 @@ namespace N_m3u8DL_RE.Parser.Extractor
} }
} }
//如果依旧没被添加分片直接把BaseUrl塞进去就好
if (streamSpec.Playlist.MediaParts[0].MediaSegments.Count == 0)
{
streamSpec.Playlist.MediaParts[0].MediaSegments.Add
(
new MediaSegment()
{
Index = 0,
Url = PreProcessUrl(segBaseUrl),
Duration = XmlConvert.ToTimeSpan(periodDuration ?? mediaPresentationDuration ?? "PT0S").TotalSeconds
}
);
}
//判断加密情况 //判断加密情况
if (adaptationSet.Elements().Any(e => e.Name.LocalName == "ContentProtection")) if (adaptationSet.Elements().Any(e => e.Name.LocalName == "ContentProtection"))
{ {