News for hackers. Stuff that matters.
Re:YouTube-dl has an interpreter for a subset of JavaScript ... by sylware on Saturday September 10, 2022 @02:59PM (#32793560)
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.

Re:YouTube-dl has an interpreter for a subset of JavaScript ... by dtx1 on Saturday September 10, 2022 @03:05PM (#32793627)
> 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.

Re:YouTube-dl has an interpreter for a subset of JavaScript ... by olliej on Saturday September 10, 2022 @03:07PM (#32793644)
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

Re:YouTube-dl has an interpreter for a subset of JavaScript ... by axiolite on Saturday September 10, 2022 @10:36PM (#32796368)
> 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

Re:YouTube-dl has an interpreter for a subset of JavaScript ... by a_e_k on Sunday September 11, 2022 @01:48AM (#32797148)
Could just be the usual abbreviation for Monsieur.
Re:YouTube-dl has an interpreter for a subset of JavaScript ... by ganjatech on Sunday September 11, 2022 @01:52AM (#32797169)
Monsieur Bellard - M. Bellard
Re:YouTube-dl has an interpreter for a subset of JavaScript ... by sylware on Sunday September 11, 2022 @12:03PM (#32800770)
Yeah... M = Monsieur (in french, namely Mister in english), I forgot the 'r'... I should have written Mr. Bellard, I kneel upon the weight of my apology.
Re:YouTube-dl has an interpreter for a subset of JavaScript ... by randyrand on Saturday September 10, 2022 @03:32PM (#32793893)
Chrome and Safari both have open source JS engines…
Re:YouTube-dl has an interpreter for a subset of JavaScript ... by userbinator on Saturday September 10, 2022 @05:12PM (#32794617)
That's beside the point. Open-source is not useful to the smaller players if it is too complex to comprehend and constantly churned.
Re:YouTube-dl has an interpreter for a subset of JavaScript ... by kelnos on Saturday September 10, 2022 @08:15PM (#32795665)
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.
Re:YouTube-dl has an interpreter for a subset of JavaScript ... by sylware on Sunday September 11, 2022 @12:00PM (#32800748)
It is the case, not too mention v8 pulls in an extremely expensive c++ compiler in the SDK while quickjs can compile with tinycc.

Open source is not enough anymore, "lean" open source is the way now, SDK included.

Re:YouTube-dl has an interpreter for a subset of JavaScript ... by oblak on Saturday September 10, 2022 @04:21PM (#32794290)
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
Re:YouTube-dl has an interpreter for a subset of JavaScript ... by languageserver on Saturday September 10, 2022 @03:49PM (#32794058)
> That's why noscript/basic (x)html is so much important.

xhtml has been dead for a decade