1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-06-27 17:08:32 +00:00

[devalue] catch and yield IndexErrors

Authored by: bashonly
This commit is contained in:
bashonly 2025-06-11 17:33:00 -05:00
parent b547689d1c
commit f4acb5726d
No known key found for this signature in database
GPG Key ID: 783F096F253D15B0

View File

@ -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`