From 3a2c7ab872bbfc2e93698c1335b24431a5c20ea5 Mon Sep 17 00:00:00 2001 From: nilaoda Date: Wed, 21 Sep 2022 17:50:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96key=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs b/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs index 95eae91..a075fe4 100644 --- a/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs +++ b/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs @@ -236,13 +236,12 @@ namespace N_m3u8DL_RE.Parser.Extractor //当前的加密信息 EncryptInfo currentEncryptInfo = new(); - if (ParserConfig.CustomeKey != null) - { - currentEncryptInfo.Method = ParserConfig.CustomMethod ?? EncryptMethod.AES_128; + if (ParserConfig.CustomMethod != null) + currentEncryptInfo.Method = ParserConfig.CustomMethod.Value; + if (ParserConfig.CustomeKey != null && ParserConfig.CustomeKey.Length > 0) currentEncryptInfo.Key = ParserConfig.CustomeKey; - if (ParserConfig.CustomeIV != null) - currentEncryptInfo.IV = ParserConfig.CustomeIV; - } + if (ParserConfig.CustomeIV != null && ParserConfig.CustomeIV.Length > 0) + currentEncryptInfo.IV = ParserConfig.CustomeIV; //上次读取到的加密行,#EXT-X-KEY:…… string lastKeyLine = "";