Yt-dlp: External JavaScript runtime now required for full YouTube support

by bertmanon 11/12/2025, 10:12 AMwith 627 comments

by embedding-shapeon 11/12/2025, 2:06 PM

Seems its already in Arch's repositories, and seems to work, just add another flag to the invocation:

    yt-dlp --cookies-from-browser firefox --remote-components ejs:github -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" 'https://www.youtube.com/watch?v=XXX'
It is downloading a solver at runtime, took maybe half a second in total, downloads are starting way faster than before it seems to me.

    [youtube] [jsc:deno] Solving JS challenges using deno
    [youtube] [jsc:deno] Downloading challenge solver lib script from  https://github.com/yt-dlp/ejs/releases/download/0.3.1/yt.solver.lib.min.js
It would be great if we could download the solver manually with a separate command, before running the download command, as I'm probably not alone in running yt-dlp in a restricted environment, and being able to package it up together with the solver before runtime would let me avoid lessening the restrictions for that environment. Not a huge issue though, happy in general the start of downloads seems much faster now.

by nofunsiron 11/12/2025, 10:38 PM

Tangentially related. Youtube web is now, as of the last month, strictly enforcing "referrer header" for embedded videos. Even if you spoof it, it doesn't always work. You can't navigate directly to "youtube.com/embed/<videoid>" to watch something without giving google some direct information.

Since when are public-facing error codes just lies?

"Oh Error 15 something went wrong, tee hee." "Oh Error 153 better try again, (got em, guys!)"

They operated for a while, before finally updating their FAQ stating this is intentional.[1]

[1] https://support.google.com/youtube/answer/171780?hl=en#zippy... " Provide a HTTP Referer header to enable video playback

Our Terms of Service require embedders to provide a HTTP Referer. If this information is missing, viewers attempting to watch embedded YouTube videos will encounter blocked playback and an error screen (“error 153”). These viewers will still be able to click “Watch on YouTube” to view the video on YouTube. Note that directly accessing the embedded player without an enclosing webpage or context (such as accessing it from your web browser's address bar) will typically not have a HTTP Referer and users will encounter the error screen; the embedded player is only intended to be used within an embedded context."

by bdzon 11/12/2025, 1:17 PM

I use yt-dlp (and back then youtube-dl) all the time to archive my liked videos. Started back in around 2010, now I have tens of thousands of videos saved. Storage is cheap and a huge percent of them are not available anymore on the site.

I also save temporary videos removed after a time for example NHK honbasho sumo highlights which are only available for a month or so then they permanently remove them.

by karel-3don 11/12/2025, 2:56 PM

From https://github.com/yt-dlp/yt-dlp/issues/14404

> What about Selenium or a headless browser solution?

>

> The yt-dlp maintainers have no interest in doing this except as a measure of last resort. A headless browser solution would be an admission of defeat and would go against the spirit of this project.

by bilekason 11/12/2025, 1:08 PM

More and more recently with youtube, they seem to be more and more confrontational with their users, from outright blocking adblockers, which has no bearing on youtube's service, to automatically scraping creators content for AI training and now anything API related. They're very much aware that there is no real competition and so they're taking full advantage of it. At the expense of the 'users experience' but these days, large companies simply don't suffer from a bad customer experience anymore.

by mmaunderon 11/12/2025, 5:16 PM

Scraping sucks. Imagine a broken API with new breakages every few weeks. Now imagine the provider hates you. Shout out to the team for what they do.

by djoldmanon 11/12/2025, 12:54 PM

From

https://github.com/yt-dlp/yt-dlp/wiki/EJS

it looks like deno is recommended for these reasons:

> Notes

> * Code is run with restricted permissions (e.g, no file system or network access)

> * Supports downloading EJS script dependencies from npm (--remote-components ejs:npm).

by Tabular-Icebergon 11/12/2025, 1:36 PM

I remember when QuickTime came out in 1991 and it was obvious to everyone that video should be copied, pasted and saved like any arbitrary data.

It's absolutely insane to me how bad the user experience is with video nowadays, even video that's not encumbered by DRM or complex JavaScript clients.

by reddaloon 11/12/2025, 12:52 PM

I wonder why YouTube doesn't implement full DRM, such as Widevine, at this point.

Is it because it would break compatibility with some devices? Is it too expensive?

(not that I'd like that; I always download videos from YouTube for my personal archive, and I only use 3rd party or modified clients)

by ojosilvaon 11/12/2025, 2:27 PM

I wish @pg would just add "Replace YouTube" to his Frighteningly Ambitious Startup ideas.

https://paulgraham.com/ambitious.html

by yupyupyupson 11/12/2025, 5:22 PM

Even when the so called "ad-pocalypse" happened, this wasn't as big of an issue as it is today.

What's going on with Google being extra stingy seems to correlate well with the AI boom (curse). I suspect there are companies running ruthless bots scraping TBs of videos from YouTube. Not just new popular videos that are on fast storage, but old obscure ones that probably require more resources to fetch. This is unnatural, and goes contrary to the behaviour pattern of normal users that YT is optimized for.

I think AI-companies abusing the internet is why things are getting more constrained in general. If I'm right, they deserve the bulk of the blame imo.

by robon 11/12/2025, 2:53 PM

We use this for AI transcriptions internally on our Linode VPS server.

It's been working great by itself for the most part since the beginning of the year, with only a couple of hiccups along the way.

We do use a custom cookies.txt file generated on the server as well as generate a `po_token` every time, which seems to help.

(I originally thought everything would just get blocked from a popular VPS provider, but surprisingly not?)

Most recently though, we were getting tons of errors like 429 until we switched to the `tv_embedded` client, which seems to have resolved things for the most part.

by 1vuio0pswjnm7on 11/12/2025, 6:39 PM

"Support for YouTube without a JavaScript runtime is now considered "deprecated." It does still work somewhat; however, format availability will be limited, and severely so in some cases (e.g. for logged-in users). "

The devil is in the details

There are some formats, perhaps the one(s) the user wants, that do not require a JS runtime

Interesting that "signing up" for a website publishing public infomation and "logging in" may not always work in the user's favor. For example, here they claim it limits format availability

"Format availability without a JS runtime is expected to worsen as time goes on, and this will not be considered a "bug" but rather an inevitability for which there is no solution. It's also expected that, eventually, support for YouTube will not be possible at all without a JS runtime."

It is speculated that this format availability might change in the future

by mellosoulson 11/12/2025, 3:27 PM

Discussed here a few weeks ago:

https://news.ycombinator.com/item?id=45358980

Yt-dlp: Upcoming new requirements for YouTube downloads - 1244 points, 620 comments

by goku12on 11/12/2025, 2:26 PM

Just one question. I see all these 3rd party clients solving the problem separately. Isn't it easier for everyone to build a unified decoder backend that exposes a stable and consistent interface for all the frontends? That way, it will get more attention and each modification will have to be done only once.

Since JS is the big issue here, the backend itself could be written in JS, TS or something else that compiles to WASM. That way, the decoder doesn't have to be split between two separate codebase. Deno also allows the bundle to be optionally compiled into a native executable that can run without having to install Deno separately.

by globular-toaston 11/12/2025, 1:12 PM

It's quite worrying. A sizeable chunk of cultural and educational material produced in the last decade is in control of greedy bastards who will never have enough. Unfortunately, downloading the video data is only part of it. Even if we shared it all on BitTorrent it's nowhere near as useful without the index and metadata.

by worldsavioron 11/12/2025, 1:11 PM

yt-dlp feels like a whole army fighting Google. Users reporting and the army performs.

by dekhnon 11/12/2025, 5:36 PM

Frankly I think this is inevitable- it's practically one of the laws of computing: any sufficiently complex system will ultimately require a turing-complete language regardless of its actual necessity.

See also: """Zawinski's Law states: "Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can."""" and """Greenspun's tenth rule of programming is an aphorism in computer programming and especially programming language circles that states:[1][2]

Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp."""

(from the above I conclude that if you want to take over the computer world, implementing a mail reader with an embedded Lisp).

by tensegriston 11/12/2025, 12:27 PM

previously: https://news.ycombinator.com/item?id=45358980

by apion 11/12/2025, 3:40 PM

Someday it will have to launch a VM with a copy of Chrome installed and use an AI model to operate the VM to make it look like a human, then use frame capture inside the VM to record the video and transcode it.

by codedokodeon 11/14/2025, 9:41 AM

Before you blame Google, think that the main users of yt-dlp could be:

1) multi-billion AI companies which download large amount of videos without permission and without paying

2) Youtube competitors/replacements in countries where Youtube is blocked, which copy the videos without permission and payment

I wish though that Youtube would adjust their policy to block this type of users and let ordinary people download videos.

by Wowfunhappyon 11/12/2025, 3:09 PM

> if using QuickJS, version 2025-4-26 or later is strongly recommended for performance reasons

Oh, I wonder if they got performance to a reasonable level then? When the external JS requirements were first announced, they said it took upwards of half an hour, and a QuickJS developer wrote in the ticket that they didn’t see a path towards improving it significantly enough.

by gloosxon 11/12/2025, 6:42 PM

I wonder how the whole thing works when I open a youtube video from a preview inside a chat application on my mobile phone.

It looks like the video loads and starts playing in some kind of in-app browser, but there is just full-screen video and nothing else. I also never faced any ads in this "mode" of playing a video, yet recently some strange things started happening where the playback would start together with an audio-track from the advertisement. The video itself would start playing but the sound would be replaced with the sound from ad which seemed very odd and much like a bug, only when advertisement audio track ends it will be replaced with audio track from the video itself.

I'm genuinely curious how is the whole playback process different when I watch a video from the Telegram preview, can I somehow achieve the same "just fullscreen video" kind of playback on the desktop as well? Does anyone have any insight?

by john01davon 11/12/2025, 5:16 PM

The day that YouTube makes itself unusable with properly free tools is the day that I use Nebula and such instead

by xeonmcon 11/12/2025, 12:31 PM

In ten years time YouTube will be entirely inaccessible from the browser as the iPad kids generation are used to doomscrolling the tablet app and Google feels confident enough to cut off the aging demographic.

by anabison 11/13/2025, 12:24 AM

This is where I would guess the world destroing AGI/ASI will come about. The neverending cat-and-mouse game of ads/blockers driven by profit motive. LLMs will used by both sides in a escalating game, with humans with its attention and wallet stuck in the middle.

by docmarson 11/13/2025, 4:42 AM

Couldn't this be compiled to a single-file executable using Bun or Deno, to avoid the need for a runtime install?

https://bun.com/docs/bundler/executables

by Mr_Minderbinderon 11/13/2025, 9:46 AM

YouTube has gotten so bad that even normal people are complaining about it now. A middle-aged woman who volunteers with me was saying how she did not feel comfortable using YouTube due to the number of inappropriate ads. I ended up giving her links to a few Invidious instances and she loves them even if they are slower and not entirely reliable. She also understood the concept of a front-end without much explaining on my part.

by anvuongon 11/13/2025, 12:35 AM

This explains why it suddenly failed for me yesterday and the downloads were limited to 360p only. `dnf install deno` and it was back to normal.

by tekmavenon 11/12/2025, 3:06 PM

In case anyone was wondering, use `--js-runtimes node` to use the (as stated as insecure) node option.

by thangalinon 11/12/2025, 10:22 PM

For Firefox + uBlock origin users having troubles viewing YouTube, please see my previous comment for filters that may help with playback issues:

https://news.ycombinator.com/item?id=44332976

by zoobabon 11/12/2025, 3:12 PM

I don't mind, but it has to work out of the box after a pip install.

Looks like the packaging will be a mess?

by everdriveon 11/12/2025, 1:31 PM

Perhaps a stupid question, but is there some reason I can't potentially fall back to recording my screen / audio in realtime and saving videos that way? yt-dlp is obviously far superior to this, but just thinking about what my fallback points are.

by VerifiedReportson 11/13/2025, 8:45 AM

What is the reason for this new requirement? I didn't see it explained anywhere.

by Figson 11/12/2025, 4:15 PM

I do not understand why Google doesn't just explicitly permit people who pay for premium to use yt-dlp or other tools to watch YouTube however the fuck they want. Put that in your terms, Google -- so people aren't afraid they'll lose their GMail because they wanted to watch a video -- and you'll get more paying customers...

by jajuukaon 11/12/2025, 5:13 PM

If corporations could stop being dicks, that would be great. Between this and the Reddit API change feels like they all get together and plan this. Thank god for FOSS.

by adolphon 11/12/2025, 2:38 PM

Is captcha solving on yt-dlp's roadmap? This seems to be a natural next step. Maybe there is an external library they could integrate?

by tobyhinloopenon 11/13/2025, 11:22 AM

Is this why Youtube stopped working for me on Safari? I'm sure it is one of my adblockers, but I pay for YT Premium.

by nextworddevon 11/12/2025, 3:49 PM

Youtube obviously is making it harder to download videos because... it's training data

by zhengiszenon 11/12/2025, 2:34 PM

Then someday it with require an entire llm installed locally

by jrochkind1on 11/12/2025, 2:30 PM

I am impressed at their resourcefulness.

Knock on wood not to jinx it, but I wonder why this manages to stay up on github when eg paywall-busting chrome extensions get banned from there (because of DMCA takedowns I guess?)

by gethlyon 11/12/2025, 4:10 PM

Is there an UI wrapper for this?

by andy_pppon 11/12/2025, 5:09 PM

Am I right in saying they need to be able to run JS code from YouTube to be able to get the download URL at this point? Deliberate obfuscation I'm guessing? I guess Deno makes the code fairly safe to execute and I guess the chances of YouTube daring to download spyware onto your machine is minimal :-)

by userbinatoron 11/13/2025, 3:15 AM

I still remember when it was as simple as a request to /get_video?video_id=XXXXXXXX with possibly a &fmt=YY parameter.

Great fuckings to those at YT, I wonder if they ever feel bad for what they're doing or they are just happy to get $$$.

by rbbydotdevon 11/12/2025, 5:18 PM

great tool for archiving ICE abuses posted on multiple platforms

by creaktiveon 11/12/2025, 2:14 PM

Ah! So, that’s why brew no longer updates yt-dlp on my iMac from 2017 ¯\_(ツ)_/¯

by blissofbeingon 11/12/2025, 3:42 PM

Why deno over bun?