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 requests,
18 rsa,
19 setuptools,
20 setuptools-scm,
21 tqdm,
22 yarl,
23}:
24buildPythonPackage rec {
25 pname = "bilibili-api-python";
26 version = "16.2.0";
27 pyproject = true;
28
29 src = fetchPypi {
30 inherit pname version;
31 hash = "sha256-ecv9lzp2L13seBosahgnglaZP8YZCD/13nlTPP8LCs0=";
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 requests
55 apscheduler
56 rsa
57 pillow
58 tqdm
59 yarl
60 pycryptodomex
61 qrcode-terminal
62 ];
63
64 # tests require network
65 doCheck = false;
66
67 pythonImportsCheck = [ "bilibili_api" ];
68
69 meta = {
70 changelog = "https://github.com/Nemo2011/bilibili-api/releases/tag/${version}";
71 description = "Python module providing convenient integration for various Bilibili API along with some additional common features";
72 homepage = "https://nemo2011.github.io/bilibili-api";
73 license = lib.licenses.gpl3Plus;
74 maintainers = with lib.maintainers; [ moraxyc ];
75 };
76}