1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-02 17:22:31 +01:00

[extractor] Fix root-relative URLs in MPD (#1006)

Authored by: DigitalDJ
This commit is contained in:
DigitalDJ 2021-09-19 18:07:57 +09:30 committed by GitHub
parent c6af2dd8e5
commit f9cc0161e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2622,8 +2622,10 @@ def extract_Initialization(source):
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')