qqmusic-api-python 0.1.11__tar.gz → 0.2.1__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.2.1/.gitignore +178 -0
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/PKG-INFO +16 -15
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/README.md +2 -2
- qqmusic_api_python-0.2.1/pyproject.toml +112 -0
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/__init__.py +5 -3
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/album.py +6 -6
- qqmusic_api_python-0.2.1/qqmusic_api/data/api/album.json +22 -0
- qqmusic_api_python-0.2.1/qqmusic_api/data/api/login.json +196 -0
- qqmusic_api_python-0.2.1/qqmusic_api/data/api/lyric.json +25 -0
- qqmusic_api_python-0.2.1/qqmusic_api/data/api/mv.json +26 -0
- qqmusic_api_python-0.2.1/qqmusic_api/data/api/search.json +74 -0
- qqmusic_api_python-0.2.1/qqmusic_api/data/api/singer.json +48 -0
- qqmusic_api_python-0.2.1/qqmusic_api/data/api/song.json +118 -0
- qqmusic_api_python-0.2.1/qqmusic_api/data/api/songlist.json +17 -0
- qqmusic_api_python-0.2.1/qqmusic_api/data/api/top.json +20 -0
- qqmusic_api_python-0.2.1/qqmusic_api/data/api/user.json +171 -0
- qqmusic_api_python-0.2.1/qqmusic_api/data/file_type.json +58 -0
- qqmusic_api_python-0.2.1/qqmusic_api/data/search_type.json +11 -0
- qqmusic_api_python-0.2.1/qqmusic_api/exceptions/__init__.py +17 -0
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/exceptions/api_exception.py +8 -1
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/login.py +16 -21
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/login_utils.py +8 -9
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/lyric.py +4 -5
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/mv.py +1 -1
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/search.py +6 -7
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/singer.py +3 -3
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/song.py +40 -41
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/songlist.py +1 -1
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/top.py +1 -1
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/user.py +7 -10
- qqmusic_api_python-0.1.11/qqmusic_api/utils/utils.py → qqmusic_api_python-0.2.1/qqmusic_api/utils/common.py +18 -7
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/utils/credential.py +18 -2
- qqmusic_api_python-0.2.1/qqmusic_api/utils/device.py +99 -0
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/utils/network.py +57 -88
- qqmusic_api_python-0.2.1/qqmusic_api/utils/qimei.py +157 -0
- qqmusic_api_python-0.2.1/qqmusic_api/utils/session.py +162 -0
- qqmusic_api_python-0.2.1/qqmusic_api/utils/sign.py +67 -0
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/utils/sync.py +2 -0
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/utils/tripledes.py +1 -2
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/tests/conftest.py +3 -2
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/tests/test_login.py +1 -1
- qqmusic_api_python-0.2.1/tests/test_qimei.py +6 -0
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/tests/test_search.py +3 -1
- qqmusic_api_python-0.2.1/tests/test_sign.py +13 -0
- qqmusic_api_python-0.1.11/pyproject.toml +0 -148
- qqmusic_api_python-0.1.11/qqmusic_api/data/api/album.json +0 -22
- qqmusic_api_python-0.1.11/qqmusic_api/data/api/login.json +0 -196
- qqmusic_api_python-0.1.11/qqmusic_api/data/api/lyric.json +0 -25
- qqmusic_api_python-0.1.11/qqmusic_api/data/api/mv.json +0 -26
- qqmusic_api_python-0.1.11/qqmusic_api/data/api/search.json +0 -74
- qqmusic_api_python-0.1.11/qqmusic_api/data/api/singer.json +0 -48
- qqmusic_api_python-0.1.11/qqmusic_api/data/api/song.json +0 -118
- qqmusic_api_python-0.1.11/qqmusic_api/data/api/songlist.json +0 -17
- qqmusic_api_python-0.1.11/qqmusic_api/data/api/top.json +0 -20
- qqmusic_api_python-0.1.11/qqmusic_api/data/api/user.json +0 -171
- qqmusic_api_python-0.1.11/qqmusic_api/data/file_type.json +0 -58
- qqmusic_api_python-0.1.11/qqmusic_api/data/search_type.json +0 -11
- qqmusic_api_python-0.1.11/qqmusic_api/exceptions/__init__.py +0 -9
- qqmusic_api_python-0.1.11/qqmusic_api/utils/qimei.py +0 -301
- qqmusic_api_python-0.1.11/tests/test_qimei.py +0 -5
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/LICENSE +0 -0
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/qqmusic_api/utils/__init__.py +0 -0
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/tests/test_album.py +0 -0
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/tests/test_lyric.py +0 -0
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/tests/test_mv.py +0 -0
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/tests/test_singer.py +0 -0
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/tests/test_song.py +0 -0
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/tests/test_songlist.py +0 -0
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/tests/test_top.py +0 -0
- {qqmusic_api_python-0.1.11 → qqmusic_api_python-0.2.1}/tests/test_user.py +0 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# Created by https://www.toptal.com/developers/gitignore/api/python
|
|
2
|
+
# Edit at https://www.toptal.com/developers/gitignore?templates=python
|
|
3
|
+
|
|
4
|
+
### Python ###
|
|
5
|
+
# Byte-compiled / optimized / DLL files
|
|
6
|
+
__pycache__/
|
|
7
|
+
*.py[cod]
|
|
8
|
+
*$py.class
|
|
9
|
+
device.json
|
|
10
|
+
|
|
11
|
+
# C extensions
|
|
12
|
+
*.so
|
|
13
|
+
|
|
14
|
+
# Distribution / packaging
|
|
15
|
+
.Python
|
|
16
|
+
build/
|
|
17
|
+
develop-eggs/
|
|
18
|
+
dist/
|
|
19
|
+
downloads/
|
|
20
|
+
eggs/
|
|
21
|
+
.eggs/
|
|
22
|
+
lib/
|
|
23
|
+
lib64/
|
|
24
|
+
parts/
|
|
25
|
+
sdist/
|
|
26
|
+
var/
|
|
27
|
+
wheels/
|
|
28
|
+
share/python-wheels/
|
|
29
|
+
*.egg-info/
|
|
30
|
+
.installed.cfg
|
|
31
|
+
*.egg
|
|
32
|
+
MANIFEST
|
|
33
|
+
|
|
34
|
+
# PyInstaller
|
|
35
|
+
# Usually these files are written by a python script from a template
|
|
36
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
37
|
+
*.manifest
|
|
38
|
+
*.spec
|
|
39
|
+
|
|
40
|
+
# Installer logs
|
|
41
|
+
pip-log.txt
|
|
42
|
+
pip-delete-this-directory.txt
|
|
43
|
+
|
|
44
|
+
# Unit test / coverage reports
|
|
45
|
+
htmlcov/
|
|
46
|
+
.tox/
|
|
47
|
+
.nox/
|
|
48
|
+
.coverage
|
|
49
|
+
.coverage.*
|
|
50
|
+
.cache
|
|
51
|
+
nosetests.xml
|
|
52
|
+
coverage.xml
|
|
53
|
+
*.cover
|
|
54
|
+
*.py,cover
|
|
55
|
+
.hypothesis/
|
|
56
|
+
.pytest_cache/
|
|
57
|
+
cover/
|
|
58
|
+
|
|
59
|
+
# Translations
|
|
60
|
+
*.mo
|
|
61
|
+
*.pot
|
|
62
|
+
|
|
63
|
+
# Django stuff:
|
|
64
|
+
*.log
|
|
65
|
+
local_settings.py
|
|
66
|
+
db.sqlite3
|
|
67
|
+
db.sqlite3-journal
|
|
68
|
+
|
|
69
|
+
# Flask stuff:
|
|
70
|
+
instance/
|
|
71
|
+
.webassets-cache
|
|
72
|
+
|
|
73
|
+
# Scrapy stuff:
|
|
74
|
+
.scrapy
|
|
75
|
+
|
|
76
|
+
# Sphinx documentation
|
|
77
|
+
docs/_build/
|
|
78
|
+
|
|
79
|
+
# PyBuilder
|
|
80
|
+
.pybuilder/
|
|
81
|
+
target/
|
|
82
|
+
|
|
83
|
+
# Jupyter Notebook
|
|
84
|
+
.ipynb_checkpoints
|
|
85
|
+
|
|
86
|
+
# IPython
|
|
87
|
+
profile_default/
|
|
88
|
+
ipython_config.py
|
|
89
|
+
|
|
90
|
+
# pyenv
|
|
91
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
92
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
93
|
+
.python-version
|
|
94
|
+
|
|
95
|
+
# pipenv
|
|
96
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
97
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
98
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
99
|
+
# install all needed dependencies.
|
|
100
|
+
#Pipfile.lock
|
|
101
|
+
|
|
102
|
+
# poetry
|
|
103
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
104
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
105
|
+
# commonly ignored for libraries.
|
|
106
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
107
|
+
#poetry.lock
|
|
108
|
+
|
|
109
|
+
# pdm
|
|
110
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
111
|
+
#pdm.lock
|
|
112
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
113
|
+
# in version control.
|
|
114
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
115
|
+
.pdm.toml
|
|
116
|
+
.pdm-python
|
|
117
|
+
|
|
118
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
119
|
+
__pypackages__/
|
|
120
|
+
|
|
121
|
+
# Celery stuff
|
|
122
|
+
celerybeat-schedule
|
|
123
|
+
celerybeat.pid
|
|
124
|
+
|
|
125
|
+
# SageMath parsed files
|
|
126
|
+
*.sage.py
|
|
127
|
+
|
|
128
|
+
# Environments
|
|
129
|
+
.env
|
|
130
|
+
.venv
|
|
131
|
+
env/
|
|
132
|
+
venv/
|
|
133
|
+
ENV/
|
|
134
|
+
env.bak/
|
|
135
|
+
venv.bak/
|
|
136
|
+
|
|
137
|
+
# Spyder project settings
|
|
138
|
+
.spyderproject
|
|
139
|
+
.spyproject
|
|
140
|
+
|
|
141
|
+
# Rope project settings
|
|
142
|
+
.ropeproject
|
|
143
|
+
|
|
144
|
+
# mkdocs documentation
|
|
145
|
+
/site
|
|
146
|
+
|
|
147
|
+
# mypy
|
|
148
|
+
.mypy_cache/
|
|
149
|
+
.dmypy.json
|
|
150
|
+
dmypy.json
|
|
151
|
+
|
|
152
|
+
# Pyre type checker
|
|
153
|
+
.pyre/
|
|
154
|
+
|
|
155
|
+
# pytype static type analyzer
|
|
156
|
+
.pytype/
|
|
157
|
+
|
|
158
|
+
# Cython debug symbols
|
|
159
|
+
cython_debug/
|
|
160
|
+
|
|
161
|
+
# PyCharm
|
|
162
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
163
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
164
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
165
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
166
|
+
#.idea/
|
|
167
|
+
|
|
168
|
+
### Python Patch ###
|
|
169
|
+
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
|
|
170
|
+
poetry.toml
|
|
171
|
+
|
|
172
|
+
# ruff
|
|
173
|
+
.ruff_cache/
|
|
174
|
+
|
|
175
|
+
# LSP config files
|
|
176
|
+
pyrightconfig.json
|
|
177
|
+
|
|
178
|
+
# End of https://www.toptal.com/developers/gitignore/api/python
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: qqmusic-api-python
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: QQ音乐API封装库
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Project-URL: homepage, https://luren-dc.github.io/QQMusicApi/
|
|
6
|
+
Project-URL: repository, https://github.com/luren-dc/QQMusicApi
|
|
7
|
+
Project-URL: documentation, https://luren-dc.github.io/QQMusicApi/
|
|
8
|
+
Author-email: Luren <68656403+luren-dc@users.noreply.github.com>
|
|
9
|
+
Maintainer-email: Luren <68656403+luren-dc@users.noreply.github.com>
|
|
8
10
|
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: api,music,qqmusic,tencentmusic
|
|
9
13
|
Classifier: Development Status :: 4 - Beta
|
|
10
|
-
Classifier: Natural Language :: Chinese (Simplified)
|
|
11
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
12
14
|
Classifier: Framework :: Pytest
|
|
13
15
|
Classifier: Framework :: aiohttp
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Natural Language :: Chinese (Simplified)
|
|
14
18
|
Classifier: Programming Language :: Python
|
|
15
19
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
20
|
Classifier: Programming Language :: Python :: 3.9
|
|
17
21
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
18
22
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
Project-URL: documentation, https://github.com/luren-dc/QQMusicApi
|
|
22
|
-
Requires-Python: <3.13,>=3.9
|
|
23
|
-
Requires-Dist: cryptography<42.0.0,>=41.0.2
|
|
24
|
-
Requires-Dist: typing-extensions>=4.12.2
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: cryptography<44.0.1,>=44.0.0
|
|
25
25
|
Requires-Dist: httpx>=0.27.0
|
|
26
|
+
Requires-Dist: typing-extensions>=4.12.2
|
|
26
27
|
Description-Content-Type: text/markdown
|
|
27
28
|
|
|
28
29
|
<div align="center">
|
|
@@ -30,7 +31,7 @@ Description-Content-Type: text/markdown
|
|
|
30
31
|
<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">
|
|
31
32
|
</a>
|
|
32
33
|
<a href="https://www.python.org">
|
|
33
|
-
<img src="https://img.shields.io/badge/Python-3.
|
|
34
|
+
<img src="https://img.shields.io/badge/Python-3.10|3.11|3.12-blue" alt="Python">
|
|
34
35
|
</a>
|
|
35
36
|
<a href="https://github.com/luren-dc/QQMusicApi?tab=MIT-1-ov-file">
|
|
36
37
|
<img src="https://img.shields.io/github/license/luren-dc/QQMusicApi" alt="GitHub license">
|
|
@@ -62,7 +63,7 @@ Description-Content-Type: text/markdown
|
|
|
62
63
|
|
|
63
64
|
- 涵盖常见 API
|
|
64
65
|
- 调用简便,函数命名易懂,代码注释详细
|
|
65
|
-
-
|
|
66
|
+
- 完全异步操作
|
|
66
67
|
|
|
67
68
|
## 依赖
|
|
68
69
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
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">
|
|
4
4
|
</a>
|
|
5
5
|
<a href="https://www.python.org">
|
|
6
|
-
<img src="https://img.shields.io/badge/Python-3.
|
|
6
|
+
<img src="https://img.shields.io/badge/Python-3.10|3.11|3.12-blue" alt="Python">
|
|
7
7
|
</a>
|
|
8
8
|
<a href="https://github.com/luren-dc/QQMusicApi?tab=MIT-1-ov-file">
|
|
9
9
|
<img src="https://img.shields.io/github/license/luren-dc/QQMusicApi" alt="GitHub license">
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
|
|
36
36
|
- 涵盖常见 API
|
|
37
37
|
- 调用简便,函数命名易懂,代码注释详细
|
|
38
|
-
-
|
|
38
|
+
- 完全异步操作
|
|
39
39
|
|
|
40
40
|
## 依赖
|
|
41
41
|
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "qqmusic-api-python"
|
|
3
|
+
description = "QQ音乐API封装库"
|
|
4
|
+
authors = [
|
|
5
|
+
{ name = "Luren", email = "68656403+luren-dc@users.noreply.github.com" },
|
|
6
|
+
]
|
|
7
|
+
dependencies = [
|
|
8
|
+
"cryptography>=44.0.0,<44.0.1",
|
|
9
|
+
"typing-extensions>=4.12.2",
|
|
10
|
+
"httpx>=0.27.0",
|
|
11
|
+
]
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
readme = "README.md"
|
|
14
|
+
license = { text = "MIT" }
|
|
15
|
+
maintainers = [
|
|
16
|
+
{ name = "Luren", email = "68656403+luren-dc@users.noreply.github.com" },
|
|
17
|
+
]
|
|
18
|
+
keywords = ["music", "api", "qqmusic", "tencentmusic"]
|
|
19
|
+
classifiers = [
|
|
20
|
+
"Development Status :: 4 - Beta",
|
|
21
|
+
"Natural Language :: Chinese (Simplified)",
|
|
22
|
+
"License :: OSI Approved :: MIT License",
|
|
23
|
+
"Framework :: Pytest",
|
|
24
|
+
"Framework :: aiohttp",
|
|
25
|
+
"Programming Language :: Python",
|
|
26
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
27
|
+
"Programming Language :: Python :: 3.9",
|
|
28
|
+
"Programming Language :: Python :: Implementation :: CPython",
|
|
29
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
30
|
+
]
|
|
31
|
+
dynamic = ["version"]
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
homepage = "https://luren-dc.github.io/QQMusicApi/"
|
|
35
|
+
repository = "https://github.com/luren-dc/QQMusicApi"
|
|
36
|
+
documentation = "https://luren-dc.github.io/QQMusicApi/"
|
|
37
|
+
|
|
38
|
+
[build-system]
|
|
39
|
+
requires = ["hatchling"]
|
|
40
|
+
build-backend = "hatchling.build"
|
|
41
|
+
|
|
42
|
+
[tool.uv]
|
|
43
|
+
package = true
|
|
44
|
+
|
|
45
|
+
[tool.hatch.version]
|
|
46
|
+
path = "qqmusic_api/__init__.py"
|
|
47
|
+
|
|
48
|
+
[tool.hatch.build.targets.wheel]
|
|
49
|
+
packages = ["qqmusic_api"]
|
|
50
|
+
|
|
51
|
+
[tool.hatch.build.targets.sdist]
|
|
52
|
+
include = ["/qqmusic_api", "/tests", "LISENCE", "README.md"]
|
|
53
|
+
|
|
54
|
+
[dependency-groups]
|
|
55
|
+
testing = [
|
|
56
|
+
"pytest<9.0.0,>=8.2.0",
|
|
57
|
+
"pytest-asyncio<1.0.0,>=0.23.6",
|
|
58
|
+
"pytest-sugar<2.0.0,>=1.0.0",
|
|
59
|
+
]
|
|
60
|
+
docs = [
|
|
61
|
+
"mkdocs-material>=9.5.29",
|
|
62
|
+
"mkdocstrings-python>=1.10.5",
|
|
63
|
+
"mkdocstrings>=0.25.1",
|
|
64
|
+
"mkdocs>=1.6.0",
|
|
65
|
+
"markdown-callouts>=0.4.0",
|
|
66
|
+
"griffe-inherited-docstrings>=1.0.0",
|
|
67
|
+
"docstring-inheritance>=2.2.1",
|
|
68
|
+
"griffe-modernized-annotations>=1.0.8",
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
[tool.commitizen]
|
|
72
|
+
name = "cz_gitmoji"
|
|
73
|
+
|
|
74
|
+
[tool.basedpyright]
|
|
75
|
+
venvPath = "."
|
|
76
|
+
venv = ".venv"
|
|
77
|
+
include = ["qqmusic_api"]
|
|
78
|
+
exclude = ["tests", "examples"]
|
|
79
|
+
pythonVersion = "3.10"
|
|
80
|
+
typeCheckingMode = "standard"
|
|
81
|
+
|
|
82
|
+
[tool.ruff]
|
|
83
|
+
line-length = 120
|
|
84
|
+
extend-exclude = ["docs"]
|
|
85
|
+
|
|
86
|
+
[tool.ruff.lint]
|
|
87
|
+
extend-select = [
|
|
88
|
+
"Q",
|
|
89
|
+
"RUF",
|
|
90
|
+
"C90",
|
|
91
|
+
"UP",
|
|
92
|
+
"I",
|
|
93
|
+
"D",
|
|
94
|
+
"ASYNC",
|
|
95
|
+
"C4",
|
|
96
|
+
"FURB",
|
|
97
|
+
"R",
|
|
98
|
+
"PERF",
|
|
99
|
+
]
|
|
100
|
+
ignore = ["D105", "D107", "D205", "D415"]
|
|
101
|
+
pydocstyle = { convention = "google" }
|
|
102
|
+
|
|
103
|
+
[tool.ruff.lint.per-file-ignores]
|
|
104
|
+
"tests/*" = ["D"]
|
|
105
|
+
"examples/*" = ["D", "T"]
|
|
106
|
+
"qqmusic_api/__init__.py" = ["F405", "D"]
|
|
107
|
+
"qqmusic_api/**/__init__.py" = ["F405", "D"]
|
|
108
|
+
|
|
109
|
+
[tool.pytest.ini_options]
|
|
110
|
+
addopts = "-rxXs"
|
|
111
|
+
asyncio_mode = "auto"
|
|
112
|
+
asyncio_default_fixture_loop_scope = "session"
|
|
@@ -2,17 +2,18 @@ import logging
|
|
|
2
2
|
|
|
3
3
|
from . import album, login, login_utils, lyric, mv, search, singer, song, songlist, top, user
|
|
4
4
|
from .utils.credential import Credential
|
|
5
|
-
from .utils.
|
|
5
|
+
from .utils.session import create_session, get_session, set_session, set_session_credential
|
|
6
6
|
from .utils.sync import sync
|
|
7
7
|
|
|
8
|
-
__version__ = "0.1
|
|
8
|
+
__version__ = "0.2.1"
|
|
9
9
|
|
|
10
10
|
logger = logging.getLogger("qqmusicapi")
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
__all__ = [
|
|
14
|
-
"album",
|
|
15
14
|
"Credential",
|
|
15
|
+
"album",
|
|
16
|
+
"create_session",
|
|
16
17
|
"get_session",
|
|
17
18
|
"login",
|
|
18
19
|
"login_utils",
|
|
@@ -20,6 +21,7 @@ __all__ = [
|
|
|
20
21
|
"mv",
|
|
21
22
|
"search",
|
|
22
23
|
"set_session",
|
|
24
|
+
"set_session_credential",
|
|
23
25
|
"singer",
|
|
24
26
|
"song",
|
|
25
27
|
"songlist",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""专辑相关 API"""
|
|
2
2
|
|
|
3
|
-
from typing import Literal
|
|
3
|
+
from typing import Literal
|
|
4
4
|
|
|
5
|
+
from .utils.common import get_api
|
|
5
6
|
from .utils.network import Api
|
|
6
|
-
from .utils.utils import get_api
|
|
7
7
|
|
|
8
8
|
API = get_api("album")
|
|
9
9
|
|
|
@@ -34,13 +34,13 @@ class Album:
|
|
|
34
34
|
def __init__(
|
|
35
35
|
self,
|
|
36
36
|
*,
|
|
37
|
-
mid:
|
|
38
|
-
id:
|
|
37
|
+
mid: str | None = None,
|
|
38
|
+
id: int | None = None,
|
|
39
39
|
):
|
|
40
40
|
"""初始化专辑类
|
|
41
41
|
|
|
42
42
|
Note:
|
|
43
|
-
歌曲 mid 和 id
|
|
43
|
+
歌曲 mid 和 id,两者至少提供一个
|
|
44
44
|
|
|
45
45
|
Args:
|
|
46
46
|
mid: 专辑 mid
|
|
@@ -50,7 +50,7 @@ class Album:
|
|
|
50
50
|
raise ValueError("mid or id must be provided")
|
|
51
51
|
self.mid = mid or ""
|
|
52
52
|
self.id = id or 0
|
|
53
|
-
self._info:
|
|
53
|
+
self._info: dict | None = None
|
|
54
54
|
|
|
55
55
|
async def get_mid(self) -> str:
|
|
56
56
|
"""获取专辑 mid
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"detail": {
|
|
3
|
+
"module": "music.musichallAlbum.AlbumInfoServer",
|
|
4
|
+
"method": "GetAlbumDetail",
|
|
5
|
+
"params": {
|
|
6
|
+
"albumMid": "str 专辑 mid",
|
|
7
|
+
"albumId": "str 专辑 id"
|
|
8
|
+
},
|
|
9
|
+
"comment": "获取专辑信息"
|
|
10
|
+
},
|
|
11
|
+
"song": {
|
|
12
|
+
"module": "music.musichallAlbum.AlbumSongList",
|
|
13
|
+
"method": "GetAlbumSongList",
|
|
14
|
+
"params": {
|
|
15
|
+
"albumMid": "str 专辑 mid",
|
|
16
|
+
"albumId": "str 专辑 id",
|
|
17
|
+
"begin": "int 开启位置",
|
|
18
|
+
"num": "int 返回数量"
|
|
19
|
+
},
|
|
20
|
+
"comment": "获取专辑歌曲"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
{
|
|
2
|
+
"qq": {
|
|
3
|
+
"get_qrcode": {
|
|
4
|
+
"url": "https://ssl.ptlogin2.qq.com/ptqrshow",
|
|
5
|
+
"params": {
|
|
6
|
+
"appid": "716027609",
|
|
7
|
+
"e": "2",
|
|
8
|
+
"l": "M",
|
|
9
|
+
"s": "3",
|
|
10
|
+
"d": "72",
|
|
11
|
+
"v": "4",
|
|
12
|
+
"t": "str(random.random())",
|
|
13
|
+
"daid": "383",
|
|
14
|
+
"pt_3rd_aid": "100497308"
|
|
15
|
+
},
|
|
16
|
+
"headers": {
|
|
17
|
+
"Referer": "https://xui.ptlogin2.qq.com/"
|
|
18
|
+
},
|
|
19
|
+
"comment": "获取二维码二进制数据和 qrsig"
|
|
20
|
+
},
|
|
21
|
+
"check_qrcode_state": {
|
|
22
|
+
"url": "https://ssl.ptlogin2.qq.com/ptqrlogin",
|
|
23
|
+
"params": {
|
|
24
|
+
"u1": "https://graph.qq.com/oauth2.0/login_jump",
|
|
25
|
+
"ptqrtoken": "hash33(qrsig)",
|
|
26
|
+
"ptredirect": "0",
|
|
27
|
+
"h": "1",
|
|
28
|
+
"t": "1",
|
|
29
|
+
"g": "1",
|
|
30
|
+
"from_ui": "1",
|
|
31
|
+
"ptlang": "2052",
|
|
32
|
+
"action": "0-0-{time.time() * 1000}",
|
|
33
|
+
"js_ver": "20102616",
|
|
34
|
+
"js_type": "1",
|
|
35
|
+
"pt_uistyle": "40",
|
|
36
|
+
"aid": "716027609",
|
|
37
|
+
"daid": "383",
|
|
38
|
+
"pt_3rd_aid": "100497308",
|
|
39
|
+
"has_onekey": "1"
|
|
40
|
+
},
|
|
41
|
+
"headers": {
|
|
42
|
+
"Referer": "https://xui.ptlogin2.qq.com/"
|
|
43
|
+
},
|
|
44
|
+
"comment": "获取二维码状态"
|
|
45
|
+
},
|
|
46
|
+
"check_sig": {
|
|
47
|
+
"url": "https://ssl.ptlogin2.graph.qq.com/check_sig",
|
|
48
|
+
"ignore_code": true,
|
|
49
|
+
"params": {
|
|
50
|
+
"uin": "uin",
|
|
51
|
+
"pttype": "1",
|
|
52
|
+
"service": "ptqrlogin",
|
|
53
|
+
"nodirect": "0",
|
|
54
|
+
"ptsigx": "sigx",
|
|
55
|
+
"s_url": "https://graph.qq.com/oauth2.0/login_jump",
|
|
56
|
+
"ptlang": "2052",
|
|
57
|
+
"ptredirect": "100",
|
|
58
|
+
"aid": "716027609",
|
|
59
|
+
"daid": "383",
|
|
60
|
+
"j_later": "0",
|
|
61
|
+
"low_login_hour": "0",
|
|
62
|
+
"regmaster": "0",
|
|
63
|
+
"pt_login_type": "3",
|
|
64
|
+
"pt_aid": "0",
|
|
65
|
+
"pt_aaid": "16",
|
|
66
|
+
"pt_light": "0",
|
|
67
|
+
"pt_3rd_aid": "100497308"
|
|
68
|
+
},
|
|
69
|
+
"headers": {
|
|
70
|
+
"Referer": "https://xui.ptlogin2.qq.com/"
|
|
71
|
+
},
|
|
72
|
+
"comment": "获取 p_skey"
|
|
73
|
+
},
|
|
74
|
+
"authorize": {
|
|
75
|
+
"url": "https://graph.qq.com/oauth2.0/authorize",
|
|
76
|
+
"method": "POST",
|
|
77
|
+
"ignore_code": true,
|
|
78
|
+
"data": {
|
|
79
|
+
"response_type": "code",
|
|
80
|
+
"client_id": "100497308",
|
|
81
|
+
"redirect_uri": "https://y.qq.com/portal/wx_redirect.html?login_type=1&surl=https%3A%252F%252Fy.qq.com%252F",
|
|
82
|
+
"scope": "get_user_info,get_app_friends",
|
|
83
|
+
"state": "state",
|
|
84
|
+
"switch": "",
|
|
85
|
+
"from_ptlogin": "1",
|
|
86
|
+
"src": "1",
|
|
87
|
+
"update_auth": "1",
|
|
88
|
+
"openapi": "1010_1030",
|
|
89
|
+
"g_tk": "hash33(p_skey, 5381)",
|
|
90
|
+
"auth_time": "str(int(time.time()) * 1000)",
|
|
91
|
+
"ui": "str(uuid.uuid4())"
|
|
92
|
+
},
|
|
93
|
+
"comment": "QQ 鉴权"
|
|
94
|
+
},
|
|
95
|
+
"login": {
|
|
96
|
+
"module": "QQConnectLogin.LoginServer",
|
|
97
|
+
"method": "QQLogin",
|
|
98
|
+
"ignore_code": true,
|
|
99
|
+
"params": {
|
|
100
|
+
"code": "str 鉴权码",
|
|
101
|
+
"musicid": "int",
|
|
102
|
+
"musickey": "str",
|
|
103
|
+
"refresh_key": "str",
|
|
104
|
+
"refresh_token": "str"
|
|
105
|
+
},
|
|
106
|
+
"extra_common": {
|
|
107
|
+
"tmeLoginType": "str 2"
|
|
108
|
+
},
|
|
109
|
+
"comment": "QQ 登录"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"wx": {
|
|
113
|
+
"get_qrcode": {
|
|
114
|
+
"url": "https://open.weixin.qq.com/connect/qrconnect",
|
|
115
|
+
"params": {
|
|
116
|
+
"appid": "wx48db31d50e334801",
|
|
117
|
+
"redirect_uri": "https://y.qq.com/portal/wx_redirect.html?login_type=2&surl=https://y.qq.com/",
|
|
118
|
+
"response_type": "code",
|
|
119
|
+
"scope": "snsapi_login",
|
|
120
|
+
"state": "STATE",
|
|
121
|
+
"href": "https://y.qq.com/mediastyle/music_v17/src/css/popup_wechat.css#wechat_redirect"
|
|
122
|
+
},
|
|
123
|
+
"comment": "获取二维码二进制数据和 uuid"
|
|
124
|
+
},
|
|
125
|
+
"check_qrcode_state": {
|
|
126
|
+
"url": "https://lp.open.weixin.qq.com/connect/l/qrconnect",
|
|
127
|
+
"params": {
|
|
128
|
+
"uuid": "str uuid",
|
|
129
|
+
"_": "str 毫秒级时间戳"
|
|
130
|
+
},
|
|
131
|
+
"headers": {
|
|
132
|
+
"Referer": "https://open.weixin.qq.com/"
|
|
133
|
+
},
|
|
134
|
+
"comment": "获取二维码状态"
|
|
135
|
+
},
|
|
136
|
+
"login": {
|
|
137
|
+
"module": "music.login.LoginServer",
|
|
138
|
+
"method": "Login",
|
|
139
|
+
"ignore_code": true,
|
|
140
|
+
"params": {
|
|
141
|
+
"strAppid": "wx48db31d50e334801",
|
|
142
|
+
"code": "str 鉴权码",
|
|
143
|
+
"musicid": "int",
|
|
144
|
+
"musickey": "str",
|
|
145
|
+
"refresh_key": "str",
|
|
146
|
+
"refresh_token": "str",
|
|
147
|
+
"loginMode": "int 2"
|
|
148
|
+
},
|
|
149
|
+
"extra_common": {
|
|
150
|
+
"tmeLoginType": "str 1"
|
|
151
|
+
},
|
|
152
|
+
"comment": "微信登录"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"phone": {
|
|
156
|
+
"send_authcode": {
|
|
157
|
+
"module": "music.login.LoginServer",
|
|
158
|
+
"method": "SendPhoneAuthCode",
|
|
159
|
+
"ignore_code": true,
|
|
160
|
+
"params": {
|
|
161
|
+
"tmeAppid": "qqmusic",
|
|
162
|
+
"phoneNo": "str 手机号",
|
|
163
|
+
"encryptedPhoneNo ": "str 加密手机号",
|
|
164
|
+
"areaCode": "str 国家码(86)"
|
|
165
|
+
},
|
|
166
|
+
"extra_common": {
|
|
167
|
+
"tmeLoginMethod": "str 3"
|
|
168
|
+
},
|
|
169
|
+
"comment": "发送验证码"
|
|
170
|
+
},
|
|
171
|
+
"login": {
|
|
172
|
+
"module": "music.login.LoginServer",
|
|
173
|
+
"method": "Login",
|
|
174
|
+
"ignore_code": true,
|
|
175
|
+
"params": {
|
|
176
|
+
"code": "str 验证码",
|
|
177
|
+
"phoneNo": "str 手机号",
|
|
178
|
+
"encryptedPhoneNo ": "str 加密手机号",
|
|
179
|
+
"areaCode": "str 国家码(86)",
|
|
180
|
+
"loginMode": "int 1"
|
|
181
|
+
},
|
|
182
|
+
"extra_common": {
|
|
183
|
+
"tmeLoginMethod": "str 3",
|
|
184
|
+
"tmeLoginType": "str 0"
|
|
185
|
+
},
|
|
186
|
+
"comment": "手机验证码鉴权"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"check_expired": {
|
|
190
|
+
"module": "music.UserInfo.userInfoServer",
|
|
191
|
+
"method": "GetLoginUserInfo",
|
|
192
|
+
"verify": true,
|
|
193
|
+
"params": {},
|
|
194
|
+
"comment": "获取登录用户的信息,用于检测凭证是否失效"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"info": {
|
|
3
|
+
"module": "music.musichallSong.PlayLyricInfo",
|
|
4
|
+
"method": "GetPlayLyricInfo",
|
|
5
|
+
"params": {
|
|
6
|
+
"ct": "int 11",
|
|
7
|
+
"cv": "int 13020508",
|
|
8
|
+
"lrc_t": "int 0",
|
|
9
|
+
"roma": "int 是否返回罗马歌词",
|
|
10
|
+
"roma_t": "int 0",
|
|
11
|
+
"trans": "int 是否返回翻译歌词",
|
|
12
|
+
"trans_t": "int 0",
|
|
13
|
+
"type": "int 1",
|
|
14
|
+
"albumName": "str 专辑名字",
|
|
15
|
+
"crypt": "int 是否加密歌词",
|
|
16
|
+
"qrc": "int 是否返回 qrc",
|
|
17
|
+
"qrc_t": "int 0",
|
|
18
|
+
"singerName": "str 歌手名字(取第一个)",
|
|
19
|
+
"songId": "int 歌曲 id",
|
|
20
|
+
"songMid": "str 歌曲 mid",
|
|
21
|
+
"songName": "str 歌曲名字"
|
|
22
|
+
},
|
|
23
|
+
"comment": "获取歌曲歌词信息"
|
|
24
|
+
}
|
|
25
|
+
}
|