Skip to content

fix(platform): get video ingestion through partly walled proxies - #5066

Merged
yannickmonney merged 2 commits into
mainfrom
fix/video-ingest-proxy-exits
Oct 28, 2026
Merged

yannickmonney merged 2 commits into
mainfrom
fix/video-ingest-proxy-exits

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

What happened

A deployment sent its outbound traffic through a commercial proxy service, configured as one rotating endpoint (OUTBOUND_PROXY_URLS=http://user-rotate:…@gateway:80), and video ingestion kept failing. I reproduced it against that account with the deployment's own yt-dlp flags (PO-token provider, mweb). Four causes stack up:

  • yt-dlp is out of date. The image pins 2026.07.04. YouTube now answers its audio downloads with HTTP 403 from every network, including a residential connection with no proxy, so every video without captions fails at the audio step. 2026.10.26 downloads the same audio from the same networks.
  • Most exits are walled. The list holds 100 shared data-center addresses. Tested one at a time, YouTube refused 66–70 of them with "Sign in to confirm you're not a bot". Three more, all on one network, got a false "Video unavailable". The verdicts are fairly stable: 85 of 100 addresses gave the same answer 40 minutes apart.
  • Tale spread each video across exits. Every yt-dlp run of a video (metadata, captions, audio) took the next proxy in turn, and the first wall failed the video. A video needed two or three lucky draws in a row.
  • A rotating endpoint cannot carry downloads. A run keeps one tunnel to www.youtube.com, but the media download opens another tunnel, and a per-connection rotating endpoint gives that tunnel another address. Of the 4 extractions that passed through it, 3 got 403 on the download. The same video through fixed exits downloaded 4 of 4.

What changes

  • yt-dlp 2026.10.26. The Dockerfile pin moves, and so does MIN_YTDLP_VERSION.
  • YtdlpRoute: one proxy per video, kept for all its runs. The route starts on the proxy that last served a video of the same platform (remembered per process and per platform).
    • A run the platform turns away (bot check, rate limit, 403), or one whose pooled proxy fails, moves to the next proxy that has not failed the video.
    • At most 5 runs per call, and no new run once the step has spent 90 s. The metadata step, Vimeo embed fallback included, stays inside the 5-minute watchdog.
    • A lone proxy or VIDEO_INGEST_PROXY_URL is never retried.
    • Moves are logged by list entry, never credentials, because a provider's fixed-address endpoints share one host and port.
  • Proxy rotation helpers. nextOutboundProxy takes {prefer, skip} without moving the shared cursor for prefer. New outboundProxyEntry.
  • --no-continue, so a rerun starts its downloads over instead of resuming another run's partial file.
  • Classifier fix. A bare 429 inside a video ID no longer classifies as a rate limit, which would now send a login-walled Vimeo video through every proxy.
  • Docs (EN/DE/FR): the video ingestion egress section and the environment reference say to list fixed-address endpoints, and what the worker logs. .env.example, spec rule VID-R7, and the manual-test automation register row are updated too.

Verification

  • Unit tests: 732 pass across core/video_links, lib/net and the platform guards. The new tests drive a stand-in yt-dlp binary through: keep, move, serving proxy, per-platform memory, clearing on a turn-away, a proxy listed twice, the step window across calls, lone proxy and override, the run cap, --no-continue, and the 429 match. 11 deliberate mutations were each caught by a red test.
  • Live, through the real proxy account, running Tale's ytdlp.ts with yt-dlp 2026.10.26 and the bgutil provider:
    • With 100 fixed-address endpoints as OUTBOUND_PROXY_URLS, 5 of 5 videos completed: metadata, captions (manual and auto) and audio.
    • With walled entries listed first, the first video moved 1–4 times and completed. The next video started on the serving proxy and needed no moves.
    • The same 5 videos through the rotating endpoint, with no failover possible: 2 of 5 completed.
  • Backend integration, run locally and filtered to checkFiles plus the three video lanes: 103/105, identical to main on the same filter. The two failures are transcription-setup lanes the filter leaves out.
  • Checks: oxfmt, oxlint, tsc, knip, lint:links, lint:manual, the docs suite and the domain-spec guard all pass.

Operator follow-up (outside this PR)

For video, list a provider's fixed-address endpoints in OUTBOUND_PROXY_URLS instead of a rotating endpoint; the docs explain how. Shared data-center plans stay heavily walled, and residential or ISP proxies are refused less often.

By 2026-10-28 YouTube answered yt-dlp 2026.07.04's audio downloads with
HTTP 403 from every network tried, a residential one without any proxy
included, so every video without captions failed at the audio step.
2026.10.26 fetched the same audio from the same networks, with and without
the PO-token provider, and its `default` YouTube clients are now
tv_samsung and visionos. The version floor follows the pin, so a dev host
still on the old binary is warned.
Through OUTBOUND_PROXY_URLS every yt-dlp run of a video (metadata,
captions, audio) took the next proxy in turn, and the first bot wall
failed the video. With a data-center list YouTube partly walls (69 of 100
Webshare addresses refused on 2026-10-28), a video needed two or three
lucky draws in a row.

A video now keeps one proxy for all its runs and starts on the proxy that
last served a video of its platform. A run the platform turns away (bot
check, rate limit, 403) or that its proxy cannot carry runs again through
the next proxy that has not failed the video: at most five runs per call,
none started once the step's 90 s are spent, which keeps the metadata
step, Vimeo embed fallback included, inside the watchdog's five minutes.
A lone proxy and VIDEO_INGEST_PROXY_URL are not retried. Each move is
logged by list entry, since a provider's fixed-address endpoints often
share one host and port.

A rotating endpoint that gives every connection a new address cannot
carry video. YouTube refused the download (403) when the media connection
left from another address than the extraction. The docs (EN/DE/FR) and
.env.example now say to list fixed-address endpoints instead.

A bare 429 in a video ID no longer reads as a rate limit, and a rerun
starts its downloads over (--no-continue) instead of resuming another
run's partial file. Spec rule VID-R7 states the behaviour; ytdlp.test.ts
holds it with a stand-in yt-dlp.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant