Comment by sylware

3 years ago

Nowadays "javascript" refers to the scriptable, grotesquely and absurdely complex and massive web engines, aka google financed blink and geeko, then apple financed webkit, that with their SDK.

The currently obfuscated javascript media players will try to break yt-dlp by leveraging the complexity and size of those scripted web engines. They will make them out of reach to small teamns or individuals and it is even "better", it will force ppl to use apple or google web engine, killing any attempt to provide a real alternative.

A standalone javascript interpreter is actually some work, but seems to stay in the "reasonable" realm: look at quickjs from M. Bellard and friends (the guy who created qemu, ffmpeg, tinycc, etc): plain and simple C (no need of a c++ compiler), doing the job more that well enough.

That's why noscript/basic (x)html is so much important.

> but seems to stay in the "reasonable" realm

> M. Bellard and friends

Chose one, that dude is a wizard wielding c like a brain surgeon wields a scalpel.

Yeah I agree with almost all of this - the massive size and complexity of commercial engines makes it seem like JS the language must also be complex.

I also agree with the idea that these sites will probably be able to/want to create JS that breaks these small/lightweight engines requiring constant work :-/

This final point I disagree with entirely. You can't point to Bellard doing something as evidence that it's reasonable. This is a guy that wrote a program that generated a TV signal via a VGA card. :D

> quickjs from M. Bellard and friends

Is the M key next to the F key on your particular keyboard by chance? Because I've always called him "Fabrice."

https://en.wikipedia.org/wiki/Fabrice_Bellard

Chrome and Safari both have open source JS engines…

  • That's beside the point. Open-source is not useful to the smaller players if it is too complex to comprehend and constantly churned.

    • That's not the case, though. There are even python modules that let you evaluate JS code in v8 (Chrome's JS interpreter). It'd be pretty trivial for youtube-dl to make use of that if the author thought it was worth doing.

      1 reply →

ah, but quickjs is an actual js engine. I have tried a couple of versions with real progress between them. This thing here is not