aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDigitalDJ <DigitalDJ@users.noreply.github.com>2021-09-19 18:07:57 +0930
committerGitHub <noreply@github.com>2021-09-19 14:07:57 +0530
commitf9cc0161e67fcf1471178b43649ad8ba6b508c93 (patch)
treee19d0f9b687ca2da4d995528760aff7897cb7eba
parentc6af2dd8e5a4ee71e7378d7ad12395dce658f7b3 (diff)
downloadhypervideo-pre-f9cc0161e67fcf1471178b43649ad8ba6b508c93.tar.lz
hypervideo-pre-f9cc0161e67fcf1471178b43649ad8ba6b508c93.tar.xz
hypervideo-pre-f9cc0161e67fcf1471178b43649ad8ba6b508c93.zip
[extractor] Fix root-relative URLs in MPD (#1006)
Authored by: DigitalDJ
-rw-r--r--yt_dlp/extractor/common.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py
index e79684231..f6ca686a3 100644
--- a/yt_dlp/extractor/common.py
+++ b/yt_dlp/extractor/common.py
@@ -2622,8 +2622,10 @@ class InfoExtractor(object):
base_url = base_url_e.text + base_url
if re.match(r'^https?://', base_url):
break
- if mpd_base_url and not re.match(r'^https?://', base_url):
- if not mpd_base_url.endswith('/') and not base_url.startswith('/'):
+ if mpd_base_url and base_url.startswith('/'):
+ base_url = compat_urlparse.urljoin(mpd_base_url, base_url)
+ elif mpd_base_url and not re.match(r'^https?://', base_url):
+ if not mpd_base_url.endswith('/'):
mpd_base_url += '/'
base_url = mpd_base_url + base_url
representation_id = representation_attrib.get('id')