Skip to content

Bypass YouTube SABR + PO-token block by default#27

Open
seanpuenteorg wants to merge 1 commit into
bradautomates:mainfrom
seanpuenteorg:sabr-bypass
Open

Bypass YouTube SABR + PO-token block by default#27
seanpuenteorg wants to merge 1 commit into
bradautomates:mainfrom
seanpuenteorg:sabr-bypass

Conversation

@seanpuenteorg

Copy link
Copy Markdown

Why

On a clean install today, running the skill's own demo URL fails:

python3 scripts/watch.py https://www.youtube.com/watch?v=QZMljuD10sU
# WARNING: [youtube] ... YouTube is forcing SABR streaming for this client.
# WARNING: [youtube] ... PO token was not provided.
# ERROR: unable to download video data: HTTP Error 403: Forbidden

YouTube has been routing the default web/tv yt-dlp clients through SABR-only streams that require a PO (Proof-of-Origin) token. Without one, the format URLs come back unauthorised and the whole pipeline aborts before frames or transcript are produced. The skill ships a sensible yt-dlp invocation today, but it doesn't include the now-standard workaround.

What

One flag to yt-dlp:

"--extractor-args", "youtube:player_client=ios,web_safari,android,tv",

These three clients still serve format 18 (360p mp4) without a PO token. tv is kept at the end so the original behaviour remains reachable when the upper clients succeed. Plus a SKILL.md line under "Failure modes" so Claude can recognise the residual case and route to --cookies-from-browser instead of retrying blindly.

Verification

Same URL, post-patch:

[watch] downloading via yt-dlp…
[info] QZMljuD10sU: Downloading 1 format(s): 18
[download] 100% of 21.12MiB in 00:00:01 at 11.18MiB/s
[watch] extracting ~80 frames at 0.155 fps over full 516.0s…
# 80 frames written, 278 caption segments via native captions, EXIT=0

Scope

Six lines total (one --extractor-args pair with comment, one SKILL.md bullet). No behaviour change for videos that already worked — the new client list is additive and ordered so existing successful paths are still hit first.

Not in this PR

The 360p fallback (format 18) means on-screen text and code in screen-recordings will be harder for Claude to read at the default --resolution 512. Worth flagging in SKILL.md as "bump --resolution to 1024 if reading on-screen text on a SABR-blocked source", but I'd land the unblock first and tune separately.

The default `web` and `tv` yt-dlp clients began returning HTTP 403 on most
public YouTube videos in late 2025 unless a PO (Proof-of-Origin) token is
supplied. This makes the skill fail end-to-end on a fresh install for the
most common source — including the skill's own demo URL.

Falling back to `ios,web_safari,android,tv` for player_client lets yt-dlp
serve format 18 (360p mp4) without a PO token. Listing `tv` last keeps the
original behaviour reachable when the upper clients succeed.

Also documents the failure mode in SKILL.md so Claude can recognize the
symptom and route to `--cookies-from-browser` rather than guessing.

Reproducer (pre-patch, on a clean install):
  python3 scripts/watch.py https://www.youtube.com/watch?v=QZMljuD10sU
  → ERROR: unable to download video data: HTTP Error 403: Forbidden

Post-patch: 21 MB mp4 + en.vtt download cleanly, 278 caption segments,
80-frame report generated.
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