优化dash刷新逻辑

This commit is contained in:
nilaoda 2022-10-31 23:23:11 +08:00
parent 80ce8d24fc
commit c88ea9803f
1 changed files with 5 additions and 0 deletions

View File

@ -487,7 +487,12 @@ namespace N_m3u8DL_RE.Parser.Extractor
var newStreams = await ExtractStreamsAsync(rawText);
foreach (var streamSpec in streamSpecs)
{
//有的网站每次请求MPD返回的码率不一致导致ToShortString()无法匹配 无法更新playlist
//故增加通过init url来匹配 (如果有的话)
var match = newStreams.Where(n => n.ToShortString() == streamSpec.ToShortString());
if (!match.Any())
match = newStreams.Where(n => n.Playlist?.MediaInit?.Url == streamSpec.Playlist?.MediaInit?.Url);
if (match.Any())
streamSpec.Playlist!.MediaParts = match.First().Playlist!.MediaParts; //不更新init
}