aboutsummaryrefslogtreecommitdiff
path: root/yt_dlp/extractor/common.py
diff options
context:
space:
mode:
authorbashonly <88596187+bashonly@users.noreply.github.com>2023-11-14 14:28:18 -0600
committerGitHub <noreply@github.com>2023-11-14 20:28:18 +0000
commitd4f14a72dc1dd79396e0e80980268aee902b61e4 (patch)
tree4a55b93a8a2178c95ee9543f66bfb328577ef38a /yt_dlp/extractor/common.py
parent87264d4fdadcddd91289b968dd0e4bf58d449267 (diff)
[ie] Do not test truth value of `xml.etree.ElementTree.Element` (#8582)
Testing the truthiness of an `xml.etree.ElementTree.Element` instance is deprecated in py3.12 Authored by: bashonly
Diffstat (limited to 'yt_dlp/extractor/common.py')
-rw-r--r--yt_dlp/extractor/common.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py
index c3ceb0039..b3a45b3fb 100644
--- a/yt_dlp/extractor/common.py
+++ b/yt_dlp/extractor/common.py
@@ -2225,7 +2225,9 @@ class InfoExtractor:
mpd_url, video_id,
note='Downloading MPD VOD manifest' if note is None else note,
errnote='Failed to download VOD manifest' if errnote is None else errnote,
- fatal=False, data=data, headers=headers, query=query) or {}
+ fatal=False, data=data, headers=headers, query=query)
+ if not isinstance(mpd_doc, xml.etree.ElementTree.Element):
+ return None
return int_or_none(parse_duration(mpd_doc.get('mediaPresentationDuration')))
@staticmethod