Mopidy: Difference between revisions
Jaculabilis (talk | contribs) Create Mopidy page with instructions for configuring mopidy-youtube with yt-dlp |
m Fix source code formatting |
||
(One intermediate revision by one other user not shown) | |||
Line 8: | Line 8: | ||
=== mopidy-youtube === | === mopidy-youtube === | ||
By default, the <code>mopidy-youtube</code> extension relies on [https://github.com/ytdl-org/youtube-dl youtube-dl] as the backend for downloading from YouTube, but it can be configured to use a compatible alternative backend such as [https://github.com/yt-dlp/yt-dlp yt-dlp]. Due to the way Mopidy extensions are implemented in nixpkgs, to add another module to the Python environment of <code>mopidy-youtube</code>, the mopidy package set must be overridden like so: | By default, the <code>mopidy-youtube</code> extension relies on [https://github.com/ytdl-org/youtube-dl youtube-dl] as the backend for downloading from YouTube, but it can be configured to use a compatible alternative backend such as [https://github.com/yt-dlp/yt-dlp yt-dlp]. Due to the way Mopidy extensions are implemented in nixpkgs, to add another module to the Python environment of <code>mopidy-youtube</code>, the mopidy package set must be overridden like so: | ||
<syntaxhighlight lang="nix"> | |||
services.mopidy = let | |||
mopidyPackagesOverride = pkgs.mopidyPackages.overrideScope (prev: final: { | |||
extraPkgs = pkgs: [ pkgs.yt-dlp ]; | |||
}); | |||
in { | |||
extensionPackages = with mopidyPackagesOverride; [ | |||
mopidy-youtube | |||
]; | |||
configuration = '' | |||
[youtube] | |||
youtube_dl_package = yt_dlp | |||
''; | |||
} | |||
</syntaxhighlight> | |||
[[Category:Server]] |