video_downloader: optional cookies_file input + enable node JS runtime#274
Open
MoonCaves wants to merge 1 commit into
Open
video_downloader: optional cookies_file input + enable node JS runtime#274MoonCaves wants to merge 1 commit into
MoonCaves wants to merge 1 commit into
Conversation
YouTube now serves "Sign in to confirm you're not a bot" to anonymous
requests (consistently on datacenter IPs), and yt-dlp's n-challenge
solver needs a JS runtime it only auto-detects for deno. Add an
optional netscape-format cookies_file input (passed as yt-dlp
cookiefile) threaded through metadata/video/audio/subtitle paths, and
enable node alongside deno in js_runtimes (yt-dlp's embedded API
defaults to {'deno': {}}; enabling node is unconditional but inert on
machines that have deno). Also ignore /cookies.txt so session cookies
can't be committed by accident.
proofread by fable 5 + codex
4063c4b to
49f8a2f
Compare
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
youtube downloads via
video_downloadercurrently fail on a lot of boxes — youtube now serves "Sign in to confirm you're not a bot" to anonymous requests (datacenter IPs get it consistently, residential increasingly too), and yt-dlp's n-challenge solving needs a JS runtime that isn't enabled by default when only node is installed. this PR adds an optionalcookies_fileinput (netscape-format cookies.txt, passed through as yt-dlp'scookiefile) and enables node alongside deno injs_runtimesso the EJS challenge solver works on node-only machines. to be precise about the second part: the node runtime is enabled unconditionally (not only when cookies are passed) — yt-dlp's embedded API documentsjs_runtimesas a dict of runtimes to enable, defaulting to{'deno': {}}(yt_dlp/YoutubeDL.pylines 539–545 and 736), so on machines that have deno nothing changes, and on node-only machines the solver starts working instead of failing.also adds
/cookies.txt(anchored to repo root) to.gitignoreso nobody accidentally commits their session cookies to a fork.Related issue
Refs # (none found — happy to open one first if you prefer)
Changes
tools/analysis/video_downloader.py: new optionalcookies_fileinput on the schema, threaded through metadata extraction, video/audio/subtitle download paths via a shared_common_ydl_opts;js_runtimesnow{"deno": {}, "node": {}}.gitignore: ignore/cookies.txtat repo rootTesting
js_runtimes, formats fail with "n challenge solving failed" / "No video formats found"; with it, formats resolveChecklist
make test-contracts/make test) where applicable. (contract suite on a clean checkout of main with only this change applied: 325 passed, 6 skipped)