Changes on yt-dlp

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-dlp version.
  • Have either quickjs or node installed (pkgman install cmd:qjs or pkgman install cmd:node).
  • Instruct yt-dlp to use the desired external JS runtime: yt-dlp --js-runtimes quickjs or
    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).

13 Likes

That’s a great write-up, thanks!

Setting that as an alias in your profile/bashrc might not be a bad idea (alias yt-dlp="yt-dlp --js-runtimes quickjs").

Alternatively, one might place this flag in the yt-dlp config file.

1 Like