1{
2 aiohttp,
3 apscheduler,
4 beautifulsoup4,
5 brotli,
6 buildPythonPackage,
7 colorama,
8 fetchPypi,
9 httpx,
10 lib,
11 lxml,
12 pillow,
13 pycryptodomex,
14 pyyaml,
15 qrcode,
16 qrcode-terminal,
17 rsa,
18 setuptools,
19 setuptools-scm,
20 tqdm,
21 yarl,
22}:
23buildPythonPackage rec {
24 pname = "bilibili-api-python";
25 version = "16.3.0";
26 pyproject = true;
27
28 src = fetchPypi {
29 pname = "bilibili_api_python";
30 inherit version;
31 hash = "sha256-mwhyFc3b1qA7W76gaBcAup+Wca6gQAdRwZJaZXOHqCw=";
32 };
33
34 postPatch = ''
35 # The upstream uses requirements.txt, which overly strict version constraints.
36 substituteInPlace requirements.txt \
37 --replace-fail "~=" ">="
38 '';
39
40 build-system = [
41 setuptools-scm
42 setuptools
43 ];
44
45 dependencies = [
46 aiohttp
47 beautifulsoup4
48 colorama
49 lxml
50 pyyaml
51 brotli
52 httpx
53 qrcode
54 apscheduler
55 rsa
56 pillow
57 tqdm
58 yarl
59 pycryptodomex
60 qrcode-terminal
61 ];
62
63 # tests require network
64 doCheck = false;
65
66 pythonImportsCheck = [ "bilibili_api" ];
67
68 meta = {
69 changelog = "https://github.com/Nemo2011/bilibili-api/releases/tag/${version}";
70 description = "Python module providing convenient integration for various Bilibili API along with some additional common features";
71 homepage = "https://nemo2011.github.io/bilibili-api";
72 license = lib.licenses.gpl3Plus;
73 maintainers = with lib.maintainers; [ moraxyc ];
74 };
75}