Remix.run Logo
progbits 3 days ago

Can anyone explain specifically what the YT code does that the existing python interpreter is unusable and apparently quickjs takes 20 minutes to run it?

Is it just a lot of CPU-bound code and the modern JIT runtimes are simply that much faster, or is it doing some trickery that deno optimizes well?

progbits 3 days ago | parent | next [-]

From https://github.com/ytdl-org/youtube-dl/issues/33186

> Currently, a new style of player JS is beginning to be sent where the challenge code is no longer modular but is hooked into other code throughout the player JS.

So it's no longer a standalone script that can be interpreted but it depends on all the other code on the site? Which could still be interpreted maybe but is a lot more complex and might need DOM etc?

Just guessing here, if anyone knows the details would love to hear more.

zenmac 3 days ago | parent | next [-]

Yeah that is guess google using spaghetti code to keep their yt moat.

Chris2048 3 days ago | parent | prev | next [-]

Could something like tree-shaking be used to reduce the player code to just the token generating bit? Or does the whole player js change for each video?

zelphirkalt 3 days ago | parent | prev [-]

Sounds like a really silly way to engineer things, but then again Google has the workforce to do lots of silly things and the cash to burn, so they can afford it.

Klonoar 3 days ago | parent [-]

It's silly from an engineering perspective, but unfortunately clever from YT's perspective of "how do we complicate this as much as possible".

ACCount37 3 days ago | parent | prev [-]

YouTube is mining cry-

I mean, running some unknown highly obfuscated CPU-demanding JS code on your machine - and using its results to decide whether to permit or deny video downloads.

The enshittification will continue until user morale improves.

johnisgood 3 days ago | parent [-]

And at the same time we are against websites mining crypto. At this point they could do that, too...