mirror of
https://github.com/nilaoda/N_m3u8DL-RE.git
synced 2025-05-04 00:24:28 +02:00
处理非标准命名空间的属性读取
This commit is contained in:
parent
2cda1da5e6
commit
f96d76d62f
@ -90,6 +90,12 @@ namespace Mp4SubtitleParser
|
|||||||
{
|
{
|
||||||
var _begin = _p.GetAttribute("begin");
|
var _begin = _p.GetAttribute("begin");
|
||||||
var _end = _p.GetAttribute("end");
|
var _end = _p.GetAttribute("end");
|
||||||
|
//Handle namespace
|
||||||
|
foreach (XmlAttribute attr in _p.Attributes)
|
||||||
|
{
|
||||||
|
if (attr.LocalName == "begin") _begin = attr.Value;
|
||||||
|
else if (attr.LocalName == "end") _end = attr.Value;
|
||||||
|
}
|
||||||
_p.SetAttribute("begin", Add(_begin));
|
_p.SetAttribute("begin", Add(_begin));
|
||||||
_p.SetAttribute("end", Add(_end));
|
_p.SetAttribute("end", Add(_end));
|
||||||
//Console.WriteLine($"{_begin} {_p.GetAttribute("begin")}");
|
//Console.WriteLine($"{_begin} {_p.GetAttribute("begin")}");
|
||||||
@ -278,6 +284,13 @@ namespace Mp4SubtitleParser
|
|||||||
var _end = _p.GetAttribute("end");
|
var _end = _p.GetAttribute("end");
|
||||||
var _region = _p.GetAttribute("region");
|
var _region = _p.GetAttribute("region");
|
||||||
var _bgImg = _p.GetAttribute("smpte:backgroundImage");
|
var _bgImg = _p.GetAttribute("smpte:backgroundImage");
|
||||||
|
//Handle namespace
|
||||||
|
foreach (XmlAttribute attr in _p.Attributes)
|
||||||
|
{
|
||||||
|
if (attr.LocalName == "begin") _begin = attr.Value;
|
||||||
|
else if (attr.LocalName == "end") _end = attr.Value;
|
||||||
|
else if (attr.LocalName == "region") _region = attr.Value;
|
||||||
|
}
|
||||||
var sub = new SubEntity
|
var sub = new SubEntity
|
||||||
{
|
{
|
||||||
Begin = _begin,
|
Begin = _begin,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user