修复当文件以`\r`换行时的异常

This commit is contained in:
nilaoda 2023-10-21 23:18:26 +08:00
parent 75b270b52d
commit 27cfee5f01
2 changed files with 7 additions and 1 deletions

View File

@ -29,6 +29,12 @@ namespace N_m3u8DL_RE.Parser.Processor.HLS
public override string Process(string m3u8Content, ParserConfig parserConfig)
{
//处理content以\r作为换行符的情况
if (m3u8Content.Contains("\r") && !m3u8Content.Contains("\n"))
{
m3u8Content = m3u8Content.Replace("\r", Environment.NewLine);
}
var m3u8Url = parserConfig.Url;
//央视频回放
if (m3u8Url.Contains("tlivecloud-playback-cdn.ysp.cctv.cn") && m3u8Url.Contains("endtime="))

View File

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