[extractor] Fix empty BaseURL in MPD

Closes #4113
This commit is contained in:
pukkandan 2022-06-29 06:07:21 +05:30
parent b1f94422cc
commit 47046464fa
No known key found for this signature in database
GPG key ID: 7EEE9E1E817D0A39

View file

@ -63,6 +63,7 @@ from ..utils import (
str_to_int,
strip_or_none,
traverse_obj,
try_call,
try_get,
unescapeHTML,
unified_strdate,
@ -2820,7 +2821,7 @@ class InfoExtractor:
base_url = ''
for element in (representation, adaptation_set, period, mpd_doc):
base_url_e = element.find(_add_ns('BaseURL'))
if base_url_e is not None:
if try_call(lambda: base_url_e.text) is not None:
base_url = base_url_e.text + base_url
if re.match(r'^https?://', base_url):
break