by embedding-shape
9 subcomments
- 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.
- 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."
- 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.
- 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.
- 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.
- 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 Tabular-Iceberg
13 subcomments
- 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.
- 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).
- 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)
- I wish @pg would just add "Replace YouTube" to his Frighteningly Ambitious Startup ideas.
https://paulgraham.com/ambitious.html
by 1vuio0pswjnm7
2 subcomments
- "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
- 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 yupyupyups
3 subcomments
- 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.
- 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 mellosouls
0 subcomment
- 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 worldsavior
1 subcomments
- yt-dlp feels like a whole army fighting Google. Users reporting and the army performs.
- 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 tensegrist
0 subcomment
- previously: https://news.ycombinator.com/item?id=45358980
by Mr_Minderbinder
1 subcomments
- 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.
- 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.
- 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 Wowfunhappy
1 subcomments
- > 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 john01dav
1 subcomments
- The day that YouTube makes itself unusable with properly free tools is the day that I use Nebula and such instead
- 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 VerifiedReports
0 subcomment
- What is the reason for this new requirement? I didn't see it explained anywhere.
by tobyhinloopen
0 subcomment
- 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.
- 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
- In case anyone was wondering, use `--js-runtimes node` to use the (as stated as insecure) node option.
- 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 everdrive
4 subcomments
- 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.
- 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.
- 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.
- 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 globular-toast
2 subcomments
- 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.
- 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 jrochkind1
1 subcomments
- 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?)
- Is there an UI wrapper for this?
- 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 userbinator
1 subcomments
- 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 $$$.
- 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 nextworddev
0 subcomment
- Youtube obviously is making it harder to download videos because... it's training data
- 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 zhengiszen
0 subcomment
- Then someday it with require an entire llm installed locally
- Ah! So, that’s why brew no longer updates yt-dlp on my iMac from 2017 ¯\_(ツ)_/¯
by blissofbeing
1 subcomments
- Why deno over bun?
by rbbydotdev
0 subcomment
- great tool for archiving ICE abuses posted on multiple platforms
by LucavagoHellman
0 subcomment
- god damn they the youtube is at fault, always says: forbidden when trying to download a book audiobook