From 301f979e07de872cf45ef5b663a3d8cc93e49438 Mon Sep 17 00:00:00 2001 From: nilaoda Date: Wed, 6 Jul 2022 16:12:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96IV=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs b/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs index 64130f0..7a60393 100644 --- a/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs +++ b/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs @@ -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; }