From: pukkandan Date: Wed, 14 Apr 2021 09:39:53 +0000 (+0530) Subject: [youtube] Ignore invalid stretch ratio X-Git-Tag: 2021.04.22~31 X-Git-Url: https://jfr.im/git/yt-dlp.git/commitdiff_plain/46fff7105e3d3207c2a5c6cd6588afd0a406b0a7 [youtube] Ignore invalid stretch ratio Closes #244 --- diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index 54b9ce94c..c03c63ae7 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -2079,8 +2079,10 @@ def feed_entry(name): for m in re.finditer(self._meta_regex('og:video:tag'), webpage)] for keyword in keywords: if keyword.startswith('yt:stretch='): - w, h = keyword.split('=')[1].split(':') - w, h = int(w), int(h) + stretch_ratio = map( + lambda x: int_or_none(x, default=0), + keyword.split('=')[1].split(':')) + w, h = (list(stretch_ratio) + [0])[:2] if w > 0 and h > 0: ratio = w / h for f in formats: