diff --git a/pkgs/development/python-modules/pytube/default.nix b/pkgs/development/python-modules/pytube/default.nix new file mode 100644 index 000000000000..f47e6af16c0a --- /dev/null +++ b/pkgs/development/python-modules/pytube/default.nix @@ -0,0 +1,34 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, typing-extensions +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "pytube"; + version = "10.6.1"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "pytube"; + repo = "pytube"; + rev = "v${version}"; + sha256 = "sha256-b0tN4m3/+K243zQ7L4wW4crk9r69Tj64is6C4I5oFZU="; + }; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "pytube" ]; + + meta = with lib; { + description = "Python 3 library for downloading YouTube Videos"; + homepage = "https://github.com/nficano/pytube"; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/rapidfuzz/default.nix b/pkgs/development/python-modules/rapidfuzz/default.nix new file mode 100644 index 000000000000..225f743904d5 --- /dev/null +++ b/pkgs/development/python-modules/rapidfuzz/default.nix @@ -0,0 +1,47 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, pytestCheckHook +, hypothesis +, pandas +}: + +buildPythonPackage rec { + pname = "rapidfuzz"; + version = "1.3.3"; + + disabled = pythonOlder "3.5"; + + src = fetchFromGitHub { + owner = "maxbachmann"; + repo = "RapidFuzz"; + rev = "v${version}"; + fetchSubmodules = true; + sha256 = "1k28mycf945zp5kkdm4anjqac8ysmp0pabyjg96xww8hnlwmqcnf"; + }; + + checkInputs = [ + pytestCheckHook + hypothesis + pandas + ]; + + disabledTests = [ + "test_levenshtein_block" # hypothesis data generation too slow + ]; + + pythonImportsCheck = [ + "rapidfuzz.fuzz" + "rapidfuzz.string_metric" + "rapidfuzz.process" + "rapidfuzz.utils" + ]; + + meta = with lib; { + description = "Rapid fuzzy string matching"; + homepage = "https://github.com/maxbachmann/rapidfuzz"; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/tools/audio/spotdl/default.nix b/pkgs/tools/audio/spotdl/default.nix new file mode 100644 index 000000000000..520af8404aeb --- /dev/null +++ b/pkgs/tools/audio/spotdl/default.nix @@ -0,0 +1,47 @@ +{ lib +, python3 +, fetchFromGitHub +, ffmpeg +}: + +python3.pkgs.buildPythonApplication rec { + pname = "spotdl"; + version = "3.5.0"; + + src = fetchFromGitHub { + owner = "spotDL"; + repo = "spotify-downloader"; + rev = "v${version}"; + sha256 = "1nxf911hi578jw24hlcvyy33z1pkvr41pfrywbs3157rj1fj2vfi"; + }; + + propagatedBuildInputs = with python3.pkgs; [ + spotipy + pytube + rich + rapidfuzz + mutagen + ytmusicapi + tqdm + beautifulsoup4 + requests + ]; + + checkInputs = with python3.pkgs; [ + pytestCheckHook + pytest-mock + pytest-vcr + pyfakefs + ]; + + 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"; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d6d875e892a4..97d766ed52bf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8322,6 +8322,8 @@ in splot = haskell.lib.justStaticExecutables haskellPackages.splot; + spotdl = callPackage ../tools/audio/spotdl { }; + squashfsTools = callPackage ../tools/filesystems/squashfs { }; squashfs-tools-ng = callPackage ../tools/filesystems/squashfs-tools-ng { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6a4c9cb5647d..3503c37f5e71 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6905,6 +6905,8 @@ in { pytricia = callPackage ../development/python-modules/pytricia { }; + pytube = callPackage ../development/python-modules/pytube { }; + pytun = callPackage ../development/python-modules/pytun { }; pytz = callPackage ../development/python-modules/pytz { }; @@ -7114,6 +7116,8 @@ in { random2 = callPackage ../development/python-modules/random2 { }; + rapidfuzz = callPackage ../development/python-modules/rapidfuzz { }; + rarfile = callPackage ../development/python-modules/rarfile { inherit (pkgs) libarchive; };