Live data from Hacker News

Bypassing YouTube video download throttling

blog.0x7d0.dev

51–60 of 242 posts

Re: Bypassing YouTube video download throttling

#51

On a sidenote am I imagining things or do videos actually look a tiny bit better in YouTube? This really has puzzled me. I downloaded a few favourites and watch them on VLC or Infuse on my AppleTV. In the YouTube app I can use the "nerd stats" to confirm I am viewing the exact same video/audio streams... ... it could be my imagination but it seems like YouTube does a really subtle kind of filter that makes the "block…

I don't understand your reply.

Why don't you just take a screenshot at the exact same timestamp? It's that easy and would have taken you less time than writing this up.

Re: Bypassing YouTube video download throttling

#52
post #19

I'm constantly suprised when YT deploys another half measure against downloaders when GOOG also owns widevine. I wonder what is their reasons for not using it.

The main reason is that it hits their CDN cache efficiency a bit, which costs money, and it's another set of key management systems to look after and operate and at YouTube's scale you want to minimise them as much as possible.

It also paints a very big target on Widevine Level 3's back.

But ultimately it's just a financial equation. What Google are losing from ad blocking isn't quite worth pulling the WV lever yet, but given it has clearly become enough to take softer measures and the pressure they are likely under from music labels I expect a wider rollout will happen in the next few years.

If I were to predict it will probably initially be "any video containing label music or studio clips picked up by content ID", and maybe an opt in tag for other creators at first. They're the ones that are much more useful for monetisation anyway, and you don't lose all your CDN benefits at once.

Re: Bypassing YouTube video download throttling

#54
post #24

Earlier quoted context omitted.

The only real thing they could try to do is to try enforcing video/IP speed cap. They probably don't due to false positives - for example people jumping around a long video also make may "range" requests. And the other approach is currently in progress - soon logged users won't be able to view videos without watching(or at least displaying/downloading) adds, so the logical next step is to nerf anonymous(as is without…

There’s plenty they could do. They could flip a switch tomorrow and limit access to only signed-in users, and they could further enable DRM, as pretty much by now the majority of users are already on DRM-handicapped platforms. Any will-be-called "legacy" users would just get limited to 480p.

They already lowered bitrates for non premium members.

Re: Bypassing YouTube video download throttling

#55
post #19

I'm constantly suprised when YT deploys another half measure against downloaders when GOOG also owns widevine. I wonder what is their reasons for not using it.

> I wonder what is their reasons for not using it - Introduces a decryption step, which is slow - Forces software video decoding, which is slow - Web browsers only support the weakest form of Widevine which is ineffective It would effectively push a significant portion of their user base off the platform while not being very effective in its goals.

> - Forces software video decoding, which is slow

No it doesn't. Heck, forcing software decoding is actually one of the ways to force Widevine down to lower protection levels on general purpose hardware.

> - Web browsers only support the weakest form of Widevine which is ineffective

It's not fullproof but it would certainly make tools to bypass it clearly illegal in most of the world.

There are efficacy reasons for not doing it on a backend level, but Google has required anything that wants YouTube to support Widevine for a very, very long time now.

Re: Bypassing YouTube video download throttling

#57
post #25

Any guides to learn how to do a similar analysis on other websites?

Which websites?

No, the broader concept of how to dissect the behaviour to figure out the api endpoints called, what was sent to them, what was returned, etc.

Re: Bypassing YouTube video download throttling

#58

"Have you ever tried to download videos from YouTube? I mean manually without relying on software like youtube-dl, yt-dlp or one of "these" websites. It's much more complicated than you might think." This reminds me of some sort of fizzbuzz test. This is not complicated at all. There is no need to use the Range header or run Javascript. The short script below does not download anything because there is no need. It do…

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 /watch?v= page. For example,

    curl -A "" -40s https://www.youtube.com/watch?v=aqz-KE-bpKQ|grep -o https://rr[^\"]*|sed -n 's/\\u0026/\&/g;/itag=22/p'
It's ironic how the author is claiming this is complicated. That's his own doing.

Re: Bypassing YouTube video download throttling

#59

Earlier quoted context omitted.

> I wonder what is their reasons for not using it - Introduces a decryption step, which is slow - Forces software video decoding, which is slow - Web browsers only support the weakest form of Widevine which is ineffective It would effectively push a significant portion of their user base off the platform while not being very effective in its goals.

> - Forces software video decoding, which is slow No it doesn't. Heck, forcing software decoding is actually one of the ways to force Widevine down to lower protection levels on general purpose hardware. > - Web browsers only support the weakest form of Widevine which is ineffective It's not fullproof but it would certainly make tools to bypass it clearly illegal in most of the world. There are efficacy reasons for n…

It may not be illegal in France:

https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI0000...

Re: Bypassing YouTube video download throttling

#60

On a sidenote am I imagining things or do videos actually look a tiny bit better in YouTube? This really has puzzled me. I downloaded a few favourites and watch them on VLC or Infuse on my AppleTV. In the YouTube app I can use the "nerd stats" to confirm I am viewing the exact same video/audio streams... ... it could be my imagination but it seems like YouTube does a really subtle kind of filter that makes the "block…

Maybe the video pipeline in the browser is different compared to the one VLC uses? Can you do a simple HTML document with a element referencing your local file to compare?
Post reply on HN