From 47046464faaa3c72465f52c3c6a6191fbfd6b32c Mon Sep 17 00:00:00 2001 From: pukkandan Date: Wed, 29 Jun 2022 06:07:21 +0530 Subject: [PATCH] [extractor] Fix empty `BaseURL` in MPD Closes #4113 --- yt_dlp/extractor/common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index baa6f8de9..216c10391 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -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