From bd621a4d2b1618f0f4343d0591a6f82de4dcb351 Mon Sep 17 00:00:00 2001 From: sepro <4618135+seproDev@users.noreply.github.com> Date: Fri, 16 Feb 2024 16:11:46 +0100 Subject: [PATCH 1/4] [ie] Fix parsing of base URI in SMIL manifest --- yt_dlp/extractor/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index af534775f..918141c3b 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -2334,7 +2334,7 @@ class InfoExtractor: for meta in smil.findall(self._xpath_ns('./head/meta', namespace)): b = meta.get('base') or meta.get('httpBase') if b: - base = b + base = f'{b}/' break formats, subtitles = [], {} From 09e8ee0d9ed44b1b6e073d3c06acbd57b3d3e6da Mon Sep 17 00:00:00 2001 From: sepro <4618135+seproDev@users.noreply.github.com> Date: Mon, 19 Feb 2024 23:17:09 +0100 Subject: [PATCH 2/4] Strip trailing slash from base Co-authored-by: pukkandan --- yt_dlp/extractor/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index 918141c3b..30bdcdd02 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -2334,7 +2334,7 @@ class InfoExtractor: for meta in smil.findall(self._xpath_ns('./head/meta', namespace)): b = meta.get('base') or meta.get('httpBase') if b: - base = f'{b}/' + base = f'{b.rstrip("/")}/' break formats, subtitles = [], {} From 8c341f9a300779775dde0021630456afd08582e5 Mon Sep 17 00:00:00 2001 From: sepro <4618135+seproDev@users.noreply.github.com> Date: Tue, 20 Feb 2024 00:23:08 +0100 Subject: [PATCH 3/4] Move position where slash is appended As base can be used as a format URL and the trailing slash could change the URL --- yt_dlp/extractor/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index 30bdcdd02..6b7ef0b01 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -2334,7 +2334,7 @@ class InfoExtractor: for meta in smil.findall(self._xpath_ns('./head/meta', namespace)): b = meta.get('base') or meta.get('httpBase') if b: - base = f'{b.rstrip("/")}/' + base = b break formats, subtitles = [], {} @@ -2383,7 +2383,7 @@ class InfoExtractor: }) continue - src_url = src if src.startswith('http') else urllib.parse.urljoin(base, src) + src_url = src if src.startswith('http') else urllib.parse.urljoin(f'{b}/', src) src_url = src_url.strip() if proto == 'm3u8' or src_ext == 'm3u8': From e50d09c369ca6aaf8e165ff6dc8efdece0becd61 Mon Sep 17 00:00:00 2001 From: sepro <4618135+seproDev@users.noreply.github.com> Date: Tue, 20 Feb 2024 00:36:54 +0100 Subject: [PATCH 4/4] Fix typo --- yt_dlp/extractor/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index 6b7ef0b01..07af4f665 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -2383,7 +2383,7 @@ class InfoExtractor: }) continue - src_url = src if src.startswith('http') else urllib.parse.urljoin(f'{b}/', src) + src_url = src if src.startswith('http') else urllib.parse.urljoin(f'{base}/', src) src_url = src_url.strip() if proto == 'm3u8' or src_ext == 'm3u8':