Files
youclonedl/backend/services/ytdlp.py
Mattias Thall 0a4dfb845e Pause discovery metadata calls while a download is active
_meta_run now checks _active_downloads before each background yt-dlp call.
If a download is running it waits (3s poll loop) until the download finishes
before making the next metadata request.

This prevents YouTube from seeing the same session used simultaneously by
a download and a discovery/metadata call, which was causing cookie invalidation
even with private cookie copies.

Downloads still run immediately without waiting for metadata. Background
discovery is the one that yields.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 02:12:43 +02:00

35 KiB