@kg-ai/kugou-skill 0.1.1 → 0.1.3
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/README.md +139 -139
- package/SKILL.md +12 -1
- package/bin/darwin-arm64/kugou-cli +0 -0
- package/bin/darwin-x64/kugou-cli +0 -0
- package/bin/kugou-cli.exe +0 -0
- package/bin/linux-arm64/kugou-cli +0 -0
- package/bin/linux-x64/kugou-cli +0 -0
- package/bin/win32-x64/kugou-cli.exe +0 -0
- package/package.json +1 -1
- package/references/auth.md +78 -6
- package/references/error-handling.md +2 -1
- package/references/install.md +54 -54
- package/references/music.md +323 -323
- package/references/output-format.md +42 -42
- package/references/update.md +128 -128
- package/scripts/build-all.js +52 -52
- package/scripts/pack.js +67 -67
- package/scripts/run.js +21 -21
package/references/music.md
CHANGED
|
@@ -1,323 +1,323 @@
|
|
|
1
|
-
# 音乐命令 (music)
|
|
2
|
-
|
|
3
|
-
> 🔐 = 所有 music 命令都需要先登录
|
|
4
|
-
|
|
5
|
-
## 命令列表
|
|
6
|
-
|
|
7
|
-
| 命令 | 说明 |
|
|
8
|
-
|------|------|
|
|
9
|
-
| `kugou-cli music search <keyword>` | 搜索歌曲 |
|
|
10
|
-
| `kugou-cli music recommend daily` | 每日推荐 |
|
|
11
|
-
| `kugou-cli music recommend similar -s <song>` | 相似歌曲推荐 |
|
|
12
|
-
| `kugou-cli music favorites` | 我的收藏 |
|
|
13
|
-
| `kugou-cli music recent` | 最近播放 |
|
|
14
|
-
| `kugou-cli music stats` | 听歌统计 |
|
|
15
|
-
| `kugou-cli music charts <rank_id>` | 榜单 |
|
|
16
|
-
| `kugou-cli music create-playlist <name>` | 创建歌单(可附加歌曲) |
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## 1. 搜索歌曲
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
kugou-cli music search "周杰伦"
|
|
24
|
-
kugou-cli music search "周杰伦" --page 1 --size 20
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
**参数**:
|
|
28
|
-
- `<keyword>`: 搜索关键词(必填)
|
|
29
|
-
- `--page`: 页码,默认 1
|
|
30
|
-
- `--size`: 每页数量,默认 20
|
|
31
|
-
|
|
32
|
-
**输出示例**:
|
|
33
|
-
```json
|
|
34
|
-
{
|
|
35
|
-
"errcode": 0,
|
|
36
|
-
"data": {
|
|
37
|
-
"list": [
|
|
38
|
-
{
|
|
39
|
-
"song_name": "晴天",
|
|
40
|
-
"mix_song_id": "32100650",
|
|
41
|
-
"artist_name": "周杰伦",
|
|
42
|
-
"play_link": "https://www.kugou.com/mixsong/agent_gateway/j410q78a01f.html"
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
"total": 480,
|
|
46
|
-
"page": 1,
|
|
47
|
-
"size": 20
|
|
48
|
-
},
|
|
49
|
-
"status": 1
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## 2. 歌曲推荐
|
|
56
|
-
|
|
57
|
-
支持三种推荐模式:
|
|
58
|
-
|
|
59
|
-
| 类型 | 说明 | 必填参数 |
|
|
60
|
-
|------|------|---------|
|
|
61
|
-
| `guess` | 猜你喜欢,基于用户喜好推荐 | 无 |
|
|
62
|
-
| `similar` | 相似推荐,根据指定歌曲推荐相似歌曲 | `--song` |
|
|
63
|
-
| `text` | 文本推歌,根据文本描述推荐歌曲 | `--text` |
|
|
64
|
-
|
|
65
|
-
### 2.1 猜你喜欢
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
kugou-cli music recommend guess
|
|
69
|
-
kugou-cli music recommend guess --num 10
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
**参数**:
|
|
73
|
-
- `--num`: 推荐数量,默认 10
|
|
74
|
-
|
|
75
|
-
### 2.2 相似推荐
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
kugou-cli music recommend similar -s "晴天"
|
|
79
|
-
kugou-cli music recommend similar --song "晴天" -n 5
|
|
80
|
-
kugou-cli music recommend similar --song "晴天" --text "风格相似的" -n 5
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
**参数**:
|
|
84
|
-
- `-s, --song`: 歌曲名称(必填)
|
|
85
|
-
- `-n, --num`: 推荐数量,默认 10
|
|
86
|
-
- `-t, --text`: 描述文本(可选),用于进一步细化相似方向
|
|
87
|
-
|
|
88
|
-
### 2.3 文本推歌
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
kugou-cli music recommend text --text "适合跑步时听的快节奏歌曲"
|
|
92
|
-
kugou-cli music recommend text --text "安静的钢琴曲" --num 5
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
**参数**:
|
|
96
|
-
- `-t, --text`: 文本描述(必填)
|
|
97
|
-
- `-n, --num`: 推荐数量,默认 10
|
|
98
|
-
|
|
99
|
-
**输出示例**:
|
|
100
|
-
```json
|
|
101
|
-
{
|
|
102
|
-
"errcode": 0,
|
|
103
|
-
"data": {
|
|
104
|
-
"list": [
|
|
105
|
-
{
|
|
106
|
-
"song_name": "稻香",
|
|
107
|
-
"mix_song_id": "8889",
|
|
108
|
-
"artist_name": "周杰伦",
|
|
109
|
-
"play_link": "https://www.kugou.com/mixsong/agent_gateway/xxx.html"
|
|
110
|
-
}
|
|
111
|
-
]
|
|
112
|
-
},
|
|
113
|
-
"status": 1
|
|
114
|
-
}
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
## 4. 我的收藏
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
kugou-cli music favorites
|
|
123
|
-
kugou-cli music favorites --page 1 --size 20
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
**参数**:
|
|
127
|
-
- `--page`: 页码,默认 1
|
|
128
|
-
- `--size`: 每页数量,默认 20
|
|
129
|
-
|
|
130
|
-
> 注意:固定返回最近 10 首收藏,查看更多请前往酷狗App
|
|
131
|
-
|
|
132
|
-
**输出示例**:
|
|
133
|
-
```json
|
|
134
|
-
{
|
|
135
|
-
"errcode": 0,
|
|
136
|
-
"data": {
|
|
137
|
-
"list": [
|
|
138
|
-
{
|
|
139
|
-
"song_name": "晴天",
|
|
140
|
-
"mix_song_id": "32100650",
|
|
141
|
-
"artist_name": "周杰伦",
|
|
142
|
-
"play_link": "https://www.kugou.com/mixsong/agent_gateway/j410q78a01f.html"
|
|
143
|
-
}
|
|
144
|
-
],
|
|
145
|
-
"total": 50,
|
|
146
|
-
"msg": "当前仅显示最近的10首收藏,查看更多内容,请前往酷狗App"
|
|
147
|
-
},
|
|
148
|
-
"status": 1
|
|
149
|
-
}
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
---
|
|
153
|
-
|
|
154
|
-
## 5. 最近播放
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
kugou-cli music recent
|
|
158
|
-
kugou-cli music recent --page 1 --size 20
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
**参数**:
|
|
162
|
-
- `--page`: 页码,默认 1
|
|
163
|
-
- `--size`: 每页数量,默认 20
|
|
164
|
-
|
|
165
|
-
> 注意:固定返回最近 10 首播放记录,查看更多请前往酷狗App
|
|
166
|
-
|
|
167
|
-
**输出示例**:
|
|
168
|
-
```json
|
|
169
|
-
{
|
|
170
|
-
"errcode": 0,
|
|
171
|
-
"data": {
|
|
172
|
-
"list": [
|
|
173
|
-
{
|
|
174
|
-
"song_name": "七里香",
|
|
175
|
-
"mix_song_id": "32100651",
|
|
176
|
-
"artist_name": "周杰伦",
|
|
177
|
-
"play_link": "https://www.kugou.com/mixsong/agent_gateway/j410q78a01f.html"
|
|
178
|
-
}
|
|
179
|
-
],
|
|
180
|
-
"total": 100,
|
|
181
|
-
"msg": "当前仅显示最近的10首最近播放,查看更多内容,请前往酷狗App"
|
|
182
|
-
},
|
|
183
|
-
"status": 1
|
|
184
|
-
}
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
---
|
|
188
|
-
|
|
189
|
-
## 6. 听歌统计
|
|
190
|
-
|
|
191
|
-
```bash
|
|
192
|
-
kugou-cli music stats # 默认查当月
|
|
193
|
-
kugou-cli music stats --date-type 1 --date 20260501 # 指定周查询
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
**参数**:
|
|
197
|
-
- `--date-type`: 日期类型,0=日、1=周、2=月,默认 2(月)
|
|
198
|
-
- `--date`: 查询日期,YYYYMMDD 格式,如 "20260501"(不填默认当月第一天)
|
|
199
|
-
- 日类型:每天日期,如 "20260501"
|
|
200
|
-
- 周类型:必须是周一日期,如 "20260505"(周一)
|
|
201
|
-
- 月类型:必须是月份第一天,如 "20260501"(5月1日)
|
|
202
|
-
|
|
203
|
-
**输出示例**:
|
|
204
|
-
```json
|
|
205
|
-
{
|
|
206
|
-
"errcode": 0,
|
|
207
|
-
"data": {
|
|
208
|
-
"server_time": 1779977674,
|
|
209
|
-
"listen_duration": 80776,
|
|
210
|
-
"accumulate_listen_days": 30,
|
|
211
|
-
"continue_listen_days": 7,
|
|
212
|
-
"listen_total": 342,
|
|
213
|
-
"last_listen_total": 387,
|
|
214
|
-
"top_clocks": [
|
|
215
|
-
"今日08:00-10:00听歌30分钟",
|
|
216
|
-
"今日14:00-16:00听歌25分钟",
|
|
217
|
-
"今日20:00-22:00听歌20分钟"
|
|
218
|
-
],
|
|
219
|
-
"rank_song": [
|
|
220
|
-
{
|
|
221
|
-
"song_info": {"song_name": "晴天", "mix_song_id": "8888", "artist_name": "周杰伦", "play_link": "https://www.kugou.com/..."},
|
|
222
|
-
"count": 50
|
|
223
|
-
}
|
|
224
|
-
],
|
|
225
|
-
"rank_singer": [
|
|
226
|
-
{"singer_id": 123, "name": "周杰伦", "avatar": "https://xxx.jpg", "total": 120}
|
|
227
|
-
],
|
|
228
|
-
"rank_style": [
|
|
229
|
-
{"style": "流行", "total": 200, "count": 80}
|
|
230
|
-
],
|
|
231
|
-
"rank_language": [
|
|
232
|
-
{"language": "华语", "total": 400, "count": 150}
|
|
233
|
-
]
|
|
234
|
-
},
|
|
235
|
-
"status": 1
|
|
236
|
-
}
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
**关键字段**:
|
|
240
|
-
- `listen_duration`: 今日/周/月听歌时长(秒)
|
|
241
|
-
- `top_clocks`: 听歌时长最长的 Top3 时段描述(日类型格式如"今日08:00-10:00听歌30分钟",周/月类型格式如"2026-02月听歌38213分钟")
|
|
242
|
-
- `accumulate_listen_days`: 累计听歌天数
|
|
243
|
-
- `continue_listen_days`: 连续听歌天数
|
|
244
|
-
- `listen_total`: 累计听歌次数
|
|
245
|
-
- `last_listen_total`: 昨日/上周/上月听歌次数
|
|
246
|
-
- `rank_song`: 播放最多的歌曲排行(`count` 为播放次数)
|
|
247
|
-
- `rank_singer`: 播放最多的歌手排行
|
|
248
|
-
- `rank_style`: 曲风分布统计
|
|
249
|
-
- `rank_language`: 语言分布统计
|
|
250
|
-
|
|
251
|
-
---
|
|
252
|
-
|
|
253
|
-
## 7. 榜单
|
|
254
|
-
|
|
255
|
-
```bash
|
|
256
|
-
kugou-cli music charts 6666
|
|
257
|
-
kugou-cli music charts 52144 --page 1 --size 20
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
**可用榜单 ID**:
|
|
261
|
-
|
|
262
|
-
| rank_id | 榜单名称 |
|
|
263
|
-
|---------|----------|
|
|
264
|
-
| 8888 | TOP500榜 |
|
|
265
|
-
| 90379 | 星耀星光榜 |
|
|
266
|
-
| 6666 | 飙升榜 |
|
|
267
|
-
| 85432 | 百万收藏榜 |
|
|
268
|
-
| 74534 | 新歌榜 |
|
|
269
|
-
| 52144 | 抖音热歌酷狗榜 |
|
|
270
|
-
|
|
271
|
-
**参数**:
|
|
272
|
-
- `<rank_id>`: 榜单 ID(必填)
|
|
273
|
-
- `--page`: 页码,默认 1
|
|
274
|
-
- `--size`: 每页数量,默认 20
|
|
275
|
-
|
|
276
|
-
---
|
|
277
|
-
|
|
278
|
-
## 8. 创建歌单
|
|
279
|
-
|
|
280
|
-
> 🔐 = 需要先登录
|
|
281
|
-
|
|
282
|
-
### 调用原则(AI 必读)
|
|
283
|
-
|
|
284
|
-
1. **被动调用**:必须用户**明确**要求创建歌单时才调用本命令,禁止在用户仅说"推荐/搜歌/听歌"时主动创建
|
|
285
|
-
2. **主动询问**:当通过搜索、推荐(猜你喜欢/相似/文本)等方式给出一批歌曲后,**必须**询问用户"是否需要将当前这批歌曲创建为歌单",等用户确认后再执行 `create-playlist --songs "<mix_song_id 列表>"`
|
|
286
|
-
3. **示例化推荐**:询问时建议给出歌单名建议(如"跑步歌单"、"周杰伦精选"),让用户更容易确认
|
|
287
|
-
|
|
288
|
-
### 接口说明
|
|
289
|
-
|
|
290
|
-
创建一个新的自建歌单,并可选择在创建后往歌单里添加歌曲。
|
|
291
|
-
|
|
292
|
-
```bash
|
|
293
|
-
# 创建空歌单
|
|
294
|
-
kugou-cli music create-playlist "我的空歌单"
|
|
295
|
-
|
|
296
|
-
# 创建歌单并添加歌曲
|
|
297
|
-
kugou-cli music create-playlist "我的批量歌单" --songs "
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
**参数**:
|
|
301
|
-
- `<name>`: 歌单名称(必填)
|
|
302
|
-
- `--songs`: 待添加的歌曲 mix_song_id 列表,逗号分隔(可选)。不传则只创建空歌单
|
|
303
|
-
|
|
304
|
-
**输出示例**:
|
|
305
|
-
```json
|
|
306
|
-
{
|
|
307
|
-
"errcode": 0,
|
|
308
|
-
"errmsg": "",
|
|
309
|
-
"data": {
|
|
310
|
-
"name": "我的批量歌单",
|
|
311
|
-
"song_list_url": "https://m.kugou.com/songlist/gcid_abc123def45"
|
|
312
|
-
},
|
|
313
|
-
"status": 1
|
|
314
|
-
}
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
**关键字段**:
|
|
318
|
-
- `name`: 歌单名称
|
|
319
|
-
- `song_list_url`: 歌单播放地址(H5 链接),可分享给用户打开
|
|
320
|
-
|
|
321
|
-
**异常说明**:
|
|
322
|
-
- 歌单创建成功但添加歌曲失败:返回 200 状态 + 错误信息,body 仍包含已创建歌单的 `name` 与 `song_list_url`
|
|
323
|
-
- 歌单创建失败:返回对应错误码(参数错误 20010 / 网络错误 90000 等)
|
|
1
|
+
# 音乐命令 (music)
|
|
2
|
+
|
|
3
|
+
> 🔐 = 所有 music 命令都需要先登录
|
|
4
|
+
|
|
5
|
+
## 命令列表
|
|
6
|
+
|
|
7
|
+
| 命令 | 说明 |
|
|
8
|
+
|------|------|
|
|
9
|
+
| `kugou-cli music search <keyword>` | 搜索歌曲 |
|
|
10
|
+
| `kugou-cli music recommend daily` | 每日推荐 |
|
|
11
|
+
| `kugou-cli music recommend similar -s <song>` | 相似歌曲推荐 |
|
|
12
|
+
| `kugou-cli music favorites` | 我的收藏 |
|
|
13
|
+
| `kugou-cli music recent` | 最近播放 |
|
|
14
|
+
| `kugou-cli music stats` | 听歌统计 |
|
|
15
|
+
| `kugou-cli music charts <rank_id>` | 榜单 |
|
|
16
|
+
| `kugou-cli music create-playlist <name>` | 创建歌单(可附加歌曲) |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 1. 搜索歌曲
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
kugou-cli music search "周杰伦"
|
|
24
|
+
kugou-cli music search "周杰伦" --page 1 --size 20
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**参数**:
|
|
28
|
+
- `<keyword>`: 搜索关键词(必填)
|
|
29
|
+
- `--page`: 页码,默认 1
|
|
30
|
+
- `--size`: 每页数量,默认 20
|
|
31
|
+
|
|
32
|
+
**输出示例**:
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"errcode": 0,
|
|
36
|
+
"data": {
|
|
37
|
+
"list": [
|
|
38
|
+
{
|
|
39
|
+
"song_name": "晴天",
|
|
40
|
+
"mix_song_id": "32100650",
|
|
41
|
+
"artist_name": "周杰伦",
|
|
42
|
+
"play_link": "https://www.kugou.com/mixsong/agent_gateway/j410q78a01f.html"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"total": 480,
|
|
46
|
+
"page": 1,
|
|
47
|
+
"size": 20
|
|
48
|
+
},
|
|
49
|
+
"status": 1
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 2. 歌曲推荐
|
|
56
|
+
|
|
57
|
+
支持三种推荐模式:
|
|
58
|
+
|
|
59
|
+
| 类型 | 说明 | 必填参数 |
|
|
60
|
+
|------|------|---------|
|
|
61
|
+
| `guess` | 猜你喜欢,基于用户喜好推荐 | 无 |
|
|
62
|
+
| `similar` | 相似推荐,根据指定歌曲推荐相似歌曲 | `--song` |
|
|
63
|
+
| `text` | 文本推歌,根据文本描述推荐歌曲 | `--text` |
|
|
64
|
+
|
|
65
|
+
### 2.1 猜你喜欢
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
kugou-cli music recommend guess
|
|
69
|
+
kugou-cli music recommend guess --num 10
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**参数**:
|
|
73
|
+
- `--num`: 推荐数量,默认 10
|
|
74
|
+
|
|
75
|
+
### 2.2 相似推荐
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
kugou-cli music recommend similar -s "晴天"
|
|
79
|
+
kugou-cli music recommend similar --song "晴天" -n 5
|
|
80
|
+
kugou-cli music recommend similar --song "晴天" --text "风格相似的" -n 5
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**参数**:
|
|
84
|
+
- `-s, --song`: 歌曲名称(必填)
|
|
85
|
+
- `-n, --num`: 推荐数量,默认 10
|
|
86
|
+
- `-t, --text`: 描述文本(可选),用于进一步细化相似方向
|
|
87
|
+
|
|
88
|
+
### 2.3 文本推歌
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
kugou-cli music recommend text --text "适合跑步时听的快节奏歌曲"
|
|
92
|
+
kugou-cli music recommend text --text "安静的钢琴曲" --num 5
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**参数**:
|
|
96
|
+
- `-t, --text`: 文本描述(必填)
|
|
97
|
+
- `-n, --num`: 推荐数量,默认 10
|
|
98
|
+
|
|
99
|
+
**输出示例**:
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"errcode": 0,
|
|
103
|
+
"data": {
|
|
104
|
+
"list": [
|
|
105
|
+
{
|
|
106
|
+
"song_name": "稻香",
|
|
107
|
+
"mix_song_id": "8889",
|
|
108
|
+
"artist_name": "周杰伦",
|
|
109
|
+
"play_link": "https://www.kugou.com/mixsong/agent_gateway/xxx.html"
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"status": 1
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## 4. 我的收藏
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
kugou-cli music favorites
|
|
123
|
+
kugou-cli music favorites --page 1 --size 20
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**参数**:
|
|
127
|
+
- `--page`: 页码,默认 1
|
|
128
|
+
- `--size`: 每页数量,默认 20
|
|
129
|
+
|
|
130
|
+
> 注意:固定返回最近 10 首收藏,查看更多请前往酷狗App
|
|
131
|
+
|
|
132
|
+
**输出示例**:
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"errcode": 0,
|
|
136
|
+
"data": {
|
|
137
|
+
"list": [
|
|
138
|
+
{
|
|
139
|
+
"song_name": "晴天",
|
|
140
|
+
"mix_song_id": "32100650",
|
|
141
|
+
"artist_name": "周杰伦",
|
|
142
|
+
"play_link": "https://www.kugou.com/mixsong/agent_gateway/j410q78a01f.html"
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"total": 50,
|
|
146
|
+
"msg": "当前仅显示最近的10首收藏,查看更多内容,请前往酷狗App"
|
|
147
|
+
},
|
|
148
|
+
"status": 1
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## 5. 最近播放
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
kugou-cli music recent
|
|
158
|
+
kugou-cli music recent --page 1 --size 20
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**参数**:
|
|
162
|
+
- `--page`: 页码,默认 1
|
|
163
|
+
- `--size`: 每页数量,默认 20
|
|
164
|
+
|
|
165
|
+
> 注意:固定返回最近 10 首播放记录,查看更多请前往酷狗App
|
|
166
|
+
|
|
167
|
+
**输出示例**:
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"errcode": 0,
|
|
171
|
+
"data": {
|
|
172
|
+
"list": [
|
|
173
|
+
{
|
|
174
|
+
"song_name": "七里香",
|
|
175
|
+
"mix_song_id": "32100651",
|
|
176
|
+
"artist_name": "周杰伦",
|
|
177
|
+
"play_link": "https://www.kugou.com/mixsong/agent_gateway/j410q78a01f.html"
|
|
178
|
+
}
|
|
179
|
+
],
|
|
180
|
+
"total": 100,
|
|
181
|
+
"msg": "当前仅显示最近的10首最近播放,查看更多内容,请前往酷狗App"
|
|
182
|
+
},
|
|
183
|
+
"status": 1
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## 6. 听歌统计
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
kugou-cli music stats # 默认查当月
|
|
193
|
+
kugou-cli music stats --date-type 1 --date 20260501 # 指定周查询
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**参数**:
|
|
197
|
+
- `--date-type`: 日期类型,0=日、1=周、2=月,默认 2(月)
|
|
198
|
+
- `--date`: 查询日期,YYYYMMDD 格式,如 "20260501"(不填默认当月第一天)
|
|
199
|
+
- 日类型:每天日期,如 "20260501"
|
|
200
|
+
- 周类型:必须是周一日期,如 "20260505"(周一)
|
|
201
|
+
- 月类型:必须是月份第一天,如 "20260501"(5月1日)
|
|
202
|
+
|
|
203
|
+
**输出示例**:
|
|
204
|
+
```json
|
|
205
|
+
{
|
|
206
|
+
"errcode": 0,
|
|
207
|
+
"data": {
|
|
208
|
+
"server_time": 1779977674,
|
|
209
|
+
"listen_duration": 80776,
|
|
210
|
+
"accumulate_listen_days": 30,
|
|
211
|
+
"continue_listen_days": 7,
|
|
212
|
+
"listen_total": 342,
|
|
213
|
+
"last_listen_total": 387,
|
|
214
|
+
"top_clocks": [
|
|
215
|
+
"今日08:00-10:00听歌30分钟",
|
|
216
|
+
"今日14:00-16:00听歌25分钟",
|
|
217
|
+
"今日20:00-22:00听歌20分钟"
|
|
218
|
+
],
|
|
219
|
+
"rank_song": [
|
|
220
|
+
{
|
|
221
|
+
"song_info": {"song_name": "晴天", "mix_song_id": "8888", "artist_name": "周杰伦", "play_link": "https://www.kugou.com/..."},
|
|
222
|
+
"count": 50
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
"rank_singer": [
|
|
226
|
+
{"singer_id": 123, "name": "周杰伦", "avatar": "https://xxx.jpg", "total": 120}
|
|
227
|
+
],
|
|
228
|
+
"rank_style": [
|
|
229
|
+
{"style": "流行", "total": 200, "count": 80}
|
|
230
|
+
],
|
|
231
|
+
"rank_language": [
|
|
232
|
+
{"language": "华语", "total": 400, "count": 150}
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
"status": 1
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**关键字段**:
|
|
240
|
+
- `listen_duration`: 今日/周/月听歌时长(秒)
|
|
241
|
+
- `top_clocks`: 听歌时长最长的 Top3 时段描述(日类型格式如"今日08:00-10:00听歌30分钟",周/月类型格式如"2026-02月听歌38213分钟")
|
|
242
|
+
- `accumulate_listen_days`: 累计听歌天数
|
|
243
|
+
- `continue_listen_days`: 连续听歌天数
|
|
244
|
+
- `listen_total`: 累计听歌次数
|
|
245
|
+
- `last_listen_total`: 昨日/上周/上月听歌次数
|
|
246
|
+
- `rank_song`: 播放最多的歌曲排行(`count` 为播放次数)
|
|
247
|
+
- `rank_singer`: 播放最多的歌手排行
|
|
248
|
+
- `rank_style`: 曲风分布统计
|
|
249
|
+
- `rank_language`: 语言分布统计
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## 7. 榜单
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
kugou-cli music charts 6666
|
|
257
|
+
kugou-cli music charts 52144 --page 1 --size 20
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
**可用榜单 ID**:
|
|
261
|
+
|
|
262
|
+
| rank_id | 榜单名称 |
|
|
263
|
+
|---------|----------|
|
|
264
|
+
| 8888 | TOP500榜 |
|
|
265
|
+
| 90379 | 星耀星光榜 |
|
|
266
|
+
| 6666 | 飙升榜 |
|
|
267
|
+
| 85432 | 百万收藏榜 |
|
|
268
|
+
| 74534 | 新歌榜 |
|
|
269
|
+
| 52144 | 抖音热歌酷狗榜 |
|
|
270
|
+
|
|
271
|
+
**参数**:
|
|
272
|
+
- `<rank_id>`: 榜单 ID(必填)
|
|
273
|
+
- `--page`: 页码,默认 1
|
|
274
|
+
- `--size`: 每页数量,默认 20
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## 8. 创建歌单
|
|
279
|
+
|
|
280
|
+
> 🔐 = 需要先登录
|
|
281
|
+
|
|
282
|
+
### 调用原则(AI 必读)
|
|
283
|
+
|
|
284
|
+
1. **被动调用**:必须用户**明确**要求创建歌单时才调用本命令,禁止在用户仅说"推荐/搜歌/听歌"时主动创建
|
|
285
|
+
2. **主动询问**:当通过搜索、推荐(猜你喜欢/相似/文本)等方式给出一批歌曲后,**必须**询问用户"是否需要将当前这批歌曲创建为歌单",等用户确认后再执行 `create-playlist --songs "<mix_song_id 列表>"`
|
|
286
|
+
3. **示例化推荐**:询问时建议给出歌单名建议(如"跑步歌单"、"周杰伦精选"),让用户更容易确认
|
|
287
|
+
|
|
288
|
+
### 接口说明
|
|
289
|
+
|
|
290
|
+
创建一个新的自建歌单,并可选择在创建后往歌单里添加歌曲。
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
# 创建空歌单
|
|
294
|
+
kugou-cli music create-playlist "我的空歌单"
|
|
295
|
+
|
|
296
|
+
# 创建歌单并添加歌曲
|
|
297
|
+
kugou-cli music create-playlist "我的批量歌单" --songs "123,456,789"
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**参数**:
|
|
301
|
+
- `<name>`: 歌单名称(必填)
|
|
302
|
+
- `--songs`: 待添加的歌曲 mix_song_id 列表,逗号分隔(可选)。不传则只创建空歌单
|
|
303
|
+
|
|
304
|
+
**输出示例**:
|
|
305
|
+
```json
|
|
306
|
+
{
|
|
307
|
+
"errcode": 0,
|
|
308
|
+
"errmsg": "",
|
|
309
|
+
"data": {
|
|
310
|
+
"name": "我的批量歌单",
|
|
311
|
+
"song_list_url": "https://m.kugou.com/songlist/gcid_abc123def45"
|
|
312
|
+
},
|
|
313
|
+
"status": 1
|
|
314
|
+
}
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
**关键字段**:
|
|
318
|
+
- `name`: 歌单名称
|
|
319
|
+
- `song_list_url`: 歌单播放地址(H5 链接),可分享给用户打开
|
|
320
|
+
|
|
321
|
+
**异常说明**:
|
|
322
|
+
- 歌单创建成功但添加歌曲失败:返回 200 状态 + 错误信息,body 仍包含已创建歌单的 `name` 与 `song_list_url`
|
|
323
|
+
- 歌单创建失败:返回对应错误码(参数错误 20010 / 网络错误 90000 等)
|