应当为`EXT-X-MAP`设置`EncryptInfo`

相关信息:https://github.com/nilaoda/N_m3u8DL-CLI/issues/744
This commit is contained in:
nilaoda 2022-10-29 16:33:41 +08:00
parent ea00099055
commit 3d23093b3a
1 changed files with 7 additions and 0 deletions

View File

@ -380,6 +380,13 @@ namespace N_m3u8DL_RE.Parser.Extractor
playlist.MediaInit.ExpectLength = n;
playlist.MediaInit.StartRange = o ?? 0L;
}
//是否有加密有的话写入KEY和IV
if (currentEncryptInfo.Method != EncryptMethod.NONE)
{
playlist.MediaInit.EncryptInfo.Method = currentEncryptInfo.Method;
playlist.MediaInit.EncryptInfo.Key = currentEncryptInfo.Key;
playlist.MediaInit.EncryptInfo.IV = currentEncryptInfo.IV ?? HexUtil.HexToBytes(Convert.ToString(segIndex, 16).PadLeft(32, '0'));
}
}
//遇到了其他的map说明已经不是一个视频了全部丢弃即可
else