From 2cda1da5e6b905e0a4e0070f642df407cb3d25fe Mon Sep 17 00:00:00 2001 From: nilaoda Date: Tue, 29 Nov 2022 10:17:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E4=B8=8D=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E7=9A=84=E8=AF=AD=E8=A8=80=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE.Parser/Extractor/MSSExtractor.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/N_m3u8DL-RE.Parser/Extractor/MSSExtractor.cs b/src/N_m3u8DL-RE.Parser/Extractor/MSSExtractor.cs index 8a01bce..9fafbde 100644 --- a/src/N_m3u8DL-RE.Parser/Extractor/MSSExtractor.cs +++ b/src/N_m3u8DL-RE.Parser/Extractor/MSSExtractor.cs @@ -64,6 +64,7 @@ namespace N_m3u8DL_RE.Parser.Extractor var ssmElement = xmlDocument.Elements().First(e => e.Name.LocalName == "SmoothStreamingMedia"); var timeScaleStr = ssmElement.Attribute("TimeScale")?.Value ?? "10000000"; var durationStr = ssmElement.Attribute("Duration")?.Value; + var timescale = Convert.ToInt32(timeScaleStr); var isLiveStr = ssmElement.Attribute("IsLive")?.Value; bool isLive = Convert.ToBoolean(isLiveStr ?? "FALSE"); @@ -97,6 +98,8 @@ namespace N_m3u8DL_RE.Parser.Extractor //StartTimeSubstitution = "{start time}" / "{start_time}" var urlPattern = streamIndex.Attribute("Url")?.Value; var language = streamIndex.Attribute("Language")?.Value; + //去除不规范的语言标签 + if (language?.Length != 3) language = null; //所有c节点 var cElements = streamIndex.Elements().Where(e => e.Name.LocalName == "c"); @@ -162,7 +165,6 @@ namespace N_m3u8DL_RE.Parser.Extractor if (_startTimeStr != null) currentTime = Convert.ToInt64(_startTimeStr); var _duration = Convert.ToInt64(_durationStr); - var timescale = Convert.ToInt32(timeScaleStr); var _repeatCount = Convert.ToInt64(_repeatCountStr); if (_repeatCount > 0) {