From 02bf9e94a5db5c33f39bffeb0311d23dda63e950 Mon Sep 17 00:00:00 2001 From: nilaoda Date: Fri, 2 Dec 2022 14:25:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=BC=82=E5=B8=B8=E6=97=B6?= =?UTF-8?q?=E5=81=9C=E6=AD=A2=E5=BD=95=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE.Common/Log/Logger.cs | 10 ++++++++++ .../DownloadManager/SimpleLiveRecordManager2.cs | 8 ++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) 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; + } } }