@Kingu@sakurajima.moe to preveant adblocks and such, youtube added a stong javascript requirement, à la cloudflare.
to bypass it, yt-dl has no other choice but to have a javascript engine to bypass it.
meaning that with a functionnal dom parser, linked with a javascript runtime, yt-dl is now a full headless web browser (kinda)
see:
https://github.com/yt-dlp/yt-dlp/issues/14404