Allow scoping the proxy to lookups only

YouTube's bot checks started once traffic went through a proxy exit IP,
while direct downloads had worked. YTDLP_PROXY_SCOPE=search keeps the
proxy on search and metadata — where it is needed to get past filtered
results — and lets the audio stream go out directly. Default stays "all",
so nothing changes unless it is set.

Searches also now run against a throwaway copy of the cookie file: they
run in parallel and yt-dlp rewrites that file on exit, so two of them
could clobber the jar the downloads depend on.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Leonid Pershin
2026-09-09 00:37:57 +03:00
co-authored by Claude Opus 5
parent 2ee907626e
commit 24dfcf9232
4 changed files with 75 additions and 14 deletions
+6
View File
@@ -52,6 +52,12 @@ YTDLP_PATH=yt-dlp
# стороне прокси — обычно нужен именно он). Можно с логином и паролем:
# socks5h://user:pass@host:1080
# YTDLP_PROXY=socks5h://127.0.0.1:1080
# Где применять прокси: all — везде (по умолчанию), search — только поиск и
# метаданные, а сам аудиопоток качать напрямую. Второй вариант выручает, когда
# выходной IP прокси ловит от YouTube «Sign in to confirm you're not a bot»,
# а без прокси скачивание работает.
# YTDLP_PROXY_SCOPE=search
#
# Внимание: 127.0.0.1 внутри контейнера — это сам контейнер. Если прокси поднят
# на хосте, используйте socks5h://host.docker.internal:1080 и добавьте в