优化key逻辑

This commit is contained in:
nilaoda 2022-09-21 17:50:29 +08:00
parent af1b82536e
commit 3a2c7ab872
1 changed files with 5 additions and 6 deletions

View File

@ -236,13 +236,12 @@ namespace N_m3u8DL_RE.Parser.Extractor
//当前的加密信息 //当前的加密信息
EncryptInfo currentEncryptInfo = new(); EncryptInfo currentEncryptInfo = new();
if (ParserConfig.CustomeKey != null) if (ParserConfig.CustomMethod != null)
{ currentEncryptInfo.Method = ParserConfig.CustomMethod.Value;
currentEncryptInfo.Method = ParserConfig.CustomMethod ?? EncryptMethod.AES_128; if (ParserConfig.CustomeKey != null && ParserConfig.CustomeKey.Length > 0)
currentEncryptInfo.Key = ParserConfig.CustomeKey; currentEncryptInfo.Key = ParserConfig.CustomeKey;
if (ParserConfig.CustomeIV != null) if (ParserConfig.CustomeIV != null && ParserConfig.CustomeIV.Length > 0)
currentEncryptInfo.IV = ParserConfig.CustomeIV; currentEncryptInfo.IV = ParserConfig.CustomeIV;
}
//上次读取到的加密行,#EXT-X-KEY:…… //上次读取到的加密行,#EXT-X-KEY:……
string lastKeyLine = ""; string lastKeyLine = "";