From 18311ec29dedd7eccb7527a25b4968ec5ac54206 Mon Sep 17 00:00:00 2001 From: nilaoda Date: Wed, 14 Sep 2022 20:21:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BF=AA=E5=A3=AB=E5=B0=BC?= =?UTF-8?q?=E5=AD=97=E5=B9=95=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Processor/HLS/DefaultHLSContentProcessor.cs | 12 ++++++++++++ src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/N_m3u8DL-RE.Parser/Processor/HLS/DefaultHLSContentProcessor.cs b/src/N_m3u8DL-RE.Parser/Processor/HLS/DefaultHLSContentProcessor.cs index fea98d4..84a0165 100644 --- a/src/N_m3u8DL-RE.Parser/Processor/HLS/DefaultHLSContentProcessor.cs +++ b/src/N_m3u8DL-RE.Parser/Processor/HLS/DefaultHLSContentProcessor.cs @@ -16,6 +16,8 @@ namespace N_m3u8DL_RE.Parser.Processor.HLS private static partial Regex YkDVRegex(); [RegexGenerator("#EXT-X-MAP:URI=\\\".*?BUMPER/[\\s\\S]+?#EXT-X-DISCONTINUITY")] private static partial Regex DNSPRegex(); + [RegexGenerator("#EXTINF:.*?,\\s+.*BUMPER.*\\s+?#EXT-X-DISCONTINUITY")] + private static partial Regex DNSPSubRegex(); [RegexGenerator("(#EXTINF.*)(\\s+)(#EXT-X-KEY.*)")] private static partial Regex OrderFixRegex(); [RegexGenerator("#EXT-X-MAP.*\\.apple\\.com/")] @@ -64,6 +66,16 @@ namespace N_m3u8DL_RE.Parser.Processor.HLS } } + //针对Disney+字幕修正 + if (m3u8Content.Contains("#EXT-X-DISCONTINUITY") && m3u8Content.Contains("seg_00000.vtt") && m3u8Url.Contains("media.dssott.com/")) + { + Regex ykmap = DNSPSubRegex(); + if (ykmap.IsMatch(m3u8Content)) + { + m3u8Content = m3u8Content.Replace(ykmap.Match(m3u8Content).Value, "#XXX"); + } + } + //针对AppleTv修正 if (m3u8Content.Contains("#EXT-X-DISCONTINUITY") && m3u8Content.Contains("#EXT-X-MAP") && (m3u8Url.Contains(".apple.com/") || ATVRegex().IsMatch(m3u8Content))) { diff --git a/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs b/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs index 7c5cabc..e960703 100644 --- a/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs +++ b/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs @@ -304,7 +304,7 @@ namespace N_m3u8DL_RE.CommandLine public static async Task InvokeArgs(string[] args, Func action) { - var rootCommand = new RootCommand("N_m3u8DL-RE (Beta version) 20220901") + var rootCommand = new RootCommand("N_m3u8DL-RE (Beta version) 20220914") { Input, TmpDir, SaveDir, SaveName, BaseUrl, ThreadCount, DownloadRetryCount, AutoSelect, SkipMerge, SkipDownload, CheckSegmentsCount, BinaryMerge, DelAfterDone, WriteMetaJson, AppendUrlParams, ConcurrentDownload, Headers, /**SavePattern,**/ SubOnly, SubtitleFormat, AutoSubtitleFix,