Hey folks.
In the ongoing battle between YouTube and yt-dlp, the latter now needs a whole external Javascript interpreter to be able to “do its magic”.
Upstream yt-dlp suggests using Deno (its the only one that’s auto-detected/enabled by default), but we do not have it on Haiku, and I dislike having such a huge dependency just for this use case.
Fortunately, they also support node (I didn’t even tried with that, again: too big for my taste), and quickjs. I was able to quickly port the last one, confirm it works, and the package is pretty tiny.
So… If you want to download stuff from youtube, you’ll now have to:
- Have an up-to-date
yt-dlpversion. - Have either
quickjsornodeinstalled (pkgman install cmd:qjsorpkgman install cmd:node). - Instruct
yt-dlpto use the desired external JS runtime:yt-dlp --js-runtimes quickjsor
yt-dlp --js-runtimes node. Setting that as an alias in your profile/bashrc might not be a bad idea (alias yt-dlp="yt-dlp --js-runtimes quickjs").
Most basic usage would then be:
> yt-dlp --js-runtimes quickjs <youtube_video_URL_here>
For more info, please consult yt-dlp’s documentation (either on-line, or on the bundled man yt-dlp page).