优化IV获取

This commit is contained in:
nilaoda 2022-07-06 16:12:34 +08:00
parent eb0a1d12dd
commit 301f979e07
1 changed files with 5 additions and 3 deletions

View File

@ -297,10 +297,12 @@ namespace N_m3u8DL_RE.Parser.Extractor
//解析KEY
else if (line.StartsWith(HLSTags.ext_x_key))
{
//自定义KEY情况 不读取当前行的KEY信息 但是没自定义当前行有IV的话 就用
if (ParserConfig.CustomeKey != null && ParserConfig.CustomeIV == null && line.Contains("IV=0x"))
//自定义KEY情况 不读取当前行的KEY信息.
//对于IV没自定义且当前行有IV的话 就用
if (ParserConfig.CustomeKey != null)
{
currentEncryptInfo.IV = HexUtil.HexToBytes(ParserUtil.GetAttribute(line, "IV"));
if (ParserConfig.CustomeIV == null && line.Contains("IV=0x"))
currentEncryptInfo.IV = HexUtil.HexToBytes(ParserUtil.GetAttribute(line, "IV"));
continue;
}