streamrip: init at 2.0.5

+103
+77
pkgs/by-name/st/streamrip/package.nix
···
··· 1 + { lib 2 + , python3Packages 3 + , fetchFromGitHub 4 + 5 + , ffmpeg 6 + }: 7 + 8 + python3Packages.buildPythonApplication rec { 9 + pname = "streamrip"; 10 + version = "2.0.5"; 11 + pyproject = true; 12 + 13 + src = fetchFromGitHub { 14 + owner = "nathom"; 15 + repo = "streamrip"; 16 + rev = "v${version}"; 17 + hash = "sha256-KwMt89lOPGt6nX7ywliG/iAJ1WnG0CRPwhAVlPR85q0="; 18 + }; 19 + 20 + patches = [ 21 + ./patches/ensure-the-default-config-file-is-writable.patch 22 + ]; 23 + 24 + nativeBuildInputs = with python3Packages; [ 25 + poetry-core 26 + ]; 27 + 28 + propagatedBuildInputs = with python3Packages; [ 29 + aiodns 30 + aiofiles 31 + aiohttp 32 + aiolimiter 33 + appdirs 34 + cleo 35 + click-help-colors 36 + deezer-py 37 + m3u8 38 + mutagen 39 + pathvalidate 40 + pillow 41 + pycryptodomex 42 + pytest-asyncio 43 + pytest-mock 44 + rich 45 + simple-term-menu 46 + tomlkit 47 + tqdm 48 + ]; 49 + 50 + nativeCheckInputs = with python3Packages; [ 51 + pytestCheckHook 52 + ]; 53 + 54 + prePatch = '' 55 + sed -i 's#aiofiles = ".*"#aiofiles = "*"#' pyproject.toml 56 + sed -i 's#deezer-py = ".*"#deezer-py = "*"#' pyproject.toml 57 + sed -i 's#m3u8 = ".*"#m3u8 = "*"#' pyproject.toml 58 + sed -i 's#pathvalidate = ".*"#pathvalidate = "*"#' pyproject.toml 59 + sed -i 's#Pillow = ".*"#Pillow = "*"#' pyproject.toml 60 + sed -i 's#pytest-asyncio = ".*"#pytest-asyncio = "*"#' pyproject.toml 61 + sed -i 's#tomlkit = ".*"#tomlkit = "*"#' pyproject.toml 62 + 63 + sed -i 's#"ffmpeg"#"${lib.getBin ffmpeg}/bin/ffmpeg"#g' streamrip/client/downloadable.py 64 + ''; 65 + 66 + preCheck = '' 67 + export HOME=$(mktemp -d) 68 + ''; 69 + 70 + meta = with lib; { 71 + description = "A scriptable music downloader for Qobuz, Tidal, SoundCloud, and Deezer"; 72 + homepage = "https://github.com/nathom/streamrip"; 73 + license = licenses.gpl3Only; 74 + maintainers = with maintainers; [ paveloom ]; 75 + mainProgram = "rip"; 76 + }; 77 + }
+26
pkgs/by-name/st/streamrip/patches/ensure-the-default-config-file-is-writable.patch
···
··· 1 + From 18efb9b5c8e562b169425f6ba79977e52e8b91b9 Mon Sep 17 00:00:00 2001 2 + From: Pavel Sobolev <paveloomm@gmail.com> 3 + Date: Sat, 13 Jan 2024 12:49:45 +0000 4 + Subject: [PATCH] Ensure the default config file is writable. 5 + 6 + --- 7 + streamrip/config.py | 3 +++ 8 + 1 file changed, 3 insertions(+) 9 + 10 + diff --git a/streamrip/config.py b/streamrip/config.py 11 + index 7ee2f57..88a5fef 100644 12 + --- a/streamrip/config.py 13 + +++ b/streamrip/config.py 14 + @@ -378,6 +378,9 @@ def set_user_defaults(path: str, /): 15 + """Update the TOML file at the path with user-specific default values.""" 16 + shutil.copy(BLANK_CONFIG_PATH, path) 17 + 18 + + # Ensure the default config file is writable 19 + + os.chmod(path, 0o644) 20 + + 21 + with open(path) as f: 22 + toml = parse(f.read()) 23 + toml["downloads"]["folder"] = DEFAULT_DOWNLOADS_FOLDER # type: ignore 24 + -- 25 + 2.42.0 26 +