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