fix(dl-video): pass JS runtime + alt YouTube player_clients to yt-dlp#5
Open
jjaavvin-web wants to merge 1 commit into
Open
Conversation
yt-dlp's default extraction path for YouTube currently fails with "Requested format is not available" on systems that don't have Deno installed and/or are signed into Google, because: 1. YouTube's URL "n parameter" requires a JS runtime to deobfuscate. yt-dlp only auto-enables Deno; Node (much more commonly installed) must be passed explicitly with --js-runtimes. 2. The default tv_downgraded / web_creator clients now demand a "Data Sync ID" for signed-in accounts that yt-dlp can't synthesize, so format extraction returns only storyboard images. Forcing the web_safari / mweb / android_vr / ios clients sidesteps the check. Both flags are passed conditionally / scoped: - --js-runtimes is only added if `node` is on PATH (no regression for Deno-equipped systems). - --extractor-args is namespaced to `youtube:`, so other extractors (TikTok, X, Vimeo, …) are unaffected. Verified locally on a 21-minute YouTube video that previously hit "Only images are available for download" — now downloads cleanly. Co-Authored-By: Claude Opus 4.7 <[email protected]>
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.
Summary
dl-videocurrently fails on YouTube withERROR: [youtube] <id>: Requested format is not availableon systems where:tv_downgraded/web_creatorclients now demand a Data Sync ID).yt-dlp can only emit storyboard images in that state, so the download silently degrades. Symptoms reported elsewhere: yt-dlp#11904, #11932.
This PR adds two flags to the existing
run_dlinvocation:--js-runtimes node:$(command -v node)— only whennodeis on PATH. Lets yt-dlp solve YouTube's obfuscatednparameter without requiring a Deno install.--extractor-args "youtube:player_client=web_safari,mweb,android_vr,ios"— forces clients that don't need a Data Sync ID.Both are scoped —
nodecheck prevents regressions on Deno-equipped systems, and the extractor-args namespace (youtube:) leaves TikTok/X/Vimeo/LinkedIn extraction unchanged.Why these specific clients
web_safari,mweb,android_vr, andiosare the player clients currently confirmed by the yt-dlp project to bypass the Data Sync ID requirement while still exposing the full mp4/webm format ladder (135–401, including 480p–4K progressive variants). I chose four rather than one to give yt-dlp fallback room as YouTube rotates restrictions.Test plan
watch <youtube-url>on a video that previously failed with "Requested format is not available" — confirm it now downloads.watch <tiktok-url>andwatch <vimeo-url>— confirm non-YouTube hosts still work (extractor-args is youtube-only namespace).nodeinstalled (Deno-only), confirm no warnings appear about the missing runtime flag.Notes
Tested on WSL2 Ubuntu, yt-dlp 2026.03.17, Node 22.x at
~/.local/bin/node. The same fix should apply on macOS —command -v noderesolves Homebrew/nvm installs equally.Happy to adjust the player_client list if you'd prefer a smaller set, or to gate the extractor-args behind a
[[ "$URL" == *youtube* ]]check if you want it strictly opt-in for YT URLs.🤖 Generated with Claude Code