2021-03-27 12:30:21 +00:00
|
|
|
{ lib
|
|
|
|
, python3
|
2023-05-25 16:03:52 +00:00
|
|
|
, fetchPypi
|
2021-03-27 12:30:21 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, ffmpeg
|
|
|
|
}:
|
|
|
|
|
2023-04-29 03:03:25 +00:00
|
|
|
let
|
|
|
|
python = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
ytmusicapi = super.ytmusicapi.overridePythonAttrs (old: rec {
|
|
|
|
version = "0.25.1";
|
2023-05-25 16:03:52 +00:00
|
|
|
src = fetchPypi {
|
2023-04-29 03:03:25 +00:00
|
|
|
inherit (old) pname;
|
|
|
|
inherit version;
|
|
|
|
hash = "sha256-uc/fgDetSYaCRzff0SzfbRhs3TaKrfE2h6roWkkj8yQ=";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in python.pkgs.buildPythonApplication rec {
|
2021-03-27 12:30:21 +00:00
|
|
|
pname = "spotdl";
|
2023-07-12 02:00:04 +00:00
|
|
|
version = "4.2.0";
|
2022-12-16 19:34:58 +00:00
|
|
|
|
|
|
|
format = "pyproject";
|
2021-03-27 12:30:21 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "spotDL";
|
|
|
|
repo = "spotify-downloader";
|
2022-05-12 18:19:22 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-07-12 02:00:04 +00:00
|
|
|
hash = "sha256-miIDasbOKmfYESiEIlMxEUfPkLLBz4s1rX2eMz3MrzA=";
|
2021-03-27 12:30:21 +00:00
|
|
|
};
|
|
|
|
|
2023-04-29 03:03:25 +00:00
|
|
|
nativeBuildInputs = with python.pkgs; [
|
2022-12-16 19:34:58 +00:00
|
|
|
poetry-core
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonRelaxDeps = true;
|
|
|
|
|
2023-04-29 03:03:25 +00:00
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
2021-03-27 12:30:21 +00:00
|
|
|
spotipy
|
|
|
|
ytmusicapi
|
2022-12-16 19:34:58 +00:00
|
|
|
pytube
|
2022-04-17 02:38:00 +00:00
|
|
|
yt-dlp
|
2022-12-16 19:34:58 +00:00
|
|
|
mutagen
|
|
|
|
rich
|
2021-03-27 12:30:21 +00:00
|
|
|
beautifulsoup4
|
|
|
|
requests
|
2022-12-16 19:34:58 +00:00
|
|
|
rapidfuzz
|
|
|
|
python-slugify
|
|
|
|
uvicorn
|
|
|
|
pydantic
|
|
|
|
fastapi
|
|
|
|
platformdirs
|
2023-02-25 08:47:35 +00:00
|
|
|
pykakasi
|
|
|
|
syncedlyrics
|
2023-04-29 03:03:25 +00:00
|
|
|
typing-extensions
|
2023-07-12 02:00:04 +00:00
|
|
|
soundcloud-v2
|
|
|
|
bandcamp-api
|
2023-04-29 03:03:25 +00:00
|
|
|
setuptools # for pkg_resources
|
2023-05-16 17:15:40 +00:00
|
|
|
] ++ python-slugify.optional-dependencies.unidecode;
|
2021-03-27 12:30:21 +00:00
|
|
|
|
2023-04-29 03:03:25 +00:00
|
|
|
nativeCheckInputs = with python.pkgs; [
|
2021-03-27 12:30:21 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-mock
|
|
|
|
pytest-vcr
|
|
|
|
pyfakefs
|
2021-04-09 11:26:58 +00:00
|
|
|
pytest-subprocess
|
2021-03-27 12:30:21 +00:00
|
|
|
];
|
|
|
|
|
2022-12-16 19:34:58 +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-06-25 19:06:39 +00:00
|
|
|
"test_artist_from_url"
|
2022-12-16 19:34:58 +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-06-25 19:06:39 +00:00
|
|
|
"test_yt_search"
|
2022-12-16 19:34:58 +00:00
|
|
|
];
|
2021-05-18 15:55:08 +00:00
|
|
|
|
2021-03-27 12:30:21 +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-02-24 22:11:59 +00:00
|
|
|
changelog = "https://github.com/spotDL/spotify-downloader/releases/tag/v${version}";
|
2021-03-27 12:30:21 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|