From 3d23093b3a7cbfd3d4e1d199d1a12215c090fc08 Mon Sep 17 00:00:00 2001 From: nilaoda Date: Sat, 29 Oct 2022 16:33:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E5=BD=93=E4=B8=BA`EXT-X-MAP`=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE`EncryptInfo`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 相关信息:https://github.com/nilaoda/N_m3u8DL-CLI/issues/744 --- src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs b/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs index f21f46d..014da4e 100644 --- a/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs +++ b/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs @@ -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