2021-04-05 15:23:46 +00:00
|
|
|
{ lib
|
|
|
|
, python3
|
2023-07-15 17:15:38 +00:00
|
|
|
, fetchPypi
|
2021-04-05 15:23:46 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, ffmpeg
|
|
|
|
}:
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
let
|
|
|
|
python = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
ytmusicapi = super.ytmusicapi.overridePythonAttrs (old: rec {
|
|
|
|
version = "0.25.1";
|
2023-07-15 17:15:38 +00:00
|
|
|
src = fetchPypi {
|
2023-05-24 13:37:59 +00:00
|
|
|
inherit (old) pname;
|
|
|
|
inherit version;
|
|
|
|
hash = "sha256-uc/fgDetSYaCRzff0SzfbRhs3TaKrfE2h6roWkkj8yQ=";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in python.pkgs.buildPythonApplication rec {
|
2021-04-05 15:23:46 +00:00
|
|
|
pname = "spotdl";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "4.2.0";
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
format = "pyproject";
|
2021-04-05 15:23:46 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "spotDL";
|
|
|
|
repo = "spotify-downloader";
|
2022-05-18 14:49:53 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-miIDasbOKmfYESiEIlMxEUfPkLLBz4s1rX2eMz3MrzA=";
|
2021-04-05 15:23:46 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeBuildInputs = with python.pkgs; [
|
2022-12-28 21:21:41 +00:00
|
|
|
poetry-core
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonRelaxDeps = true;
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
2021-04-05 15:23:46 +00:00
|
|
|
spotipy
|
|
|
|
ytmusicapi
|
2022-12-28 21:21:41 +00:00
|
|
|
pytube
|
2022-04-27 09:35:20 +00:00
|
|
|
yt-dlp
|
2022-12-28 21:21:41 +00:00
|
|
|
mutagen
|
|
|
|
rich
|
2021-04-05 15:23:46 +00:00
|
|
|
beautifulsoup4
|
|
|
|
requests
|
2022-12-28 21:21:41 +00:00
|
|
|
rapidfuzz
|
|
|
|
python-slugify
|
|
|
|
uvicorn
|
|
|
|
pydantic
|
|
|
|
fastapi
|
|
|
|
platformdirs
|
2023-03-04 12:14:45 +00:00
|
|
|
pykakasi
|
|
|
|
syncedlyrics
|
2023-05-24 13:37:59 +00:00
|
|
|
typing-extensions
|
2023-07-15 17:15:38 +00:00
|
|
|
soundcloud-v2
|
|
|
|
bandcamp-api
|
2023-05-24 13:37:59 +00:00
|
|
|
setuptools # for pkg_resources
|
|
|
|
] ++ python-slugify.optional-dependencies.unidecode;
|
2021-04-05 15:23:46 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeCheckInputs = with python.pkgs; [
|
2021-04-05 15:23:46 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-mock
|
|
|
|
pytest-vcr
|
|
|
|
pyfakefs
|
2021-04-12 18:23:04 +00:00
|
|
|
pytest-subprocess
|
2021-04-05 15:23:46 +00:00
|
|
|
];
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# require networking
|
|
|
|
"tests/test_init.py"
|
|
|
|
"tests/test_matching.py"
|
|
|
|
"tests/utils/test_m3u.py"
|
|
|
|
"tests/utils/test_metadata.py"
|
|
|
|
"tests/utils/test_search.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# require networking
|
|
|
|
"test_album_from_string"
|
|
|
|
"test_album_from_url"
|
|
|
|
"test_album_length"
|
|
|
|
"test_artist_from_string"
|
2023-07-15 17:15:38 +00:00
|
|
|
"test_artist_from_url"
|
2022-12-28 21:21:41 +00:00
|
|
|
"test_convert"
|
|
|
|
"test_download_ffmpeg"
|
|
|
|
"test_download_song"
|
|
|
|
"test_playlist_from_string"
|
|
|
|
"test_playlist_from_url"
|
|
|
|
"test_playlist_length"
|
|
|
|
"test_preload_song"
|
|
|
|
"test_song_from_search_term"
|
|
|
|
"test_song_from_url"
|
2023-07-15 17:15:38 +00:00
|
|
|
"test_yt_search"
|
2022-12-28 21:21:41 +00:00
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
makeWrapperArgs = [
|
|
|
|
"--prefix" "PATH" ":" (lib.makeBinPath [ ffmpeg ])
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Download your Spotify playlists and songs along with album art and metadata";
|
|
|
|
homepage = "https://github.com/spotDL/spotify-downloader";
|
2023-03-04 12:14:45 +00:00
|
|
|
changelog = "https://github.com/spotDL/spotify-downloader/releases/tag/v${version}";
|
2021-04-05 15:23:46 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|