YouTube access¶
YouTube frequently challenges automated clients (bot checks, PO tokens, cookies). Horde ships a POT sidecar by default and adds rate-limited extracts so browsing a channel feed does not open dozens of parallel sessions.
bgutil POT sidecar¶
Compose includes:
bgutil-pot:
image: brainicism/bgutil-ytdlp-pot-provider:2.0.2
Horde is configured with:
YTDLP_POT_BASE_URL=http://bgutil-pot:4416
The sidecar is reachable only on the Compose network; do not publish port 4416 on the host. Since 2.0 the provider binds to localhost unless started with --host 0.0.0.0 (the Docker image passes this by default), so a provider run natively on another machine needs that flag.
The bgutil yt-dlp POT provider supplies Proof-of-Origin tokens over HTTP. Horde wires this into yt-dlp extractor args when YTDLP_POT_BASE_URL is set. YouTube player clients follow yt-dlp’s current defaults (minus android_vr, whose media URLs now 403 after about a minute of playback).
Health
GET /api/health includes a pot_provider block (ok / error, URL, version) from a background ping of {YTDLP_POT_BASE_URL}/ping every 30 seconds (pending until the first one lands), plus youtube.cookies_configured and youtube.last_extract_failure (kind/message/timestamp of the most recent classified extract error, plus the video or channel it targeted). Download pause and AI/catalog queue depths are under downloads and workers.
If the sidecar is down, downloads and previews may fail with bot-check style errors (UI error_kind of bot or pot). Restart bgutil-pot and confirm the URL from inside the Horde container.
Cookie fallbacks¶
Cookies identify a signed-in YouTube account, so Horde does not send them on ordinary requests (channel feeds, search, public downloads, public video-list extracts). When cookies are configured they are a per-video fallback:
- Try the download or per-video extract anonymously (PO token still applies).
- If YouTube blocks that one video as age-restricted, members-only, or similar login-required, retry that action only with cookies.
- Bot checks still go through the POT sidecar — cookies are not attached to clear a bot challenge.
| Variable | Behavior |
|---|---|
YTDLP_COOKIE_FILE |
Netscape cookie file path, as the Horde process sees it. Used when the file exists. |
YTDLP_COOKIES_FROM_BROWSER |
yt-dlp browser cookies (chrome, firefox, or browser:profile). Used only if the cookie file is unset or missing. Works only where Horde runs on the same machine as the browser (the desktop app or a local run), not in Docker. |
Cookie file takes precedence over browser cookies.
Cookies in Docker¶
The container cannot see files elsewhere on the host, and YTDLP_COOKIE_FILE is passed in as a path inside the container. The data folder is already mounted at /app/data, so put the cookies there:
- Export your cookies in Netscape format and save the file as
cookies.txtinside yourDATA_PATHfolder. - Add
YTDLP_COOKIE_FILE=/app/data/cookies.txtto.env. - Run
docker compose up -dto recreate the container with the new setting.
The cookie file is as sensitive as a password for that Google account, so keep the data folder private.
Gated videos¶
Channel listings (feeds, search, playlist pages) stay anonymous. Members-only / age-restricted entries are skipped on those lists unless cookies are configured (so you can try a download). A full video list keeps gated rows when cookies exist so the per-video description pass can retry with cookies after an anonymous block. Casual feed-head sync still skips them so browsing a channel does not attach cookies.
Downloads, stream preview, metadata refresh, and that description pass try anonymously first, then retry that video once with cookies. If the account still cannot watch it, the video is skipped (channel_catalog_skips) and listing continues; the channel page shows a toast (and the video list's last_error) instead of failing the whole job.
You will not get those videos without valid cookies for an entitled account. After an anonymous block, Horde retries that video once with cookies (if configured) and then records a skip so listing does not hammer YouTube.
Made-for-kids videos¶
YouTube answers "This video is not available" to the JS-less client Horde normally uses (visionos) for made-for-kids videos; only its clients that run YouTube's player JavaScript may play them. With YTDLP_JS_RUNTIME set (the Docker image sets it to its bundled Deno), a download, stream preview or metadata lookup that gets exactly that answer is retried once with yt-dlp's tv_samsung client in Deno (ytdlp_common.with_js_client). Every other video keeps the JS-less path; running Deno for everything was measured and rejected (ADR 0039).
That client's media URLs answer 403 until the pre-roll ads YouTube would have shown are over (about 4 seconds in tests; yt-dlp reports the time as available_at). yt-dlp waits that out for downloads; stream preview waits for it too, up to a minute, before reading a new URL (stream_preview.seconds_until_available), so such a preview starts that much later. If the Deno retry itself fails, the error shown is still YouTube's "not available".
Subtitles of a made-for-kids video are not fetched yet: that path does not retry with the JS client.
Extract gate (bot-check hygiene)¶
All metadata extract_info calls (feed cards, download preview, stream preview, video lists) share a global gate:
| Control | Value | Purpose |
|---|---|---|
| Semaphore | 1 | One extract at a time |
| Priority | interactive 0, download-meta 1, background 2 | Preview/stream-preview jump job-metadata fills |
| Min interval | 1.25 s | Spacing between extracts |
| Result cache | 180 s TTL (max 48 entries) | Shared by preview, download-meta, and stream preview (cache_key=url) |
Downloads themselves stay limited by MAX_DOWNLOAD_CONCURRENCY (default 2). The extract gate is specifically for metadata bursts when scrolling feeds or opening many previews. Caption fetches after download share a separate timedtext cooldown so a 429 does not drop subtitles forever — see subtitle retry. Ask fetches captions for whole channels through the same gate at background priority, about one video every 15 seconds, and only while no library caption retry is due; a 429 it hits pushes every caption fetch back (services/timedtext.py, held on the AppContext).
force=True bypasses cache reads (used when refreshing CDN URLs for DASH/progressive preview).
Resting the mouse on a not-downloaded video also asks for its stream preview ahead of the click (a hover warm-up, see Watching). These go through the same gate as background lookups (background=true, like a feed card's resolution badge), so a video someone is opening goes ahead of any still waiting: one at a time per browser tab, each video at most once every 3 minutes, never on touch, and only after the pointer rests 400 ms, so sweeping across cards adds no lookups.
Related¶
- Environment variables
- Troubleshooting — bot checks
- Bumping yt-dlp — pin and rebuild when extractors break
- Download pipeline