4d255647a101976f22610a899a2230e6e8e0e0d9
Downloads run for minutes via Popen while metadata calls continue in parallel. Both processes read from AND write back to the same --cookies file, causing concurrent writes that corrupt the session cookie state. Fix: _make_private_cookie_copy() intercepts --cookies <file> in any arg list and swaps it for a NamedTemporaryFile copy. Each yt-dlp process gets its own snapshot; write-backs go to the throwaway copy and are discarded on cleanup. - _run() uses this for all subprocess.run calls (metadata, subtitles, comments) - start_download() uses it for the long-lived Popen download process - _meta_run() benefits automatically since it calls _run() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Description
No description provided
Languages
JavaScript
53.6%
Python
45.9%
HTML
0.2%
Dockerfile
0.2%