[core] Avoid deepcopy of ctx dict (fix f35b757)
authordirkf <fieldhouse@gmx.net>
Thu, 6 Apr 2023 13:11:18 +0000 (14:11 +0100)
committerdirkf <fieldhouse@gmx.net>
Thu, 6 Apr 2023 13:56:55 +0000 (14:56 +0100)
* may now contain `LazyList`s
* resolves #31999

youtube_dl/YoutubeDL.py

index bcf7817449bfe5557e69a94e13c8842c29837064..2c0d4926c412d45ce0871dc3c7b3e679d22f6689 100755 (executable)
@@ -1399,7 +1399,7 @@ class YoutubeDL(object):
             filters = [self._build_format_filter(f) for f in selector.filters]
 
             def final_selector(ctx):
-                ctx_copy = copy.deepcopy(ctx)
+                ctx_copy = dict(ctx)
                 for _filter in filters:
                     ctx_copy['formats'] = list(filter(_filter, ctx_copy['formats']))
                 return selector_function(ctx_copy)