@sansenjian/qq-music-api 2.2.10 → 2.3.1
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.
- package/CHANGELOG.md +19 -1
- package/README.md +10 -11
- package/dist/app.js +0 -1
- package/dist/koaApp.js +5 -1
- package/dist/module/apis/downloadQQMusic.js +2 -1
- package/dist/module/apis/music/getMusicPlay.js +3 -2
- package/dist/package.json +20 -16
- package/dist/routers/context/getNewDisks.js +4 -0
- package/dist/routers/context/getRecommend.js +4 -0
- package/dist/routers/context/getTicketInfo.js +4 -0
- package/dist/util/cookieResolver.js +10 -4
- package/docs-dist/404.html +6 -6
- package/docs-dist/CHANGELOG-ARCHITECTURE.html +14 -14
- package/docs-dist/COOKIE_CONFIG_GUIDE.html +13 -13
- package/docs-dist/DEGRADE_EXAMPLES.html +109 -0
- package/docs-dist/FALLBACK_MODE_GUIDE.html +21 -21
- package/docs-dist/QUICK_START.html +62 -0
- package/docs-dist/README.html +17 -17
- package/docs-dist/TEST_USER_PLAYLISTS.html +14 -14
- package/docs-dist/USER_AVATAR_GUIDE.html +16 -16
- package/docs-dist/api/comments.html +12 -12
- package/docs-dist/api/index.html +10 -10
- package/docs-dist/api/music.html +15 -13
- package/docs-dist/api/other.html +13 -13
- package/docs-dist/api/playground.html +27 -0
- package/docs-dist/api/playlist.html +15 -15
- package/docs-dist/api/rank.html +12 -12
- package/docs-dist/api/search.html +13 -13
- package/docs-dist/api/singer.html +12 -12
- package/docs-dist/api/user.html +16 -16
- package/docs-dist/assets/{CHANGELOG-ARCHITECTURE.md.DV9Xr7ve.js → CHANGELOG-ARCHITECTURE.md.CYHmaBdY.js} +5 -5
- package/docs-dist/assets/CHANGELOG-ARCHITECTURE.md.CYHmaBdY.lean.js +1 -0
- package/docs-dist/assets/COOKIE_CONFIG_GUIDE.md.Nvywo7CW.js +13 -0
- package/docs-dist/assets/COOKIE_CONFIG_GUIDE.md.Nvywo7CW.lean.js +1 -0
- package/docs-dist/assets/DEGRADE_EXAMPLES.md.Cz2J-qwE.js +83 -0
- package/docs-dist/assets/DEGRADE_EXAMPLES.md.Cz2J-qwE.lean.js +1 -0
- package/docs-dist/assets/{FALLBACK_MODE_GUIDE.md.0wqXqYxw.js → FALLBACK_MODE_GUIDE.md.wKA9yqoI.js} +12 -12
- package/docs-dist/assets/FALLBACK_MODE_GUIDE.md.wKA9yqoI.lean.js +1 -0
- package/docs-dist/assets/QUICK_START.md.D5KfDgbs.js +36 -0
- package/docs-dist/assets/QUICK_START.md.D5KfDgbs.lean.js +1 -0
- package/docs-dist/assets/README.md.CHbArqA7.js +421 -0
- package/docs-dist/assets/README.md.CHbArqA7.lean.js +1 -0
- package/docs-dist/assets/TEST_USER_PLAYLISTS.md.BfBxYbaM.js +16 -0
- package/docs-dist/assets/TEST_USER_PLAYLISTS.md.BfBxYbaM.lean.js +1 -0
- package/docs-dist/assets/{USER_AVATAR_GUIDE.md.CGPI9GUj.js → USER_AVATAR_GUIDE.md.D5Rti1Gg.js} +7 -7
- package/docs-dist/assets/USER_AVATAR_GUIDE.md.D5Rti1Gg.lean.js +1 -0
- package/docs-dist/assets/{api_comments.md.CATvWhrg.js → api_comments.md.5nDhrWa8.js} +3 -3
- package/docs-dist/assets/api_comments.md.5nDhrWa8.lean.js +1 -0
- package/docs-dist/assets/api_index.md.DdG1WHkZ.js +1 -0
- package/docs-dist/assets/api_index.md.DdG1WHkZ.lean.js +1 -0
- package/docs-dist/assets/{api_music.md.D20_neZB.js → api_music.md.D66hq-_4.js} +6 -4
- package/docs-dist/assets/api_music.md.D66hq-_4.lean.js +1 -0
- package/docs-dist/assets/api_other.md.9KhspVEM.js +7 -0
- package/docs-dist/assets/api_other.md.9KhspVEM.lean.js +1 -0
- package/docs-dist/assets/api_playground.md.BZBvYMm2.js +11 -0
- package/docs-dist/assets/api_playground.md.BZBvYMm2.lean.js +11 -0
- package/docs-dist/assets/{api_playlist.md.CyLdLRR9.js → api_playlist.md.BQK32ZyE.js} +6 -6
- package/docs-dist/assets/api_playlist.md.BQK32ZyE.lean.js +1 -0
- package/docs-dist/assets/{api_rank.md.Z3xyYG_S.js → api_rank.md.z7YBwVgw.js} +3 -3
- package/docs-dist/assets/api_rank.md.z7YBwVgw.lean.js +1 -0
- package/docs-dist/assets/{api_search.md.D_lbFmYo.js → api_search.md.GfzIBRfc.js} +4 -4
- package/docs-dist/assets/api_search.md.GfzIBRfc.lean.js +1 -0
- package/docs-dist/assets/api_singer.md.BDR-_qDH.js +21 -0
- package/docs-dist/assets/api_singer.md.BDR-_qDH.lean.js +1 -0
- package/docs-dist/assets/{api_user.md.4WdmTXIB.js → api_user.md.Dx8BWGrb.js} +7 -7
- package/docs-dist/assets/api_user.md.Dx8BWGrb.lean.js +1 -0
- package/docs-dist/assets/app.CxuIZ1W7.js +1 -0
- package/docs-dist/assets/chunks/@localSearchIndexroot.ygoKgu27.js +1 -0
- package/docs-dist/assets/chunks/VPLocalSearchBox.BqgkAhNM.js +3 -0
- package/docs-dist/assets/chunks/framework.BUY3a635.js +4 -0
- package/docs-dist/assets/chunks/theme.C-Z3DN0r.js +2 -0
- package/docs-dist/assets/{guide_architecture.md.D_46khUI.js → guide_architecture.md.SHnKkzwb.js} +20 -20
- package/docs-dist/assets/guide_architecture.md.SHnKkzwb.lean.js +1 -0
- package/docs-dist/assets/guide_authentication.md.CZCKocgR.js +4 -0
- package/docs-dist/assets/guide_authentication.md.CZCKocgR.lean.js +1 -0
- package/docs-dist/assets/guide_index.md.CkJ-jjL0.js +1 -0
- package/docs-dist/assets/guide_index.md.CkJ-jjL0.lean.js +1 -0
- package/docs-dist/assets/guide_installation.md.D2TBzILh.js +7 -0
- package/docs-dist/assets/guide_installation.md.D2TBzILh.lean.js +1 -0
- package/docs-dist/assets/guide_quickstart.md.J7Sib8wg.js +13 -0
- package/docs-dist/assets/guide_quickstart.md.J7Sib8wg.lean.js +1 -0
- package/docs-dist/assets/index.md.ClwYf6Qc.js +1 -0
- package/docs-dist/assets/index.md.ClwYf6Qc.lean.js +1 -0
- package/docs-dist/assets/inter-italic-cyrillic-ext._dlW9xFb.woff2 +0 -0
- package/docs-dist/assets/inter-italic-cyrillic.D7dRslh9.woff2 +0 -0
- package/docs-dist/assets/inter-italic-greek-ext.Ct-Tf2bq.woff2 +0 -0
- package/docs-dist/assets/inter-italic-greek.DNcpQ8QC.woff2 +0 -0
- package/docs-dist/assets/inter-italic-latin-ext.DytegdRQ.woff2 +0 -0
- package/docs-dist/assets/inter-italic-latin.COaG5lWR.woff2 +0 -0
- package/docs-dist/assets/inter-italic-vietnamese.BI5UxJD-.woff2 +0 -0
- package/docs-dist/assets/inter-roman-cyrillic-ext.BeNbU08G.woff2 +0 -0
- package/docs-dist/assets/inter-roman-cyrillic.CD0kT8R4.woff2 +0 -0
- package/docs-dist/assets/inter-roman-greek-ext.CFAEQ5Ow.woff2 +0 -0
- package/docs-dist/assets/inter-roman-greek.Dsf7YjP7.woff2 +0 -0
- package/docs-dist/assets/inter-roman-latin-ext.Dl_ayf4-.woff2 +0 -0
- package/docs-dist/assets/inter-roman-latin.Cy4MYw_J.woff2 +0 -0
- package/docs-dist/assets/inter-roman-vietnamese.CpqCnS2H.woff2 +0 -0
- package/docs-dist/assets/reference_response-format.md.BrGoGoPV.js +12 -0
- package/docs-dist/assets/reference_response-format.md.BrGoGoPV.lean.js +1 -0
- package/docs-dist/assets/style.D_YoXH3a.css +1 -0
- package/docs-dist/guide/architecture.html +29 -29
- package/docs-dist/guide/authentication.html +12 -12
- package/docs-dist/guide/index.html +10 -10
- package/docs-dist/guide/installation.html +13 -13
- package/docs-dist/guide/quickstart.html +15 -15
- package/docs-dist/hashmap.json +1 -1
- package/docs-dist/index.html +10 -10
- package/docs-dist/reference/response-format.html +13 -13
- package/docs-dist/version.json +3 -3
- package/package.json +20 -16
- package/public/index.html +966 -0
- package/public/playground-utils.js +150 -0
- package/dist/jest.config.js +0 -52
- package/dist/scripts/run-tests-with-flags.js +0 -139
- package/dist/types/api.js +0 -55
- package/docs-dist/assets/CHANGELOG-ARCHITECTURE.md.DV9Xr7ve.lean.js +0 -1
- package/docs-dist/assets/COOKIE_CONFIG_GUIDE.md.B2-aTdcH.js +0 -13
- package/docs-dist/assets/COOKIE_CONFIG_GUIDE.md.B2-aTdcH.lean.js +0 -1
- package/docs-dist/assets/FALLBACK_MODE_GUIDE.md.0wqXqYxw.lean.js +0 -1
- package/docs-dist/assets/README.md.DFCMeLFa.js +0 -421
- package/docs-dist/assets/README.md.DFCMeLFa.lean.js +0 -1
- package/docs-dist/assets/TEST_USER_PLAYLISTS.md.Bj0AVpHw.js +0 -16
- package/docs-dist/assets/TEST_USER_PLAYLISTS.md.Bj0AVpHw.lean.js +0 -1
- package/docs-dist/assets/USER_AVATAR_GUIDE.md.CGPI9GUj.lean.js +0 -1
- package/docs-dist/assets/api_comments.md.CATvWhrg.lean.js +0 -1
- package/docs-dist/assets/api_index.md.Dqx3qXyO.js +0 -1
- package/docs-dist/assets/api_index.md.Dqx3qXyO.lean.js +0 -1
- package/docs-dist/assets/api_music.md.D20_neZB.lean.js +0 -1
- package/docs-dist/assets/api_other.md.CXyEsl8R.js +0 -7
- package/docs-dist/assets/api_other.md.CXyEsl8R.lean.js +0 -1
- package/docs-dist/assets/api_playlist.md.CyLdLRR9.lean.js +0 -1
- package/docs-dist/assets/api_rank.md.Z3xyYG_S.lean.js +0 -1
- package/docs-dist/assets/api_search.md.D_lbFmYo.lean.js +0 -1
- package/docs-dist/assets/api_singer.md.BbyYE88D.js +0 -21
- package/docs-dist/assets/api_singer.md.BbyYE88D.lean.js +0 -1
- package/docs-dist/assets/api_user.md.4WdmTXIB.lean.js +0 -1
- package/docs-dist/assets/app.2f7gcITE.js +0 -1
- package/docs-dist/assets/chunks/@localSearchIndexroot.D461xa5C.js +0 -1
- package/docs-dist/assets/chunks/VPLocalSearchBox.BiPSl83v.js +0 -9
- package/docs-dist/assets/chunks/framework.aJbMEiY9.js +0 -19
- package/docs-dist/assets/chunks/theme.BrMPT0hE.js +0 -2
- package/docs-dist/assets/guide_architecture.md.D_46khUI.lean.js +0 -1
- package/docs-dist/assets/guide_authentication.md.nCiAu07w.js +0 -4
- package/docs-dist/assets/guide_authentication.md.nCiAu07w.lean.js +0 -1
- package/docs-dist/assets/guide_index.md.gLozHqz5.js +0 -1
- package/docs-dist/assets/guide_index.md.gLozHqz5.lean.js +0 -1
- package/docs-dist/assets/guide_installation.md.BUDl8zk1.js +0 -7
- package/docs-dist/assets/guide_installation.md.BUDl8zk1.lean.js +0 -1
- package/docs-dist/assets/guide_quickstart.md.COQUzUN9.js +0 -13
- package/docs-dist/assets/guide_quickstart.md.COQUzUN9.lean.js +0 -1
- package/docs-dist/assets/index.md.DBZfQ2kF.js +0 -1
- package/docs-dist/assets/index.md.DBZfQ2kF.lean.js +0 -1
- package/docs-dist/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
- package/docs-dist/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
- package/docs-dist/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
- package/docs-dist/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
- package/docs-dist/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
- package/docs-dist/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
- package/docs-dist/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
- package/docs-dist/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
- package/docs-dist/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
- package/docs-dist/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
- package/docs-dist/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
- package/docs-dist/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
- package/docs-dist/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
- package/docs-dist/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
- package/docs-dist/assets/reference_response-format.md.yrdeqFUN.js +0 -12
- package/docs-dist/assets/reference_response-format.md.yrdeqFUN.lean.js +0 -1
- package/docs-dist/assets/style.DM4qKDd4.css +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
|
-
## 2.
|
|
1
|
+
## 2.3.1 (2026-05-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## 2.3.1 (2026-05-17)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* refresh docs and package contents ([#15](https://github.com/sansenjian/qq-music-api/issues/15)) ([2b8cca1](https://github.com/sansenjian/qq-music-api/commit/2b8cca11ef9eff1daca4bbc5c3c5783124434471))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 2.2.11 (2026-03-21)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* Dockerfile to reduce vulnerabilities ([#14](https://github.com/sansenjian/qq-music-api/issues/14)) ([a1e439d](https://github.com/sansenjian/qq-music-api/commit/a1e439d25bd5f19c93aeb4f67a6f26ba660248d0))
|
|
2
20
|
|
|
3
21
|
|
|
4
22
|
|
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
-
<img src='music.png' />
|
|
6
|
-
|
|
7
5
|
  
|
|
8
6
|
<br />
|
|
9
7
|

|
|
@@ -18,13 +16,15 @@
|
|
|
18
16
|
> 基于 Koa 2 与 TypeScript 的 QQ 音乐 API 服务,包含扫码登录、用户头像、MV 播放地址、批量接口等能力。
|
|
19
17
|
> 当前代码仅供学习与研究使用,不可做商业用途。
|
|
20
18
|
|
|
19
|
+
> 从 `2.3.0` 开始,新版本会持续减少 npm 包安装时的依赖体积,推荐新项目和升级用户优先使用 `2.3` 及之后版本。
|
|
20
|
+
|
|
21
21
|
## 项目概览
|
|
22
22
|
|
|
23
23
|
- 运行时:Node.js 20+
|
|
24
24
|
- 服务框架:Koa 2
|
|
25
25
|
- 开发语言:TypeScript
|
|
26
26
|
- 路由系统:[@koa/router](package.json:53)
|
|
27
|
-
- 文档系统:[
|
|
27
|
+
- 文档系统:[VitePress 2](https://vitepress.dev/)
|
|
28
28
|
- 测试框架:[`Jest`](package.json:89)
|
|
29
29
|
- 默认端口:`3200`
|
|
30
30
|
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
|
|
33
33
|
> 当前版本已包含扫码登录相关接口,并已完成 TypeScript 迁移。
|
|
34
34
|
|
|
35
|
-

|
|
36
35
|
|
|
37
36
|
📖 **详细 API 文档**: [查看完整 API 文档](https://sansenjian.github.io/qq-music-api/)
|
|
38
37
|
|
|
@@ -60,13 +59,15 @@ npm install
|
|
|
60
59
|
npm install @sansenjian/qq-music-api
|
|
61
60
|
```
|
|
62
61
|
|
|
62
|
+
NPM 包默认包含运行所需的 `dist/`、本地交互测试页 `public/`,以及已构建的文档站点 `docs-dist/`。如果你只想在自己的发布产物中保留 API 运行时,可以在你的项目打包配置中自行排除 `node_modules/@sansenjian/qq-music-api/docs-dist/` 或 `node_modules/@sansenjian/qq-music-api/public/`。
|
|
63
|
+
|
|
63
64
|
在项目中使用:
|
|
64
65
|
|
|
65
66
|
```javascript
|
|
66
67
|
const { spawn } = require('child_process');
|
|
67
68
|
const path = require('path');
|
|
68
69
|
|
|
69
|
-
const qqMusicPath = path.join(__dirname, 'node_modules', '@sansenjian/qq-music-api', 'app.js');
|
|
70
|
+
const qqMusicPath = path.join(__dirname, 'node_modules', '@sansenjian/qq-music-api', 'dist', 'app.js');
|
|
70
71
|
|
|
71
72
|
spawn('node', [qqMusicPath], {
|
|
72
73
|
env: { ...process.env, PORT: '3200' },
|
|
@@ -102,13 +103,11 @@ npm run docs:dev
|
|
|
102
103
|
| 依赖 | 当前版本 |
|
|
103
104
|
| ----------------------- | --------- |
|
|
104
105
|
| `@koa/router` | `^15.3.1` |
|
|
105
|
-
| `axios` | `^1.
|
|
106
|
-
| `
|
|
107
|
-
| `is-generator-function` | `1.0.10` |
|
|
106
|
+
| `axios` | `^1.16.0` |
|
|
107
|
+
| `chalk` | `^4.1.0` |
|
|
108
108
|
| `koa` | `^2.16.1` |
|
|
109
109
|
| `koa-bodyparser` | `^4.4.1` |
|
|
110
110
|
| `koa-static` | `^5.0.0` |
|
|
111
|
-
| `reflect-metadata` | `^0.2.2` |
|
|
112
111
|
|
|
113
112
|
### 开发依赖
|
|
114
113
|
|
|
@@ -127,7 +126,6 @@ npm run docs:dev
|
|
|
127
126
|
| `@types/koa-bodyparser` | `^4.3.13` |
|
|
128
127
|
| `@types/node` | `^25.3.3` |
|
|
129
128
|
| `@types/supertest` | `^7.2.0` |
|
|
130
|
-
| `chalk` | `^4.1.0` |
|
|
131
129
|
| `conventional-changelog-cli` | `^4.0.0` |
|
|
132
130
|
| `eslint` | `^8.57.0` |
|
|
133
131
|
| `eslint-config-standard` | `^17.0.0` |
|
|
@@ -146,7 +144,7 @@ npm run docs:dev
|
|
|
146
144
|
| `ts-node` | `^10.9.2` |
|
|
147
145
|
| `tsx` | `^4.21.0` |
|
|
148
146
|
| `typescript` | `5.7.3` |
|
|
149
|
-
| `vitepress` | `^
|
|
147
|
+
| `vitepress` | `^2.0.0-alpha.17` |
|
|
150
148
|
| `vue` | `^3.5.29` |
|
|
151
149
|
|
|
152
150
|
## 当前主要能力
|
|
@@ -185,6 +183,7 @@ npm run docs:dev
|
|
|
185
183
|
|
|
186
184
|
- 用户接口说明:[`docs/api/user.md`](docs/api/user.md)
|
|
187
185
|
- 其他接口说明:[`docs/api/other.md`](docs/api/other.md)
|
|
186
|
+
- API 调试台:[`docs/api/playground.md`](docs/api/playground.md)
|
|
188
187
|
- 用户歌单测试说明:[`docs/TEST_USER_PLAYLISTS.md`](docs/TEST_USER_PLAYLISTS.md)
|
|
189
188
|
- 在线文档主页: [https://sansenjian.github.io/qq-music-api/](https://sansenjian.github.io/qq-music-api/)
|
|
190
189
|
|
package/dist/app.js
CHANGED
|
@@ -3,7 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
require("reflect-metadata");
|
|
7
6
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
7
|
const colors_1 = __importDefault(require("./util/colors"));
|
|
9
8
|
const service_config_1 = __importDefault(require("./config/service-config"));
|
package/dist/koaApp.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const koa_1 = __importDefault(require("koa"));
|
|
7
7
|
const koa_bodyparser_1 = __importDefault(require("koa-bodyparser"));
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
9
|
const path_1 = __importDefault(require("path"));
|
|
9
10
|
const koa_static_1 = __importDefault(require("koa-static"));
|
|
10
11
|
const koa_cors_1 = __importDefault(require("./middlewares/koa-cors"));
|
|
@@ -14,11 +15,14 @@ const fallback_middleware_1 = __importDefault(require("./middlewares/fallback-mi
|
|
|
14
15
|
const colors_1 = __importDefault(require("./util/colors"));
|
|
15
16
|
const user_info_1 = __importDefault(require("./config/user-info"));
|
|
16
17
|
const app = new koa_1.default();
|
|
18
|
+
const publicDir = fs_1.default.existsSync(path_1.default.join(__dirname, 'public'))
|
|
19
|
+
? path_1.default.join(__dirname, 'public')
|
|
20
|
+
: path_1.default.join(__dirname, '..', 'public');
|
|
17
21
|
global.userInfo = user_info_1.default;
|
|
18
22
|
app.use((0, koa_bodyparser_1.default)());
|
|
19
23
|
app.use((0, fallback_middleware_1.default)());
|
|
20
24
|
app.use((0, cookie_1.default)());
|
|
21
|
-
app.use((0, koa_static_1.default)(
|
|
25
|
+
app.use((0, koa_static_1.default)(publicDir));
|
|
22
26
|
// logger
|
|
23
27
|
app.use(async (ctx, next) => {
|
|
24
28
|
await next();
|
|
@@ -113,6 +113,7 @@ exports.default = async ({ method = 'get', params = {}, option = {} }) => {
|
|
|
113
113
|
const guid = String(config_1._guid || '1429839143');
|
|
114
114
|
const cookie = getCookieFromOptions(option);
|
|
115
115
|
const uin = resolveUin(cookie);
|
|
116
|
+
const authst = (0, cookieResolver_1.extractCookieValue)(cookie, 'qqmusic_key');
|
|
116
117
|
const fileType = FILE_TYPE_MAP[quality];
|
|
117
118
|
const filename = songmidList.map(item => `${fileType.prefix}${item}${mediaId || item}${fileType.suffix}`);
|
|
118
119
|
const requestPayload = {
|
|
@@ -126,7 +127,8 @@ exports.default = async ({ method = 'get', params = {}, option = {} }) => {
|
|
|
126
127
|
songtype: [0],
|
|
127
128
|
uin,
|
|
128
129
|
loginflag: 1,
|
|
129
|
-
platform: '20'
|
|
130
|
+
platform: '20',
|
|
131
|
+
...(authst ? { authst } : {})
|
|
130
132
|
}
|
|
131
133
|
},
|
|
132
134
|
loginUin: uin,
|
|
@@ -139,7 +141,6 @@ exports.default = async ({ method = 'get', params = {}, option = {} }) => {
|
|
|
139
141
|
};
|
|
140
142
|
const upstreamParams = {
|
|
141
143
|
format: 'json',
|
|
142
|
-
sign: 'zzannc1o6o9b4i971602f3554385022046ab796512b7012',
|
|
143
144
|
data: JSON.stringify(requestPayload)
|
|
144
145
|
};
|
|
145
146
|
try {
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sansenjian/qq-music-api",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -10,8 +10,20 @@
|
|
|
10
10
|
"qq-music-api": "dist/app.js"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
|
-
"dist",
|
|
13
|
+
"dist/api",
|
|
14
|
+
"dist/app.js",
|
|
15
|
+
"dist/config/service-config.js",
|
|
16
|
+
"dist/config/service-config.json",
|
|
17
|
+
"dist/config/user-info.js",
|
|
18
|
+
"dist/index.js",
|
|
19
|
+
"dist/koaApp.js",
|
|
20
|
+
"dist/middlewares",
|
|
21
|
+
"dist/module",
|
|
22
|
+
"dist/package.json",
|
|
23
|
+
"dist/routers",
|
|
24
|
+
"dist/util",
|
|
14
25
|
"docs-dist",
|
|
26
|
+
"public",
|
|
15
27
|
"README.md",
|
|
16
28
|
"CHANGELOG.md",
|
|
17
29
|
"LICENSE"
|
|
@@ -23,7 +35,7 @@
|
|
|
23
35
|
},
|
|
24
36
|
"scripts": {
|
|
25
37
|
"dev": "tsx app.ts",
|
|
26
|
-
"build": "tsc",
|
|
38
|
+
"build": "rimraf dist && tsc",
|
|
27
39
|
"start": "node dist/app.js",
|
|
28
40
|
"vercel-build": "npm run build && npm run docs:build && (cp -r public dist/ 2>/dev/null || true)",
|
|
29
41
|
"docs:build": "node scripts/generate-version.js && vitepress build docs",
|
|
@@ -66,18 +78,11 @@
|
|
|
66
78
|
"homepage": "https://github.com/sansenjian/qq-music-api#readme",
|
|
67
79
|
"dependencies": {
|
|
68
80
|
"@koa/router": "^15.3.1",
|
|
69
|
-
"axios": "^1.
|
|
70
|
-
"
|
|
71
|
-
"is-generator-function": "1.0.10",
|
|
81
|
+
"axios": "^1.16.0",
|
|
82
|
+
"chalk": "^4.1.0",
|
|
72
83
|
"koa": "^2.16.1",
|
|
73
84
|
"koa-bodyparser": "^4.4.1",
|
|
74
|
-
"koa-static": "^5.0.0"
|
|
75
|
-
"reflect-metadata": "^0.2.2"
|
|
76
|
-
},
|
|
77
|
-
"pnpm": {
|
|
78
|
-
"overrides": {
|
|
79
|
-
"is-generator-function": "^1.0.10"
|
|
80
|
-
}
|
|
85
|
+
"koa-static": "^5.0.0"
|
|
81
86
|
},
|
|
82
87
|
"devDependencies": {
|
|
83
88
|
"@commitlint/cli": "^18.0.0",
|
|
@@ -91,7 +96,6 @@
|
|
|
91
96
|
"@types/supertest": "^7.2.0",
|
|
92
97
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
93
98
|
"@typescript-eslint/parser": "^6.21.0",
|
|
94
|
-
"chalk": "^4.1.0",
|
|
95
99
|
"conventional-changelog-cli": "^4.0.0",
|
|
96
100
|
"eslint": "^8.57.0",
|
|
97
101
|
"eslint-config-standard": "^17.0.0",
|
|
@@ -111,10 +115,10 @@
|
|
|
111
115
|
"ts-node": "^10.9.2",
|
|
112
116
|
"tsx": "^4.21.0",
|
|
113
117
|
"typescript": "5.7.3",
|
|
114
|
-
"vitepress": "^
|
|
118
|
+
"vitepress": "^2.0.0-alpha.17",
|
|
115
119
|
"vue": "^3.5.29"
|
|
116
120
|
},
|
|
117
121
|
"engines": {
|
|
118
|
-
"node": "
|
|
122
|
+
"node": ">=20.0.0"
|
|
119
123
|
}
|
|
120
124
|
}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.resolveRequestCookie = exports.setRequestCookieContext = exports.extractUinFromCookie = void 0;
|
|
6
|
+
exports.resolveRequestCookie = exports.setRequestCookieContext = exports.extractUinFromCookie = exports.extractCookieValue = void 0;
|
|
7
7
|
const service_config_1 = __importDefault(require("../config/service-config"));
|
|
8
8
|
const normalizeCookieValue = (value) => {
|
|
9
9
|
if (Array.isArray(value)) {
|
|
@@ -15,11 +15,17 @@ const normalizeCookieValue = (value) => {
|
|
|
15
15
|
const normalized = value.trim();
|
|
16
16
|
return normalized ? normalized : undefined;
|
|
17
17
|
};
|
|
18
|
-
const
|
|
18
|
+
const extractCookieValue = (cookie, name) => {
|
|
19
19
|
if (!cookie)
|
|
20
20
|
return undefined;
|
|
21
|
-
const
|
|
22
|
-
|
|
21
|
+
const escapedName = name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
22
|
+
const match = cookie.match(new RegExp(`(?:^|;\\s*)${escapedName}=([^;]*)`));
|
|
23
|
+
const value = match?.[1]?.trim();
|
|
24
|
+
return value || undefined;
|
|
25
|
+
};
|
|
26
|
+
exports.extractCookieValue = extractCookieValue;
|
|
27
|
+
const extractUinFromCookie = (cookie) => {
|
|
28
|
+
return (0, exports.extractCookieValue)(cookie, 'uin');
|
|
23
29
|
};
|
|
24
30
|
exports.extractUinFromCookie = extractUinFromCookie;
|
|
25
31
|
const setRequestCookieContext = (ctx, cookie) => {
|
package/docs-dist/404.html
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
|
-
<html lang="
|
|
2
|
+
<html lang="zh-CN" dir="ltr">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
6
|
<title>404 | QQ Music API</title>
|
|
7
7
|
<meta name="description" content="Not Found">
|
|
8
|
-
<meta name="generator" content="VitePress
|
|
9
|
-
<link rel="preload stylesheet" href="/qq-music-api/assets/style.
|
|
8
|
+
<meta name="generator" content="VitePress v2.0.0-alpha.17">
|
|
9
|
+
<link rel="preload stylesheet" href="/qq-music-api/assets/style.D_YoXH3a.css" as="style">
|
|
10
10
|
<link rel="preload stylesheet" href="/qq-music-api/vp-icons.css" as="style">
|
|
11
11
|
|
|
12
|
-
<script type="module" src="/qq-music-api/assets/app.
|
|
13
|
-
<link rel="preload" href="/qq-music-api/assets/inter-roman-latin.
|
|
12
|
+
<script type="module" src="/qq-music-api/assets/app.CxuIZ1W7.js"></script>
|
|
13
|
+
<link rel="preload" href="/qq-music-api/assets/inter-roman-latin.Cy4MYw_J.woff2" as="font" type="font/woff2" crossorigin="">
|
|
14
14
|
<link rel="icon" href="/logo.svg">
|
|
15
15
|
<meta name="theme-color" content="#12b7f5">
|
|
16
16
|
<script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</head>
|
|
19
19
|
<body>
|
|
20
20
|
<div id="app"></div>
|
|
21
|
-
<script>window.__VP_HASH_MAP__=JSON.parse("{\"api_comments.md\":\"
|
|
21
|
+
<script>window.__VP_HASH_MAP__=JSON.parse("{\"api_comments.md\":\"5nDhrWa8\",\"api_index.md\":\"DdG1WHkZ\",\"api_music.md\":\"D66hq-_4\",\"api_other.md\":\"9KhspVEM\",\"api_playground.md\":\"BZBvYMm2\",\"api_playlist.md\":\"BQK32ZyE\",\"api_rank.md\":\"z7YBwVgw\",\"api_search.md\":\"GfzIBRfc\",\"api_singer.md\":\"BDR-_qDH\",\"api_user.md\":\"Dx8BWGrb\",\"changelog-architecture.md\":\"CYHmaBdY\",\"cookie_config_guide.md\":\"Nvywo7CW\",\"degrade_examples.md\":\"Cz2J-qwE\",\"fallback_mode_guide.md\":\"wKA9yqoI\",\"guide_architecture.md\":\"SHnKkzwb\",\"guide_authentication.md\":\"CZCKocgR\",\"guide_index.md\":\"CkJ-jjL0\",\"guide_installation.md\":\"D2TBzILh\",\"guide_quickstart.md\":\"J7Sib8wg\",\"index.md\":\"ClwYf6Qc\",\"quick_start.md\":\"D5KfDgbs\",\"readme.md\":\"CHbArqA7\",\"reference_response-format.md\":\"BrGoGoPV\",\"test_user_playlists.md\":\"BfBxYbaM\",\"user_avatar_guide.md\":\"D5Rti1Gg\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"QQ Music API\",\"description\":\"QQ 音乐 API 接口文档\",\"base\":\"/qq-music-api/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"/\"},{\"text\":\"使用指南\",\"link\":\"/guide/\"},{\"text\":\"API 文档\",\"link\":\"/api/\"},{\"text\":\"API 调试台\",\"link\":\"/api/playground\"},{\"text\":\"用户能力\",\"link\":\"/api/user\"},{\"text\":\"架构说明\",\"link\":\"/guide/architecture\"}],\"sidebar\":[{\"text\":\"开始使用\",\"items\":[{\"text\":\"首页\",\"link\":\"/\"},{\"text\":\"使用指南\",\"link\":\"/guide/\"},{\"text\":\"安装指南\",\"link\":\"/guide/installation\"},{\"text\":\"快速开始\",\"link\":\"/guide/quickstart\"},{\"text\":\"快速使用指南\",\"link\":\"/QUICK_START\"},{\"text\":\"降级服务示例\",\"link\":\"/DEGRADE_EXAMPLES\"}]},{\"text\":\"认证与用户\",\"items\":[{\"text\":\"认证与登录\",\"link\":\"/guide/authentication\"},{\"text\":\"用户接口\",\"link\":\"/api/user\"}]},{\"text\":\"API 文档\",\"items\":[{\"text\":\"API 总览\",\"link\":\"/api/\"},{\"text\":\"音乐相关\",\"link\":\"/api/music\"},{\"text\":\"歌手相关\",\"link\":\"/api/singer\"},{\"text\":\"歌单相关\",\"link\":\"/api/playlist\"},{\"text\":\"排行榜\",\"link\":\"/api/rank\"},{\"text\":\"搜索\",\"link\":\"/api/search\"},{\"text\":\"评论\",\"link\":\"/api/comments\"},{\"text\":\"其他接口\",\"link\":\"/api/other\"},{\"text\":\"API 调试台\",\"link\":\"/api/playground\"}]},{\"text\":\"开发与维护\",\"items\":[{\"text\":\"响应格式\",\"link\":\"/reference/response-format\"},{\"text\":\"代码架构\",\"link\":\"/guide/architecture\"}]}],\"aside\":true,\"outline\":{\"level\":[2,3],\"label\":\"本页目录\"},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/sansenjian/qq-music-api\"}],\"footer\":{\"message\":\"基于 MIT 许可发布\",\"copyright\":\"Copyright © 2020-present Sansenjian\"},\"docFooter\":{\"prev\":\"上一页\",\"next\":\"下一页\"},\"lastUpdated\":{\"text\":\"最后更新于\",\"formatOptions\":{\"dateStyle\":\"short\",\"timeStyle\":\"short\",\"forceLocale\":true}},\"editLink\":{\"pattern\":\"https://github.com/sansenjian/qq-music-api/edit/main/docs/:path\",\"text\":\"在 GitHub 上编辑此页面\"},\"darkModeSwitchLabel\":\"主题\",\"lightModeSwitchTitle\":\"切换到浅色模式\",\"darkModeSwitchTitle\":\"切换到深色模式\",\"sidebarMenuLabel\":\"菜单\",\"returnToTopLabel\":\"返回顶部\",\"skipToContentLabel\":\"跳转到内容\",\"notFound\":{\"title\":\"页面未找到\",\"quote\":\"你访问的文档页不存在,可能已被移动或删除。\",\"link\":\"/\",\"linkLabel\":\"返回首页\",\"linkText\":\"返回首页\"},\"search\":{\"provider\":\"local\",\"options\":{\"detailedView\":\"auto\",\"translations\":{\"button\":{\"buttonText\":\"搜索\",\"buttonAriaLabel\":\"搜索文档\"},\"modal\":{\"displayDetails\":\"显示详细列表\",\"backButtonTitle\":\"返回\",\"noResultsText\":\"无法找到相关结果\",\"resetButtonTitle\":\"清除查询条件\",\"footer\":{\"selectText\":\"选择\",\"selectKeyAriaLabel\":\"回车键\",\"navigateText\":\"切换\",\"navigateUpKeyAriaLabel\":\"上箭头\",\"navigateDownKeyAriaLabel\":\"下箭头\",\"closeText\":\"关闭\",\"closeKeyAriaLabel\":\"Esc 键\"}}}}}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false,\"additionalConfig\":{}}");</script>
|
|
22
22
|
|
|
23
23
|
</body>
|
|
24
24
|
</html>
|