From 6428d94fa0ecd1958e0f82d9854e1a982a1118cb Mon Sep 17 00:00:00 2001 From: nilaoda Date: Sun, 17 Jul 2022 17:48:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dttml=E8=A7=A3=E6=9E=90bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE.Parser/Mp4/MP4TtmlUtil.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/N_m3u8DL-RE.Parser/Mp4/MP4TtmlUtil.cs b/src/N_m3u8DL-RE.Parser/Mp4/MP4TtmlUtil.cs index ea0a9f7..42c87e7 100644 --- a/src/N_m3u8DL-RE.Parser/Mp4/MP4TtmlUtil.cs +++ b/src/N_m3u8DL-RE.Parser/Mp4/MP4TtmlUtil.cs @@ -30,7 +30,7 @@ namespace Mp4SubtitleParser public partial class MP4TtmlUtil { - [RegexGenerator(">(.+?)<\\/p>")] + [RegexGenerator("(.+?)<\\/p>")] private static partial Regex LabelFixRegex(); public static bool CheckInit(byte[] data) @@ -184,8 +184,14 @@ namespace Mp4SubtitleParser { foreach (Match m in regex.Matches(xmlContentFix)) { - if (!m.Groups[1].Value.StartsWith("{m.Groups[1].Value}

"); + } + catch (Exception) + { xmlContentFix = xmlContentFix.Replace(m.Groups[1].Value, System.Web.HttpUtility.HtmlEncode(m.Groups[1].Value)); + } } } xmlDoc.LoadXml(xmlContentFix);