1
1
Fork 0

centroid: Add mopidy-youtube with yt-dlp stitched in

This commit is contained in:
Tim Van Baak 2024-01-20 04:04:59 +00:00
parent 612fcb7dce
commit 89e1752d0e
2 changed files with 66 additions and 1 deletions

View File

@ -43,15 +43,22 @@
"mopidy"
"pipewire" # necessary to allow the system service to play sound
];
services.mopidy = {
services.mopidy = let
mopidy-ytdlp = pkgs.callPackage ./mopidy-youtube.nix { };
in {
enable = true;
extensionPackages = with pkgs; [
mopidy-musicbox-webclient
# Replace the default mopidy-youtube, which doesn't have yt-dlp or a way to inject it
mopidy-ytdlp
];
configuration = ''
[file]
media_dirs =
/media/music|Music
[youtube]
youtube_dl_package = yt_dlp
'';
};

View File

@ -0,0 +1,58 @@
{ lib
, fetchFromGitHub
, python3
, mopidy
}:
python3.pkgs.buildPythonApplication rec {
pname = "mopidy-youtube";
version = "3.6";
format = "setuptools";
src = fetchFromGitHub {
owner = "natumbri";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-Mp8eCVNGokJRwmYiZYCYRwV1QVDV02Uqfh6fGcPgJss=";
};
propagatedBuildInputs = with python3.pkgs; [
beautifulsoup4
cachetools
pykka
requests
youtube-dl # this no longer works
yt-dlp # <- added
ytmusicapi
] ++ [
mopidy
];
nativeCheckInputs = with python3.pkgs; [
vcrpy
pytestCheckHook
];
disabledTests = [
# Test requires a YouTube API key
"test_get_default_config"
];
disabledTestPaths = [
# Disable tests which interact with Youtube
"tests/test_api.py"
"tests/test_backend.py"
"tests/test_youtube.py"
];
pythonImportsCheck = [
"mopidy_youtube"
];
meta = with lib; {
description = "Mopidy extension for playing music from YouTube";
homepage = "https://github.com/natumbri/mopidy-youtube";
license = licenses.asl20;
maintainers = with maintainers; [ ];
};
}