From 7bba10aa0d7adf7e79e0feec7327039681cb7bd4 Mon Sep 17 00:00:00 2001 From: nilaoda Date: Sun, 13 Nov 2022 00:07:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=AE=9A=E5=90=91=E5=90=8E=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E5=90=8C=E6=97=B6=E6=9B=B4=E6=94=B9=E9=BB=98=E8=AE=A4?= =?UTF-8?q?BaseUrl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs b/src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs index f019542..25f1158 100644 --- a/src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs +++ b/src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs @@ -29,9 +29,15 @@ namespace N_m3u8DL_RE.Parser.Extractor public DASHExtractor2(ParserConfig parserConfig) { this.ParserConfig = parserConfig; - this.MpdUrl = parserConfig.Url ?? string.Empty; - if (!string.IsNullOrEmpty(parserConfig.BaseUrl)) - this.BaseUrl = parserConfig.BaseUrl; + SetInitUrl(); + } + + + private void SetInitUrl() + { + this.MpdUrl = ParserConfig.Url ?? string.Empty; + if (!string.IsNullOrEmpty(ParserConfig.BaseUrl)) + this.BaseUrl = ParserConfig.BaseUrl; else this.BaseUrl = this.MpdUrl; } @@ -484,6 +490,7 @@ namespace N_m3u8DL_RE.Parser.Extractor if (streamSpecs.Count == 0) return; var (rawText, url) = await HTTPUtil.GetWebSourceAndNewUrlAsync(ParserConfig.OriginalUrl, ParserConfig.Headers); ParserConfig.Url = url; + SetInitUrl(); var newStreams = await ExtractStreamsAsync(rawText); foreach (var streamSpec in streamSpecs) {