N_m3u8DL-RE/src/N_m3u8DL-RE.Parser/Processor/DASH/DefaultDASHContentProcessor.cs
2024-11-10 18:44:58 +08:00

35 lines
986 B
C#

using N_m3u8DL_RE.Common.Enum;
using N_m3u8DL_RE.Common.Log;
using N_m3u8DL_RE.Parser.Config;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace N_m3u8DL_RE.Parser.Processor.DASH;
/// <summary>
/// XG视频处理
/// </summary>
public class DefaultDASHContentProcessor : ContentProcessor
{
public override bool CanProcess(ExtractorType extractorType, string mpdContent, ParserConfig parserConfig)
{
if (extractorType != ExtractorType.MPEG_DASH) return false;
if (mpdContent.Contains("<mas:") && !mpdContent.Contains("xmlns:mas"))
{
return true;
}
return false;
}
public override string Process(string mpdContent, ParserConfig parserConfig)
{
Logger.Debug("Fix xigua mpd...");
mpdContent = mpdContent.Replace("<MPD ", "<MPD xmlns:mas=\"urn:marlin:mas:1-0:services:schemas:mpd\" ");
return mpdContent;
}
}