about summary refs log tree commit diff
path: root/youtube_dl/YoutubeDL.py
diff options
context:
space:
mode:
authordirkf <fieldhouse@gmx.net>2023-04-06 19:42:36 +0100
committerdirkf <fieldhouse@gmx.net>2023-04-06 19:42:36 +0100
commitf8253a528935f78e1a3b724db8c1f0089f99314a (patch)
tree924a73c194ce22faf97bfd0b546cdbeb1eb17540 /youtube_dl/YoutubeDL.py
parentd6ae3b77cd50083ef245c28f904ee0b70a77d5c6 (diff)
downloadyoutube-dl-f8253a528935f78e1a3b724db8c1f0089f99314a.tar.gz
youtube-dl-f8253a528935f78e1a3b724db8c1f0089f99314a.tar.xz
youtube-dl-f8253a528935f78e1a3b724db8c1f0089f99314a.zip
[core] Avoid deepcopy of ctx dict (fix f35b757) (Pt 2)
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rwxr-xr-xyoutube_dl/YoutubeDL.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index 2c0d4926c..927b19417 100755
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -1389,11 +1389,10 @@ class YoutubeDL(object):
                         'abr': formats_info[1].get('abr'),
                         'ext': output_ext,
                     }
-                video_selector, audio_selector = map(_build_selector_function, selector.selector)
 
                 def selector_function(ctx):
-                    for pair in itertools.product(
-                            video_selector(copy.deepcopy(ctx)), audio_selector(copy.deepcopy(ctx))):
+                    selector_fn = lambda x: _build_selector_function(x)(ctx)
+                    for pair in itertools.product(*map(selector_fn, selector.selector)):
                         yield _merge(pair)
 
             filters = [self._build_format_filter(f) for f in selector.filters]