I've never tried YouTube, but I have downloaded videos from sketchier streaming websites using the web developer tools. Almost all of them have the same protection: some code that triggers only when you open the tools and stops the video by creating a debugger statement you cannot skip and triggering some cpu-heavy code (probably an infinite loop, although I wouldn't discard cryptominers). More importantly this code…
Bypassing YouTube video download throttling
101–110 of 242 posts
Re: Bypassing YouTube video download throttling
#102Earlier quoted context omitted.
>Almost all of them have the same protection: some code that triggers only when you open the tools and stops the video by creating a debugger statement you cannot skip If you missed it, not so long ago there was a submission that evaded exactly this. Their solution is so simple yet effective: Recompiling the browser with the debugger keyword renamed. Made me smile. https://news.ycombinator.com/item?id=36961445
Honestly recompilation shouldn't even be necessary, browsers should just let us disable the debugger statement when "clever" sites start taking advantage of it. This usage of debuggers to circumvent our tools is abuse and should be literally impossible unless we consent to it. Our computers are our realms. God giveth and god taketh away.
Re: Bypassing YouTube video download throttling
#103Re: Bypassing YouTube video download throttling
#104Re: Bypassing YouTube video download throttling
#105Earlier quoted context omitted.
I don't think youtube really cares if you pirate their content or use a 3rd party client. What they care about is you wasting their bandwidth. For an ad-supported video streaming site, bandwidth is normally more expensive than revenue - Google only manages to make it just about work because they have probably the worlds cheapest bandwidth due to being able to bully ISP's into peering with them for free. (they don't l…
Sooner or later, youtube will do the same thing as twitch, which is to dynamically splice ads into the video stream - making it impossible to block with current mechanisms. They don't do it yet, probably because they don't see the need quite yet. But i have no doubts that it will happen sooner or later. Adblocking will have to evolve to a new level to block such things.
Anyway, when they start delivering ads in-band, the next step for blockers is to identify that first keyframe in the player by using a pool of shared signatures, right? So then player clients will need adblock plugins which will have a sizeable signature distribution infra and grief for clients.
Then the anti-blocker might begin adding, per-play instead of per-video, a pixel or something to throw off the signatures, massively increasing THEIR video distribution infra. Ad infinitum?
Re: Bypassing YouTube video download throttling
#106Anyone else having throttling problems with yt-dlp lately? I always watch youtube through mpv that uses yt-dlp on the background, but last week it's been terrible. It starts quickly (I've throttled it to 500kBps so that's the starting speed) but then after a while I'm getting a second of stream for three seconds of download, so I gotta queue up the video long time before playing. I'm using git version of yt-dlp and h…
Re: Bypassing YouTube video download throttling
#107Earlier quoted context omitted.
> Companies do not have ethics, only interests. While that's certainly true (although an simplification - they are just managed by people with low ethics), we can do better. If I behaved like managers of Google, Meta or Microsoft, I'd be ashamed of myself.
I despise this philosophy. Megacorps are shit, so we should be better than them? It's a popular theme because it makes one feel like they have control over the world around them: they just have to be better than it. No. I shouldn't have to work harder myself to somehow cancel out the evil in the world. Because if we were less cowards and calling them for what they are - evil - they wouldn't hold so much power over us…
Exactly, if we held public demonstrations outside the offices of book publishers, Sony, RIAA, and similar greedy bastards, and it became the norm to snub our noses at their employees then things would soon change.
For instance, we ought to be demonstrating in the streets over how these bastards are hounding the Internet Archive, but we're not.
If we were, then these companies would quickly change their tune and think twice before launching such lawsuits.
Trouble is we're not out there demonstrating. And it's only a tiny minority of the population who actually care about such things—those of us posting here on HN etc.—who do. We're such a small force we couldn't escape from a wet paper bag on the deck of a sinking ship let alone take on the might of these greedy corporations.
Cory Doctorow has said this many times although he's not been as blunt about it as I am. I've followed this for decades and I reckon it's essentially a lost cause.
Even if we could get politicians to agree to change laws they could only do so around the edges as they've signed international treaties, Berne, WIPO, etc. which prohibit signatories from exiting. Any country that left the treaties would have sanctions placed against it.
These corporations have not only won but they've implemented a system that's irreversible, like a ratchet, every one of their cog-like actions squeezes us consumers further and there's fuck-all we can do about it.
Re: Bypassing YouTube video download throttling
#108Earlier quoted context omitted.
Looks interesting. In the post, the author does echo -n '{"videoId":"aqz-KE-bpKQ","context":{"client":{"clientName":"WEB","clientVersion":"2.20230810.05.00"}}}' | http post 'https://www.youtube.com/youtubei/v1/player' | jq -r '.streamingData.adaptiveFormats[0].url' which is very similar to what you do, but runs into an issue of throttling to ~70Kbps. Is the difference just the "key" parameter? Do you get no throttlin…
There is no throttling when using the JSON returned by the HTTP request in the shell script or generated by the utilities I wrote. it's not the key the author is using, it's the post-data. Moreover, to get throttled videoplayback URLs with the "WEB" key and client info like the author is using, one does not need to make POST requests to /youtubei/v1/player. There are throttled videoplayback URLs in the HTML of the /w…
curl 'https://...googlevideo.com...' --output video.mp4
for me the download is throttled to "768k", i assume thats in bits per second and not bytes which is very low: the random video i tried would take 8 minutes.on the other hand,
yt-dlp videoIdHere
does its processing then downloads the whole thing in about 5 seconds.Does that curl command run much faster for you? Or do you do something else?
Re: Bypassing YouTube video download throttling
#109Earlier quoted context omitted.
Looks interesting. In the post, the author does echo -n '{"videoId":"aqz-KE-bpKQ","context":{"client":{"clientName":"WEB","clientVersion":"2.20230810.05.00"}}}' | http post 'https://www.youtube.com/youtubei/v1/player' | jq -r '.streamingData.adaptiveFormats[0].url' which is very similar to what you do, but runs into an issue of throttling to ~70Kbps. Is the difference just the "key" parameter? Do you get no throttlin…
There is no throttling when using the JSON returned by the HTTP request in the shell script or generated by the utilities I wrote. it's not the key the author is using, it's the post-data. Moreover, to get throttled videoplayback URLs with the "WEB" key and client info like the author is using, one does not need to make POST requests to /youtubei/v1/player. There are throttled videoplayback URLs in the HTML of the /w…
However, acquiring this key requires decompiling the mobile application, monitoring requests through a proxy, or relying on values discovered by others. It's not necessarily straightforward.
I do agree that the code is simpler this way.
I also find it interesting that, by default, yt-dlp calls the YouTube API three times, initially as an Android client, then as an iOS client, and finally as a Web client. Depending on the video and certain other parameters, YouTube provides different formats to different clients.
Re: Bypassing YouTube video download throttling
#110Not trying to be a sketchy contrarian, but why would you do this with JavaScript? It just doesn't seem very fit for purpose...