优化Init文件加密判断 (#562)

兼容了非标准的m3u8, 详情请看issue #550
This commit is contained in:
nilaoda 2024-12-16 23:07:43 +08:00
parent ea9de55eac
commit f47a0722cf
3 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ namespace N_m3u8DL_RE.CommandLine;
internal static partial class CommandInvoker
{
public const string VERSION_INFO = "N_m3u8DL-RE (Beta version) 20241203";
public const string VERSION_INFO = "N_m3u8DL-RE (Beta version) 20241216";
[GeneratedRegex("((best|worst)\\d*|all)")]
private static partial Regex ForStrRegex();

View File

@ -177,7 +177,7 @@ internal class SimpleDownloadManager
// 从文件读取KEY
await SearchKeyAsync(currentKID);
// 实时解密
if (streamSpec.Playlist.MediaInit.IsEncrypted && DownloaderConfig.MyOptions.MP4RealTimeDecryption && !string.IsNullOrEmpty(currentKID) && StreamExtractor.ExtractorType != ExtractorType.MSS)
if ((streamSpec.Playlist.MediaInit.IsEncrypted || !string.IsNullOrEmpty(currentKID)) && DownloaderConfig.MyOptions.MP4RealTimeDecryption && !string.IsNullOrEmpty(currentKID) && StreamExtractor.ExtractorType != ExtractorType.MSS)
{
var enc = result.ActualFilePath;
var dec = Path.Combine(Path.GetDirectoryName(enc)!, Path.GetFileNameWithoutExtension(enc) + "_dec" + Path.GetExtension(enc));

View File

@ -211,7 +211,7 @@ internal class SimpleLiveRecordManager2
// 从文件读取KEY
await SearchKeyAsync(currentKID);
// 实时解密
if (streamSpec.Playlist.MediaInit.IsEncrypted && DownloaderConfig.MyOptions.MP4RealTimeDecryption && !string.IsNullOrEmpty(currentKID) && StreamExtractor.ExtractorType != ExtractorType.MSS)
if ((streamSpec.Playlist.MediaInit.IsEncrypted || !string.IsNullOrEmpty(currentKID)) && DownloaderConfig.MyOptions.MP4RealTimeDecryption && !string.IsNullOrEmpty(currentKID) && StreamExtractor.ExtractorType != ExtractorType.MSS)
{
var enc = result.ActualFilePath;
var dec = Path.Combine(Path.GetDirectoryName(enc)!, Path.GetFileNameWithoutExtension(enc) + "_dec" + Path.GetExtension(enc));