From 363c68d3ed7c76f1a65a813e7fdc5e22700da3bc Mon Sep 17 00:00:00 2001 From: bashonly Date: Wed, 11 Jun 2025 02:19:19 -0500 Subject: [PATCH] [devalue] avoid infinite loop Authored by: bashonly --- yt_dlp/utils/web/devalue.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yt_dlp/utils/web/devalue.py b/yt_dlp/utils/web/devalue.py index e3213b439..570a0388e 100644 --- a/yt_dlp/utils/web/devalue.py +++ b/yt_dlp/utils/web/devalue.py @@ -71,6 +71,9 @@ def parse_iter(parsed: typing.Any, /, *, revivers: dict[str, collections.abc.Cal if value and isinstance(value[0], str): # TODO: implement zips `strict=True` if reviver := revivers.get(value[0]): + if value[1] == source: + yield IndexError('custom types cannot point to themselves') + continue # inverse order: resolve index, revive value stack.append((target, index, (value[0], value[1], reviver))) stack.append((target, index, value[1]))