修正实时解密无法合并的问题

This commit is contained in:
nilaoda 2022-07-24 20:32:44 +08:00
parent d6bbde3ca4
commit 586ac0d36c
1 changed files with 7 additions and 7 deletions

View File

@ -54,7 +54,6 @@ namespace N_m3u8DL_RE.DownloadManager
//mp4decrypt //mp4decrypt
var mp4decrypt = DownloaderConfig.DecryptionBinaryPath!; var mp4decrypt = DownloaderConfig.DecryptionBinaryPath!;
var mp4InitFile = ""; var mp4InitFile = "";
var mp4InitFileDec = "";
var currentKID = ""; var currentKID = "";
Logger.Debug($"dirName: {dirName}; tmpDir: {tmpDir}; saveDir: {saveDir}; saveName: {saveName}; output: {output}"); Logger.Debug($"dirName: {dirName}; tmpDir: {tmpDir}; saveDir: {saveDir}; saveName: {saveName}; output: {output}");
@ -112,9 +111,7 @@ namespace N_m3u8DL_RE.DownloadManager
var dResult = await MP4DecryptUtil.DecryptAsync(DownloaderConfig.UseShakaPackager, mp4decrypt, DownloaderConfig.Keys, enc, dec, currentKID); var dResult = await MP4DecryptUtil.DecryptAsync(DownloaderConfig.UseShakaPackager, mp4decrypt, DownloaderConfig.Keys, enc, dec, currentKID);
if (dResult) if (dResult)
{ {
//实时解密不需要init文件用于合并 FileDic[streamSpec.Playlist.MediaInit]!.ActualFilePath = dec;
FileDic!.Remove(streamSpec.Playlist.MediaInit, out _);
mp4InitFileDec = dec;
} }
} }
} }
@ -147,11 +144,14 @@ namespace N_m3u8DL_RE.DownloadManager
} }
}); });
if (DownloaderConfig.MP4RealTimeDecryption && mp4InitFile != "") if (DownloaderConfig.MP4RealTimeDecryption && mp4InitFile != "")
{ {
File.Delete(mp4InitFile); File.Delete(mp4InitFile);
if (mp4InitFileDec != "") //shaka实时解密不需要init文件用于合并
File.Delete(mp4InitFileDec); if (DownloaderConfig.UseShakaPackager)
{
FileDic!.Remove(streamSpec.Playlist!.MediaInit, out _);
}
} }
//校验分片数量 //校验分片数量