From f4acb5726db77107f6ad0bd4dfe7e8c3ef51341b Mon Sep 17 00:00:00 2001 From: bashonly Date: Wed, 11 Jun 2025 17:33:00 -0500 Subject: [PATCH] [devalue] catch and yield IndexErrors Authored by: bashonly --- yt_dlp/utils/jslib/devalue.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/yt_dlp/utils/jslib/devalue.py b/yt_dlp/utils/jslib/devalue.py index 62addf077..d82880d92 100644 --- a/yt_dlp/utils/jslib/devalue.py +++ b/yt_dlp/utils/jslib/devalue.py @@ -77,7 +77,12 @@ def parse_iter(parsed: typing.Any, /, *, revivers: dict[str, collections.abc.Cal yield IndexError(f'invalid index: {source!r}') continue - value = parsed[source] + try: + value = parsed[source] + except IndexError as error: + yield error + continue + if isinstance(value, list): if value and isinstance(value[0], str): # TODO: implement zips `strict=True`