2020-10-15 19:05:13 +11:00
|
|
|
{ stdenv
|
2021-02-01 08:45:20 +11:00
|
|
|
, lib
|
2020-10-15 19:05:13 +11:00
|
|
|
, fetchFromGitHub
|
|
|
|
|
2022-01-25 10:18:28 +11:00
|
|
|
, python3Packages
|
|
|
|
, lame
|
2020-10-15 19:05:13 +11:00
|
|
|
|
2022-10-26 10:50:59 +11:00
|
|
|
, aacSupport ? false
|
|
|
|
, faac
|
|
|
|
, alacSupport ? false
|
|
|
|
, libav
|
|
|
|
, flacSupport ? false
|
|
|
|
, flac
|
|
|
|
, m4aSupport ? false
|
|
|
|
, mp4Support ? false
|
|
|
|
, fdk-aac-encoder
|
|
|
|
, oggSupport ? false
|
|
|
|
, vorbisTools
|
|
|
|
, opusSupport ? false
|
|
|
|
, opusTools
|
2020-10-15 19:05:13 +11:00
|
|
|
}:
|
|
|
|
|
2022-10-26 10:50:59 +11:00
|
|
|
assert aacSupport -> faac.meta.available;
|
|
|
|
assert alacSupport -> libav.meta.available;
|
|
|
|
assert flacSupport -> flac.meta.available;
|
2020-10-15 19:05:13 +11:00
|
|
|
assert m4aSupport || mp4Support -> fdk-aac-encoder.meta.available;
|
2022-10-26 10:50:59 +11:00
|
|
|
assert oggSupport -> vorbisTools.meta.available;
|
|
|
|
assert opusSupport -> opusTools.meta.available;
|
2020-10-15 19:05:13 +11:00
|
|
|
|
2022-01-25 10:18:28 +11:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2020-10-15 19:05:13 +11:00
|
|
|
pname = "spotify-ripper";
|
2022-01-25 10:18:28 +11:00
|
|
|
version = "20210724.5bfd3f7";
|
2020-10-15 19:05:13 +11:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-01-25 10:18:28 +11:00
|
|
|
owner = "ast261";
|
2020-10-15 19:05:13 +11:00
|
|
|
repo = pname;
|
2022-01-25 10:18:28 +11:00
|
|
|
rev = "5bfd3f7a52f2767b433fd315145409837a3c33f0";
|
|
|
|
sha256 = "sha256-LLunGzs9Mg4S00Su260b+M5w/XwS+kICl/YXQdR/cPI=";
|
2020-10-15 19:05:13 +11:00
|
|
|
};
|
|
|
|
|
2022-01-25 10:18:28 +11:00
|
|
|
propagatedBuildInputs = (with python3Packages; [
|
2020-10-15 19:05:13 +11:00
|
|
|
colorama
|
|
|
|
mutagen
|
|
|
|
pyspotify
|
2020-10-17 12:47:43 +11:00
|
|
|
requests
|
|
|
|
schedule
|
|
|
|
setuptools
|
2022-01-25 10:18:28 +11:00
|
|
|
spotipy
|
2020-10-17 12:47:43 +11:00
|
|
|
]) ++ [
|
2022-01-25 10:18:28 +11:00
|
|
|
lame
|
2020-10-15 19:05:13 +11:00
|
|
|
(if flacSupport then flac else null)
|
|
|
|
(if alacSupport then libav else null)
|
|
|
|
(if aacSupport then faac else null)
|
|
|
|
(if (m4aSupport || mp4Support) then fdk-aac-encoder else null)
|
|
|
|
(if oggSupport then vorbisTools else null)
|
|
|
|
(if opusSupport then opusTools else null)
|
|
|
|
];
|
|
|
|
|
|
|
|
# Remove impure executables.
|
|
|
|
patches = [ ./fix-setup.patch ];
|
|
|
|
|
2021-02-01 08:45:20 +11:00
|
|
|
meta = with lib; {
|
2020-10-15 19:05:13 +11:00
|
|
|
description = "Rip Spotify URIs to audio files, including ID3 tags and cover art";
|
|
|
|
longDescription = ''
|
|
|
|
Spotify-ripper is a small ripper script for Spotify that rips Spotify URIs
|
|
|
|
to audio files and includes ID3 tags and cover art. By default
|
|
|
|
spotify-ripper will encode to MP3 files, but includes the ability to rip
|
|
|
|
to WAV, FLAC, Ogg Vorbis, Opus, AAC, and MP4/M4A.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/hbashton/spotify-ripper";
|
2020-10-17 16:20:37 +11:00
|
|
|
# spotify-ripper itself is MIT, but the upstream libspotify is unfree.
|
2021-02-01 08:45:20 +11:00
|
|
|
license = licenses.unfree;
|
2020-10-15 19:05:13 +11:00
|
|
|
};
|
|
|
|
}
|