qqmusic-api-python 0.1.9__tar.gz → 0.1.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/PKG-INFO +18 -30
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/README.md +14 -25
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/pyproject.toml +1 -1
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/__init__.py +6 -1
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/utils/network.py +4 -2
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/utils/qimei.py +4 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/LICENSE +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/album.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/data/api/album.json +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/data/api/login.json +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/data/api/lyric.json +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/data/api/mv.json +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/data/api/search.json +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/data/api/singer.json +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/data/api/song.json +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/data/api/songlist.json +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/data/api/top.json +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/data/api/user.json +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/data/file_type.json +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/data/search_type.json +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/exceptions/__init__.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/exceptions/api_exception.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/login.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/login_utils.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/lyric.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/mv.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/search.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/singer.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/song.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/songlist.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/top.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/user.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/utils/__init__.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/utils/credential.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/utils/sync.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/utils/tripledes.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/utils/utils.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/tests/conftest.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/tests/test_album.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/tests/test_login.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/tests/test_lyric.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/tests/test_mv.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/tests/test_qimei.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/tests/test_search.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/tests/test_singer.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/tests/test_song.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/tests/test_songlist.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/tests/test_top.py +0 -0
- {qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/tests/test_user.py +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: qqmusic-api-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.11
|
|
4
4
|
Summary: QQ音乐API封装库
|
|
5
5
|
Keywords: music,api,qqmusic,tencentmusic
|
|
6
|
-
Home-page: https://github.com/luren-dc/QQMusicApi
|
|
7
6
|
Author-Email: Luren <68656403+luren-dc@users.noreply.github.com>
|
|
8
7
|
Maintainer-Email: Luren <68656403+luren-dc@users.noreply.github.com>
|
|
9
8
|
License: MIT
|
|
@@ -17,9 +16,9 @@ Classifier: Programming Language :: Python :: 3 :: Only
|
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.9
|
|
18
17
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
19
18
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
-
Project-URL:
|
|
21
|
-
Project-URL:
|
|
22
|
-
Project-URL:
|
|
19
|
+
Project-URL: homepage, https://github.com/luren-dc/QQMusicApi
|
|
20
|
+
Project-URL: repository, https://github.com/luren-dc/QQMusicApi
|
|
21
|
+
Project-URL: documentation, https://github.com/luren-dc/QQMusicApi
|
|
23
22
|
Requires-Python: <3.13,>=3.9
|
|
24
23
|
Requires-Dist: cryptography<42.0.0,>=41.0.2
|
|
25
24
|
Requires-Dist: typing-extensions>=4.12.2
|
|
@@ -27,34 +26,29 @@ Requires-Dist: httpx>=0.27.0
|
|
|
27
26
|
Description-Content-Type: text/markdown
|
|
28
27
|
|
|
29
28
|
<div align="center">
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
<a href="https://www.python.org">
|
|
33
|
-
<img src="https://img.shields.io/badge/python-3.9|3.10|3.11|3.12-blue" alt="Python">
|
|
34
|
-
</a>
|
|
35
|
-
<a href="https://github.com/astral-sh/ruff">
|
|
36
|
-
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
|
|
29
|
+
<a>
|
|
30
|
+
<img src="https://socialify.git.ci/luren-dc/QQMusicApi/image?description=1&font=Source%20Code%20Pro&language=1&logo=https%3A%2F%2Fy.qq.com%2Fmediastyle%2Fmod%2Fmobile%2Fimg%2Flogo.svg&name=1&pattern=Overlapping%20Hexagons&theme=Auto">
|
|
37
31
|
</a>
|
|
38
|
-
<a href="https://
|
|
39
|
-
<img src="https://img.shields.io/
|
|
32
|
+
<a href="https://www.python.org">
|
|
33
|
+
<img src="https://img.shields.io/badge/Python-3.9|3.10|3.11|3.12-blue" alt="Python">
|
|
40
34
|
</a>
|
|
41
35
|
<a href="https://github.com/luren-dc/QQMusicApi?tab=MIT-1-ov-file">
|
|
42
|
-
<img src="https://img.shields.io/github/license/luren-dc/
|
|
36
|
+
<img src="https://img.shields.io/github/license/luren-dc/QQMusicApi" alt="GitHub license">
|
|
43
37
|
</a>
|
|
44
38
|
<a href="https://github.com/luren-dc/QQMusicApi/stargazers">
|
|
45
39
|
<img src="https://img.shields.io/github/stars/luren-dc/QQMusicApi?color=yellow&label=Github%20Stars" alt="STARS">
|
|
46
40
|
</a>
|
|
47
41
|
<a href="https://github.com/luren-dc/QQMusicApi/actions/workflows/testing.yml">
|
|
48
|
-
<img src="https://github.com/luren-dc/QQMusicApi/actions/workflows/testing.yml/badge.svg?branch=
|
|
42
|
+
<img src="https://github.com/luren-dc/QQMusicApi/actions/workflows/testing.yml/badge.svg?branch=main" alt="Testing">
|
|
49
43
|
</a>
|
|
50
44
|
</div>
|
|
51
45
|
|
|
52
46
|
---
|
|
53
47
|
|
|
54
|
-
> [!
|
|
48
|
+
> [!IMPORTANT]
|
|
55
49
|
> 本仓库的所有内容仅供学习和参考之用,禁止用于商业用途
|
|
56
50
|
>
|
|
57
|
-
>
|
|
51
|
+
> **音乐平台不易,请尊重版权,支持正版。**
|
|
58
52
|
|
|
59
53
|
**文档**: <a href="https://luren-dc.github.io/QQMusicApi" target="_blank">https://luren-dc.github.io/QQMusicApi</a>
|
|
60
54
|
|
|
@@ -72,8 +66,6 @@ Description-Content-Type: text/markdown
|
|
|
72
66
|
|
|
73
67
|
## 依赖
|
|
74
68
|
|
|
75
|
-
- ~~[AIOHTTP](https://docs.aiohttp.org/)~~
|
|
76
|
-
- ~~[Requests](https://requests.readthedocs.io/)~~
|
|
77
69
|
- [Cryptography](https://cryptography.io/)
|
|
78
70
|
- [HTTPX](https://github.com/encode/httpx/)
|
|
79
71
|
|
|
@@ -101,18 +93,14 @@ async def main():
|
|
|
101
93
|
asyncio.run(main())
|
|
102
94
|
```
|
|
103
95
|
|
|
104
|
-
##
|
|
96
|
+
## Licence
|
|
105
97
|
|
|
106
|
-
|
|
107
|
-
[](https://github.com/Rain120/qq-music-api)
|
|
108
|
-
[](https://github.com/jsososo/QQMusicApi)
|
|
98
|
+
本项目基于 **[MIT License](https://github.com/luren-dc/QQMusicApi?tab=MIT-1-ov-file)** 许可证发行。
|
|
109
99
|
|
|
110
|
-
|
|
111
|
-
[](https://github.com/chenmozhijin/LDDC)
|
|
100
|
+
## 免责声明
|
|
112
101
|
|
|
113
|
-
|
|
114
|
-
[](https://github.com/Nemo2011/bilibili-api)
|
|
102
|
+
由于使用本项目产生的包括由于本协议或由于使用或无法使用本项目而引起的任何性质的任何直接、间接、特殊、偶然或结果性损害(包括但不限于因商誉损失、停工、计算机故障或故障引起的损害赔偿,或任何及所有其他商业损害或损失)由使用者负责
|
|
115
103
|
|
|
116
|
-
##
|
|
104
|
+
## 贡献者
|
|
117
105
|
|
|
118
|
-
|
|
106
|
+
[](https://github.com/luren-dc/QQMusicApi/graphs/contributors)
|
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
<a href="https://www.python.org">
|
|
5
|
-
<img src="https://img.shields.io/badge/python-3.9|3.10|3.11|3.12-blue" alt="Python">
|
|
6
|
-
</a>
|
|
7
|
-
<a href="https://github.com/astral-sh/ruff">
|
|
8
|
-
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
|
|
2
|
+
<a>
|
|
3
|
+
<img src="https://socialify.git.ci/luren-dc/QQMusicApi/image?description=1&font=Source%20Code%20Pro&language=1&logo=https%3A%2F%2Fy.qq.com%2Fmediastyle%2Fmod%2Fmobile%2Fimg%2Flogo.svg&name=1&pattern=Overlapping%20Hexagons&theme=Auto">
|
|
9
4
|
</a>
|
|
10
|
-
<a href="https://
|
|
11
|
-
<img src="https://img.shields.io/
|
|
5
|
+
<a href="https://www.python.org">
|
|
6
|
+
<img src="https://img.shields.io/badge/Python-3.9|3.10|3.11|3.12-blue" alt="Python">
|
|
12
7
|
</a>
|
|
13
8
|
<a href="https://github.com/luren-dc/QQMusicApi?tab=MIT-1-ov-file">
|
|
14
|
-
<img src="https://img.shields.io/github/license/luren-dc/
|
|
9
|
+
<img src="https://img.shields.io/github/license/luren-dc/QQMusicApi" alt="GitHub license">
|
|
15
10
|
</a>
|
|
16
11
|
<a href="https://github.com/luren-dc/QQMusicApi/stargazers">
|
|
17
12
|
<img src="https://img.shields.io/github/stars/luren-dc/QQMusicApi?color=yellow&label=Github%20Stars" alt="STARS">
|
|
18
13
|
</a>
|
|
19
14
|
<a href="https://github.com/luren-dc/QQMusicApi/actions/workflows/testing.yml">
|
|
20
|
-
<img src="https://github.com/luren-dc/QQMusicApi/actions/workflows/testing.yml/badge.svg?branch=
|
|
15
|
+
<img src="https://github.com/luren-dc/QQMusicApi/actions/workflows/testing.yml/badge.svg?branch=main" alt="Testing">
|
|
21
16
|
</a>
|
|
22
17
|
</div>
|
|
23
18
|
|
|
24
19
|
---
|
|
25
20
|
|
|
26
|
-
> [!
|
|
21
|
+
> [!IMPORTANT]
|
|
27
22
|
> 本仓库的所有内容仅供学习和参考之用,禁止用于商业用途
|
|
28
23
|
>
|
|
29
|
-
>
|
|
24
|
+
> **音乐平台不易,请尊重版权,支持正版。**
|
|
30
25
|
|
|
31
26
|
**文档**: <a href="https://luren-dc.github.io/QQMusicApi" target="_blank">https://luren-dc.github.io/QQMusicApi</a>
|
|
32
27
|
|
|
@@ -44,8 +39,6 @@
|
|
|
44
39
|
|
|
45
40
|
## 依赖
|
|
46
41
|
|
|
47
|
-
- ~~[AIOHTTP](https://docs.aiohttp.org/)~~
|
|
48
|
-
- ~~[Requests](https://requests.readthedocs.io/)~~
|
|
49
42
|
- [Cryptography](https://cryptography.io/)
|
|
50
43
|
- [HTTPX](https://github.com/encode/httpx/)
|
|
51
44
|
|
|
@@ -73,18 +66,14 @@ async def main():
|
|
|
73
66
|
asyncio.run(main())
|
|
74
67
|
```
|
|
75
68
|
|
|
76
|
-
##
|
|
69
|
+
## Licence
|
|
77
70
|
|
|
78
|
-
|
|
79
|
-
[](https://github.com/Rain120/qq-music-api)
|
|
80
|
-
[](https://github.com/jsososo/QQMusicApi)
|
|
71
|
+
本项目基于 **[MIT License](https://github.com/luren-dc/QQMusicApi?tab=MIT-1-ov-file)** 许可证发行。
|
|
81
72
|
|
|
82
|
-
|
|
83
|
-
[](https://github.com/chenmozhijin/LDDC)
|
|
73
|
+
## 免责声明
|
|
84
74
|
|
|
85
|
-
|
|
86
|
-
[](https://github.com/Nemo2011/bilibili-api)
|
|
75
|
+
由于使用本项目产生的包括由于本协议或由于使用或无法使用本项目而引起的任何性质的任何直接、间接、特殊、偶然或结果性损害(包括但不限于因商誉损失、停工、计算机故障或故障引起的损害赔偿,或任何及所有其他商业损害或损失)由使用者负责
|
|
87
76
|
|
|
88
|
-
##
|
|
77
|
+
## 贡献者
|
|
89
78
|
|
|
90
|
-
|
|
79
|
+
[](https://github.com/luren-dc/QQMusicApi/graphs/contributors)
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
|
|
1
3
|
from . import album, login, login_utils, lyric, mv, search, singer, song, songlist, top, user
|
|
2
4
|
from .utils.credential import Credential
|
|
3
5
|
from .utils.network import get_session, set_session
|
|
4
6
|
from .utils.sync import sync
|
|
5
7
|
|
|
6
|
-
__version__ = "0.1.
|
|
8
|
+
__version__ = "0.1.11"
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger("qqmusicapi")
|
|
11
|
+
|
|
7
12
|
|
|
8
13
|
__all__ = [
|
|
9
14
|
"album",
|
|
@@ -186,7 +186,6 @@ class Api:
|
|
|
186
186
|
},
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
self.method = "POST"
|
|
190
189
|
self.json_body = True
|
|
191
190
|
self.params.clear()
|
|
192
191
|
|
|
@@ -222,7 +221,7 @@ class Api:
|
|
|
222
221
|
|
|
223
222
|
config = {
|
|
224
223
|
"url": self.url,
|
|
225
|
-
"method": self.method,
|
|
224
|
+
"method": self.method if not self.module else "POST",
|
|
226
225
|
"params": self.params,
|
|
227
226
|
"headers": self.headers,
|
|
228
227
|
}
|
|
@@ -234,7 +233,10 @@ class Api:
|
|
|
234
233
|
|
|
235
234
|
async def request(self) -> httpx.Response:
|
|
236
235
|
"""发起请求"""
|
|
236
|
+
from .. import logger
|
|
237
|
+
|
|
237
238
|
config = self._prepare_request()
|
|
239
|
+
logger.debug("发起请求: %s", config)
|
|
238
240
|
resp = await self._session.request(**config)
|
|
239
241
|
if not self.ignore_code:
|
|
240
242
|
resp.raise_for_status()
|
|
@@ -274,6 +274,8 @@ class QIMEI:
|
|
|
274
274
|
"""
|
|
275
275
|
data, ts = QIMEI._generate_request_param(DeviceData.generate_random_payload(app_version))
|
|
276
276
|
sign = calculate_md5("qimei_qq_androidpzAuCmaFAaFaHrdakPjLIEqKrGnSOOvH", ts)
|
|
277
|
+
from .. import logger
|
|
278
|
+
|
|
277
279
|
try:
|
|
278
280
|
res = httpx.post(
|
|
279
281
|
"https://api.tencentmusic.com/tme/trpc/proxy",
|
|
@@ -289,8 +291,10 @@ class QIMEI:
|
|
|
289
291
|
json=data,
|
|
290
292
|
)
|
|
291
293
|
qimei = json.loads(res.json().get("data", "{}"))
|
|
294
|
+
logger.debug("获取 Qimei 成功: %s", qimei)
|
|
292
295
|
return QImeiResult(qimei["data"]["q16"], qimei["data"]["q36"])
|
|
293
296
|
except Exception:
|
|
297
|
+
logger.exception("获取 Qimei 失败,使用默认值")
|
|
294
298
|
return QImeiResult(
|
|
295
299
|
q16="fde9508748b00283b2723a9210001b617301",
|
|
296
300
|
q36="35f21e7473442374591e560510001c71730b",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{qqmusic_api_python-0.1.9 → qqmusic_api_python-0.1.11}/qqmusic_api/exceptions/api_exception.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|