Skip to content

fix(instant-stream): force android player client (cookie-auth web is SABR-only)#101

Merged
windoze95 merged 1 commit into
mainfrom
fix/instant-stream-progressive-player-client
Jun 29, 2026
Merged

fix(instant-stream): force android player client (cookie-auth web is SABR-only)#101
windoze95 merged 1 commit into
mainfrom
fix/instant-stream-progressive-player-client

Conversation

@windoze95

Copy link
Copy Markdown
Owner

The actual root cause (from the server log)

WARNING:app.api.videos:instant-stream resolve/proxy failed for … vyKU6Pd5KAA: Requested format is not available
WARNING:app.api.videos:instant-stream resolve/proxy failed for … ns-FD_AnYCc: Requested format is not available

It was never (just) cookies or age. Once requests are authenticated with cookies, YouTube serves the web client SABR-only formats — no progressive/muxed itag. The instant-stream proxies a single muxed file, so the progressive selector matched nothing and every resolve 502'd (which is why #772 broke the moment valid cookies went in). The age gate was a separate, earlier layer we already solved.

Fix

  • Resolve passes --extractor-args youtube:player_client=android,webandroid still serves itag 18 (progressive), web is kept for age-gate auth. Verified locally end-to-end: resolves and fetches HTTP 206, valid MP4 (no po-token wall).
  • Hoisted PROGRESSIVE_FORMAT + player_client_args() into app.utils.ytdlp so the cookie probe resolves exactly as playback does — green now means the real progressive resolve worked, not just that --simulate read metadata.
  • verify_cookies treats "requested format is not available" on the age probe as a failure, so the panel won't claim "connected" when no playable stream came back.

Tests

resolve splices the player-client args; verify handles resolved / age-gate / malformed / probe-removed / SABR-no-progressive. 321 passed, ruff + mypy clean.

🤖 Generated with Claude Code

…SABR-only)

THE actual reason #771 (and, once cookies were added, #772 and every other
video) wouldn't play — found in the server log:
  ERROR: [youtube] <id>: Requested format is not available

Not cookies, not age: once requests are authenticated with cookies, YouTube
serves the `web` client SABR-only formats with no progressive/muxed itag, so the
instant-stream's progressive selector matches nothing and every resolve 502s.
The `android` client still serves itag 18; verified end-to-end (resolves AND
fetches HTTP 206 valid MP4).

- Resolve now passes `--extractor-args youtube:player_client=android,web`
  (android for the progressive stream, web kept for age-gate auth).
- Share PROGRESSIVE_FORMAT + player_client_args from app.utils.ytdlp so the
  cookie probe resolves *exactly* as playback does — "connected" now means the
  real progressive resolve worked, not just that --simulate could read metadata.
- verify_cookies treats "requested format is not available" on the age probe as
  a failure (don't claim connected when no playable stream came back).

321 passed; ruff + mypy clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@windoze95 windoze95 merged commit c3688ab into main Jun 29, 2026
5 checks passed
@windoze95 windoze95 deleted the fix/instant-stream-progressive-player-client branch June 29, 2026 19:01
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