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

[extractor/common] Improve base url construction

This commit is contained in:
Sergey M․ 2016-02-13 00:13:56 +06:00
parent bcbb1b08b2
commit bb20526b64

View File

@ -1435,7 +1435,9 @@ def extract_multisegment_info(element, ms_parent_info):
base_url = base_url_e.text + base_url
if re.match(r'^https?://', base_url):
break
if not re.match(r'^https?://', base_url):
if mpd_base_url and not re.match(r'^https?://', base_url):
if not mpd_base_url.endswith('/') and not base_url.startswith('/'):
mpd_base_url += '/'
base_url = mpd_base_url + base_url
representation_id = representation_attrib.get('id')
lang = representation_attrib.get('lang')