feat(youtube): bundle po_token provider + adaptive preview (age-restricted playback)#103
Merged
Merged
Conversation
…icted play) Age-restricted videos authenticate fine (cookies pass the age gate) but YouTube serves the authenticated web session SABR-only formats — no progressive stream, and the plain adaptive URLs need a PO token to be downloadable. No single client gives both age-pass and a playable stream, so instant-stream (progressive) can't serve them. Two pieces, together, make them play: 1. po_token: bundle the bgutil provider (node server, multi-arch, started by the entrypoint on 127.0.0.1:4416) + the yt-dlp plugin (requirements.txt). yt-dlp then fetches a PO token automatically, making the authenticated adaptive formats downloadable. Validated in the built image: provider serves v1.3.1, plugin loads, full stack boots. 2. Adaptive preview: download_preview falls back to muxing a <=480p video+audio pair (with --merge-output-format mp4) when no progressive format exists, so the existing cold-press -> preview fallback yields a playable file for age-restricted videos. Timeout raised 120->300s for the full A/V pull. Non-age videos are unchanged (instant-stream via the android client). Graceful degradation: if the provider doesn't start, the plugin just skips the token and non-age playback is unaffected. 321 passed; ruff clean; arm64 image built+booted locally, amd64 covered by the multi-arch base images + CI. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes age-restricted videos play, the deepest layer of the "won't play" saga. Cookies authenticate fine, but YouTube serves the authenticated web session SABR-only formats: no progressive stream (so instant-stream can't serve them) and the adaptive URLs need a PO token to download. No single yt-dlp client gives both age-pass and a playable stream — so two pieces work together:
1. po_token (the unlock)
brainicism/bgutil-ytdlp-pot-provider(Debian 12, same base; multi-arch amd64+arm64). Started by the entrypoint on127.0.0.1:4416.bgutil-ytdlp-pot-provider) to requirements. yt-dlp then fetches a PO token automatically, making the authenticated adaptive formats downloadable.v1.3.1), plugin loads, full stack boots withStarting po_token provider....2. Adaptive preview (the playback path)
download_previewnow falls back to muxing a<=480pvideo+audio pair (--merge-output-format mp4) when there's no progressive format — so the existing cold-press → preview fallback produces a playable file for age-restricted videos. Timeout120→300sfor the full A/V pull.Notes
321 passed, ruff clean.
🤖 Generated with Claude Code