diff --git a/src/N_m3u8DL-RE.Common/Log/Logger.cs b/src/N_m3u8DL-RE.Common/Log/Logger.cs index 298b8e1..c35bdb7 100644 --- a/src/N_m3u8DL-RE.Common/Log/Logger.cs +++ b/src/N_m3u8DL-RE.Common/Log/Logger.cs @@ -133,5 +133,15 @@ namespace N_m3u8DL_RE.Common.Log HandleLog(write); } } + + public static void ErrorMarkUp(Exception exception) + { + string data = exception.Message.EscapeMarkup(); + if (LogLevel >= LogLevel.ERROR) + { + data = exception.ToString().EscapeMarkup(); + } + ErrorMarkUp(data); + } } } diff --git a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs index ea91816..b11fc68 100644 --- a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs +++ b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs @@ -236,8 +236,7 @@ namespace N_m3u8DL_RE.DownloadManager //读取mp4信息 if (result != null && result.Success) { - var data = File.ReadAllBytes(result.ActualFilePath); - currentKID = ReadInit(data); + currentKID = ReadInit(result.ActualFilePath); //从文件读取KEY await SearchKeyAsync(currentKID); //实时解密 @@ -677,6 +676,11 @@ namespace N_m3u8DL_RE.DownloadManager { //不需要做事 } + catch (Exception e) + { + Logger.ErrorMarkUp(e); + STOP_FLAG = true; + } } }