刷新异常时停止录制

This commit is contained in:
nilaoda 2022-12-02 14:25:42 +08:00
parent b2f611e632
commit 02bf9e94a5
2 changed files with 16 additions and 2 deletions

View File

@ -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);
}
}
}

View File

@ -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;
}
}
}