migu-api-enhanced 2.3.0 → 2.6.0

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 CHANGED
@@ -11,13 +11,9 @@
11
11
  ![Deno](https://img.shields.io/badge/Deno-000000?logo=deno&logoColor=white)
12
12
  ![Vercel](https://img.shields.io/badge/Vercel-000000?logo=vercel&logoColor=white)
13
13
 
14
- ## 一键部署
15
- [![npm version](https://img.shields.io/npm/v/migu-api-enhanced.svg?logo=npm)](https://www.npmjs.com/package/migu-api-enhanced)
14
+ ## API 接口
16
15
 
17
- [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/Domdkw/migu-api-enhanced)
18
- [![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/Domdkw/migu-api-enhanced)
19
- [![使用 EdgeOne Pages 部署](https://cdnstatic.tencentcs.com/edgeone/pages/deploy.svg)](https://edgeone.ai/pages/new?repository-url=https://github.com/Domdkw/migu-api-enhanced)
20
- [![Deploy on Deno](https://deno.com/button)](https://console.deno.com/new?clone=https://github.com/Domdkw/migu-api-enhanced)
16
+ 更新于 [API 文档](https://domdkw.github.io/miguMusic-api-enhanced/)
21
17
 
22
18
  ## 特性
23
19
 
@@ -30,7 +26,6 @@
30
26
  ## 项目结构
31
27
 
32
28
  ```
33
- migu-api-enhanced/
34
29
  ├── src/
35
30
  │ ├── adapters/ # 平台适配器
36
31
  │ ├── modules/ # API 模块(NPM 包导出)
@@ -39,17 +34,8 @@ migu-api-enhanced/
39
34
  │ ├── utils/ # 工具函数
40
35
  │ ├── app.ts # 应用入口
41
36
  │ └── index.ts # NPM 包入口
42
- ├── functions/ # EdgeOne 边缘函数
43
- ├── tsconfig.json # TypeScript 基础配置
44
- ├── tsconfig.sdk.json # SDK 类型检查配置
45
- ├── tsup.config.ts # tsup 构建配置
46
- └── package.json
47
37
  ```
48
38
 
49
- ## API 接口
50
-
51
- [API 文档](https://domdkw.github.io/miguMusic-api-enhanced/api/search.md)
52
-
53
39
  ## 快速开始
54
40
 
55
41
  ### 安装依赖
@@ -96,51 +82,13 @@ pnpm run build:node # 编译
96
82
  pnpm start # 启动
97
83
  # 以后直接运行 pnpm start 即可,无需重新构建
98
84
 
99
- # Cloudflare Workers
100
- pnpm run deploy:cf
101
-
102
- # Vercel
103
- pnpm run deploy:vercel
104
-
105
- # Deno
106
- pnpm run deploy:deno
85
+ # Bun 生产环境
86
+ pnpm run start:bun
107
87
  ```
108
88
 
109
89
  ### 环境变量
110
90
 
111
- 服务端部署时可通过环境变量配置:
112
-
113
- | 变量名 | 说明 | 示例 |
114
- | ------ | ---- | ---- |
115
- | `ALLOWED_ORIGINS` | CORS 允许的源(逗号分隔) | `https://example.com,https://api.example.com` |
116
-
117
- ```bash
118
- # Node.js 启动时设置环境变量
119
- ALLOWED_ORIGINS=https://example.com pnpm start
120
- ```
121
-
122
- ## TypeScript 配置
123
-
124
- 本项目使用 TypeScript 5.x,配置分为两部分:
125
-
126
- | 配置文件 | 用途 |
127
- | -------- | ---- |
128
- | `tsconfig.json` | 基础配置,定义编译选项 |
129
- | `tsconfig.sdk.json` | SDK/NPM 包类型检查,排除应用层代码 |
130
-
131
- ### 多平台部署说明
132
-
133
- 各平台部署使用不同的构建工具:
134
-
135
- | 平台 | 部署方式 | 构建工具 |
136
- | ---- | -------- | -------- |
137
- | Node.js | `pnpm run deploy:node` | esbuild |
138
- | Node.js | `tsx` 直接运行 | 无需编译 |
139
- | Cloudflare Workers | `wrangler deploy` | wrangler 内置 |
140
- | Vercel | `vercel --prod` | Vercel 内置 |
141
- | Deno | `deno run` | 无需编译 |
142
- | EdgeOne | `esbuild` | esbuild |
143
- | NPM 包 | `tsup` | tsup |
91
+ 请参考 [deployment.md](/docs/deployment.md) 部署说明。
144
92
 
145
93
  ## 作为 NPM 包使用
146
94
 
@@ -161,9 +109,7 @@ npm install migu-api-enhanced
161
109
 
162
110
  ```ts
163
111
  import { getAlbumInfo, getUrlV2 } from 'migu-api-enhanced';
164
-
165
112
  const album = await getAlbumInfo('1123');
166
- const urlInfo = await getUrlV2('contentId', 'copyrightId');
167
113
  ```
168
114
  ### 方式二:`createClient` 工厂函数
169
115
  ```ts
@@ -174,23 +120,8 @@ const migu = createClient();
174
120
  // 搜索歌曲
175
121
  const data = await migu.searchSong('周杰伦', 1);
176
122
  console.log(data);
177
-
178
- // 获取专辑详情
179
- const album = await migu.getAlbumInfo('1123');
180
- console.log(album);
181
123
  ```
182
124
 
183
- ### 构建
184
-
185
- ```bash
186
- pnpm run build
187
- # 产物输出到 dist/:index.js(ESM)+ index.cjs(CJS)+ index.d.ts(类型声明)
188
- ```
189
-
190
- ## 许可证
191
-
192
- 本项目采用 [Apache License 2.0](LICENSE) 许可证。
193
-
194
125
  ## 免责声明
195
126
 
196
127
  本项目仅供学习和研究使用,不得用于商业用途。
@@ -205,4 +136,4 @@ pnpm run build
205
136
  - 侵犯他人权益
206
137
  - 其他违法行为
207
138
 
208
- 使用本项目即表示您已阅读并同意以上声明。
139
+ 使用本项目即表示您已阅读并同意以上声明。
package/dist/index.cjs CHANGED
@@ -34,13 +34,18 @@ __export(index_exports, {
34
34
  RSAKey: () => RSAKey,
35
35
  URLParams: () => URLParams,
36
36
  YDRZ: () => YDRZ,
37
+ addUserCollect: () => addUserCollect,
38
+ addUserMyList: () => addUserMyList,
37
39
  checkCanListen: () => checkCanListen,
38
40
  checkToken: () => checkToken,
39
41
  createClient: () => createClient,
42
+ dislikeSong: () => dislikeSong,
43
+ editUserMyList: () => editUserMyList,
40
44
  getAlbumInfo: () => getAlbumInfo,
41
45
  getAlbumSong: () => getAlbumSong,
42
46
  getComment: () => getComment,
43
47
  getDeviceId: () => getDeviceId,
48
+ getLyric: () => getLyric,
44
49
  getMVRecommend: () => getMVRecommend,
45
50
  getMvHls: () => getMvHls,
46
51
  getMvInfo: () => getMvInfo,
@@ -58,6 +63,10 @@ __export(index_exports, {
58
63
  getRankInfo: () => getRankInfo,
59
64
  getRecommendPlaylist: () => getRecommendPlaylist,
60
65
  getResourceInfo: () => getResourceInfo,
66
+ getSVideoInfo: () => getSVideoInfo,
67
+ getSVideoSearchSuggest: () => getSVideoSearchSuggest,
68
+ getSVideoUrl: () => getSVideoUrl,
69
+ getSVideoUserContent: () => getSVideoUserContent,
61
70
  getSceneRecommend: () => getSceneRecommend,
62
71
  getSearchDefault: () => getSearchDefault,
63
72
  getSearchHot: () => getSearchHot,
@@ -74,10 +83,13 @@ __export(index_exports, {
74
83
  getUrlV1: () => getUrlV1,
75
84
  getUrlV2: () => getUrlV2,
76
85
  getUserBadge: () => getUserBadge,
77
- getUserCollect: () => getUserCollect,
86
+ getUserCollectList: () => getUserCollectList,
78
87
  getUserHomePage: () => getUserHomePage,
79
88
  getUserMyList: () => getUserMyList,
80
89
  getVersion: () => getVersion,
90
+ getVrbtOpNum: () => getVrbtOpNum,
91
+ getVrbtUrl: () => getVrbtUrl,
92
+ likeSong: () => likeSong,
81
93
  loginNP: () => loginNP,
82
94
  loginOneClick: () => loginOneClick,
83
95
  loginPhone: () => loginPhone,
@@ -85,15 +97,18 @@ __export(index_exports, {
85
97
  modules: () => modules_exports,
86
98
  queryUserInfo: () => queryUserInfo,
87
99
  randomUA: () => randomUA,
100
+ removeUserCollect: () => removeUserCollect,
101
+ removeUserMyList: () => removeUserMyList,
88
102
  searchAlbum: () => searchAlbum,
89
103
  searchConcert: () => searchConcert,
90
104
  searchLrc: () => searchLrc,
105
+ searchMv: () => searchMv,
91
106
  searchRbt: () => searchRbt,
107
+ searchSVideo: () => searchSVideo,
92
108
  searchSinger: () => searchSinger,
93
109
  searchSong: () => searchSong,
94
110
  searchSuggest: () => searchSuggest,
95
111
  searchTicket: () => searchTicket,
96
- searchVideo: () => searchVideo,
97
112
  ua: () => ua
98
113
  });
99
114
  module.exports = __toCommonJS(index_exports);
@@ -102,11 +117,16 @@ module.exports = __toCommonJS(index_exports);
102
117
  var modules_exports = {};
103
118
  __export(modules_exports, {
104
119
  YDRZ: () => YDRZ,
120
+ addUserCollect: () => addUserCollect,
121
+ addUserMyList: () => addUserMyList,
105
122
  checkCanListen: () => checkCanListen,
106
123
  checkToken: () => checkToken,
124
+ dislikeSong: () => dislikeSong,
125
+ editUserMyList: () => editUserMyList,
107
126
  getAlbumInfo: () => getAlbumInfo,
108
127
  getAlbumSong: () => getAlbumSong,
109
128
  getComment: () => getComment,
129
+ getLyric: () => getLyric,
110
130
  getMVRecommend: () => getMVRecommend,
111
131
  getMvHls: () => getMvHls,
112
132
  getMvInfo: () => getMvInfo,
@@ -123,6 +143,10 @@ __export(modules_exports, {
123
143
  getRankInfo: () => getRankInfo,
124
144
  getRecommendPlaylist: () => getRecommendPlaylist,
125
145
  getResourceInfo: () => getResourceInfo,
146
+ getSVideoInfo: () => getSVideoInfo,
147
+ getSVideoSearchSuggest: () => getSVideoSearchSuggest,
148
+ getSVideoUrl: () => getSVideoUrl,
149
+ getSVideoUserContent: () => getSVideoUserContent,
126
150
  getSceneRecommend: () => getSceneRecommend,
127
151
  getSearchDefault: () => getSearchDefault,
128
152
  getSearchHot: () => getSearchHot,
@@ -139,24 +163,30 @@ __export(modules_exports, {
139
163
  getUrlV1: () => getUrlV1,
140
164
  getUrlV2: () => getUrlV2,
141
165
  getUserBadge: () => getUserBadge,
142
- getUserCollect: () => getUserCollect,
166
+ getUserCollectList: () => getUserCollectList,
143
167
  getUserHomePage: () => getUserHomePage,
144
168
  getUserMyList: () => getUserMyList,
145
169
  getVersion: () => getVersion,
170
+ getVrbtOpNum: () => getVrbtOpNum,
171
+ getVrbtUrl: () => getVrbtUrl,
172
+ likeSong: () => likeSong,
146
173
  loginNP: () => loginNP,
147
174
  loginOneClick: () => loginOneClick,
148
175
  loginPhone: () => loginPhone,
149
176
  loginSim: () => loginSim,
150
177
  queryUserInfo: () => queryUserInfo,
178
+ removeUserCollect: () => removeUserCollect,
179
+ removeUserMyList: () => removeUserMyList,
151
180
  searchAlbum: () => searchAlbum,
152
181
  searchConcert: () => searchConcert,
153
182
  searchLrc: () => searchLrc,
183
+ searchMv: () => searchMv,
154
184
  searchRbt: () => searchRbt,
185
+ searchSVideo: () => searchSVideo,
155
186
  searchSinger: () => searchSinger,
156
187
  searchSong: () => searchSong,
157
188
  searchSuggest: () => searchSuggest,
158
- searchTicket: () => searchTicket,
159
- searchVideo: () => searchVideo
189
+ searchTicket: () => searchTicket
160
190
  });
161
191
 
162
192
  // src/utils/h5fetch.ts
@@ -221,8 +251,8 @@ var getSearchDefault = async () => {
221
251
  return await h5fetch(`http://app.c.nf.migu.cn/column/search/default-text/v3.0?resourceVersion=2`);
222
252
  };
223
253
 
224
- // src/modules/search_video.ts
225
- var searchVideo = async (text, page = 1, typeOrder = 0) => {
254
+ // src/modules/search_mv.ts
255
+ var searchMv = async (text, page = 1, typeOrder = 0) => {
226
256
  return await h5fetch(`http://app.c.nf.migu.cn/bmw/search/video/v1.0?pageNo=${page}&text=${text}&typeOrder=${typeOrder}`);
227
257
  };
228
258
 
@@ -360,8 +390,10 @@ var getComment = async (resourceId, resourceType = 2, size = 20, hotCommentStart
360
390
  };
361
391
 
362
392
  // src/modules/resourceinfo.ts
363
- var getResourceInfo = async (resourceId, resourceType = 2) => {
364
- return await h5fetch(`https://app.u.nf.migu.cn//MIGUM2.0/v1.0/content/resourceinfo.do?resourceId=${resourceId}&resourceType=${resourceType}`);
393
+ var getResourceInfo = async (resourceIds = "", copyrightIds = "", resourceType = 2) => {
394
+ resourceIds = resourceIds.replace(/,/g, "|");
395
+ copyrightIds = copyrightIds.replace(/,/g, "|");
396
+ return await h5fetch(`https://app.u.nf.migu.cn/MIGUM2.0/v1.0/content/resourceinfo.do?resourceId=${resourceIds}&copyrightId=${copyrightIds}&resourceType=${resourceType}`);
365
397
  };
366
398
 
367
399
  // src/modules/can-listen.ts
@@ -397,34 +429,19 @@ var getUrlV1 = async (contentId, copyrightId, resourceType = "2") => {
397
429
 
398
430
  // src/modules/url_v2.ts
399
431
  var import_axios2 = __toESM(require("axios"), 1);
400
- var getUrlV2 = async (contentId, copyrightId, toneFlag = "PQ", resourceType = "2", pacmtoken = "") => {
432
+ var getUrlV2 = async (contentId, copyrightId, toneFlag = "PQ", pacmtoken = "") => {
401
433
  const deviceId = getDeviceId();
402
- const timestamp = Date.now();
403
434
  const headers = {
404
- "Accept": "application/json, text/plain, */*",
405
- "test": "00",
406
435
  "channel": "014X031",
407
436
  "subchannel": "014X031",
408
- "logId": "cfrom=&appId=h5",
409
- "uid": "",
410
437
  "pacmtoken": pacmtoken,
411
- "appId": "h5",
412
- "platform": "H5",
413
438
  "deviceId": deviceId,
414
- "ua": "Android_migu",
415
- "version": "6.8.8",
416
- "activityId": "MUSIC-WWW",
417
- "birth": "h5page",
418
- "signature": "1",
419
- "timestamp": timestamp.toString(),
420
- "Content-Type": "application/json;charset=UTF-8",
421
439
  "referer": "https://music.migu.cn/",
422
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36 Edg/148.0.0.0",
423
440
  "location-data": "30.6698676660,104.1229614820",
424
441
  "location-info": ""
425
442
  };
426
443
  const res = await import_axios2.default.get(
427
- `https://app.c.nf.migu.cn/strategy/pc/listen/v2.0?contentId=${contentId}&copyrightId=${copyrightId}&scene=&netType=01&resourceType=${resourceType}&toneFlag=${toneFlag}`,
444
+ `https://app.c.nf.migu.cn/strategy/pc/listen/v2.0?contentId=${contentId}&copyrightId=${copyrightId}&scene=&netType=01&resourceType=2&toneFlag=${toneFlag}`,
428
445
  {
429
446
  headers,
430
447
  responseType: "arraybuffer"
@@ -465,7 +482,7 @@ function decryptData(buf) {
465
482
 
466
483
  // src/modules/url_h5v2.4.ts
467
484
  var import_axios3 = __toESM(require("axios"), 1);
468
- var getUrlH5V24 = async (contentId, copyrightId, toneFlag = "PQ", resourceType = "2") => {
485
+ var getUrlH5V24 = async (contentId, copyrightId, toneFlag = "PQ") => {
469
486
  const headers = {
470
487
  "birth": "h5page",
471
488
  "channel": "014X031",
@@ -474,7 +491,7 @@ var getUrlH5V24 = async (contentId, copyrightId, toneFlag = "PQ", resourceType =
474
491
  "location-info": ""
475
492
  };
476
493
  const res = await import_axios3.default.get(
477
- `https://c.musicapp.migu.cn/strategy/listen-url/h5/v2.4?contentId=${contentId}&copyrightId=${copyrightId}&resourceType=${resourceType}&netType=01&toneFlag=${toneFlag}&scene=&lowerQualityContentId=${contentId}`,
494
+ `https://c.musicapp.migu.cn/strategy/listen-url/h5/v2.4?contentId=${contentId}&copyrightId=${copyrightId}&resourceType=2&netType=01&toneFlag=${toneFlag}&scene=&lowerQualityContentId=${contentId}`,
478
495
  {
479
496
  headers,
480
497
  responseType: "arraybuffer"
@@ -880,9 +897,9 @@ var loginSim = {
880
897
  }
881
898
  };
882
899
 
883
- // src/modules/user_collect.ts
900
+ // src/modules/user_collect_list.ts
884
901
  var import_axios11 = __toESM(require("axios"), 1);
885
- var getUserCollect = async (pacmtoken, page = 1, size = 20) => {
902
+ var getUserCollectList = async (pacmtoken, page = 1, size = 20) => {
886
903
  const res = await import_axios11.default.get(`https://app.c.nf.migu.cn/user/h5/user/collection/v1.0?pageNo=${page}&type=1&OPType=03&pageSize=${size}&resourceType=2021`, {
887
904
  headers: {
888
905
  "Cookie": `pacmtoken=${pacmtoken}`
@@ -1236,6 +1253,217 @@ var getRadioRecommendAll = async (pacmtoken = "") => {
1236
1253
  return { data: res.data, newPacmToken };
1237
1254
  };
1238
1255
 
1256
+ // src/modules/svideo_info.ts
1257
+ var getSVideoInfo = async (contentIds) => {
1258
+ const contentIdList = contentIds.split(",");
1259
+ contentIdList.map((item) => {
1260
+ return "6000," + item;
1261
+ }).join("|");
1262
+ return await h5fetch(`https://app.c.nf.migu.cn/resource/video-info/by-id/v1.0?requestParams=${contentIdList}`);
1263
+ };
1264
+
1265
+ // src/modules/svideo_search.ts
1266
+ var searchSVideo = async (text, page = 1) => {
1267
+ return await h5fetch(
1268
+ `https://app.c.nf.migu.cn/bmw/hot-search/search/videos/v1.0?pageIndex=${page}&text=${text}`,
1269
+ {
1270
+ headers: {
1271
+ "deviceid": getDeviceId()
1272
+ }
1273
+ }
1274
+ );
1275
+ };
1276
+
1277
+ // src/modules/svideo_searchSuggest.ts
1278
+ var getSVideoSearchSuggest = async (text) => {
1279
+ return await h5fetch(`https://app.c.nf.migu.cn/resource-dataloader/search-suggest/search/v1.0?text=${text}`);
1280
+ };
1281
+
1282
+ // src/modules/svideo_url.ts
1283
+ var getSVideoUrl = async (contentIds, formatType = "HQ") => {
1284
+ contentIds = contentIds.replace(/,/g, "|");
1285
+ return await h5fetch(`https://app.c.nf.migu.cn/strategy/short-video/play/v1.0?contentIds=${contentIds}&formatType=${formatType}`);
1286
+ };
1287
+
1288
+ // src/modules/svideo_userContent.ts
1289
+ var getSVideoUserContent = async (videoUserId, nextPageId = "") => {
1290
+ return await h5fetch(`https://app.c.nf.migu.cn/user/i/user-content-list/v1.0?nextPageId=${nextPageId}&videoUserId=${videoUserId}`);
1291
+ };
1292
+
1293
+ // src/modules/vrbt_opNum.ts
1294
+ var getVrbtOpNum = async (contentIds) => {
1295
+ return await h5fetch(`https://app.c.nf.migu.cn/resource/vrbt/opnum/v1.0?resourceType=M&contentIds=${contentIds}`);
1296
+ };
1297
+
1298
+ // src/modules/vrbt_url.ts
1299
+ var getVrbtUrl = async (contentIds) => {
1300
+ contentIds = contentIds.replace(/,/g, "|");
1301
+ return await h5fetch(
1302
+ `https://app.c.nf.migu.cn/strategy/vrbt/play/v1.0?contentIds=${contentIds}`,
1303
+ {
1304
+ headers: {
1305
+ "channel": "014X031"
1306
+ }
1307
+ }
1308
+ );
1309
+ };
1310
+
1311
+ // src/modules/lyric.ts
1312
+ var import_axios16 = __toESM(require("axios"), 1);
1313
+ var getLyric = async (contentId) => {
1314
+ if (contentId === "") return { error: "contentId is empty!", success: false };
1315
+ const res = await import_axios16.default.get(`https://app.c.nf.migu.cn/resource/song/by-contentids/v2.0?contentId=${contentId}`);
1316
+ const code = res.data.code.toString() || "";
1317
+ const data = res.data.data || [];
1318
+ if (code !== "000000") return {
1319
+ success: false,
1320
+ status: res.status,
1321
+ error: res.data.info || res.data
1322
+ };
1323
+ if (data.length === 0) return { error: "data.length = 0 !", success: false, data };
1324
+ const lrcUrl = data[0].lrcUrl || "";
1325
+ if (lrcUrl === "") return { error: "lrcUrl is empty!", success: false, data };
1326
+ const lrcRes = await import_axios16.default.get(lrcUrl);
1327
+ if (lrcRes.status !== 200) return {
1328
+ success: false,
1329
+ status: lrcRes.status,
1330
+ error: "lrcRes.status !== 200 !",
1331
+ data
1332
+ };
1333
+ const lrc = lrcRes.data || "";
1334
+ return {
1335
+ success: true,
1336
+ lrc,
1337
+ lrcUrl
1338
+ };
1339
+ };
1340
+
1341
+ // src/modules/user_collect_add.ts
1342
+ var import_axios17 = __toESM(require("axios"), 1);
1343
+ var addUserCollect = async (pacmtoken, playlistId, title) => {
1344
+ title = encodeURIComponent(title);
1345
+ const res = await import_axios17.default.get(
1346
+ `https://app.c.nf.migu.cn/pc/v1.0/user/add_collection.do?outOPType=03&outResourceName=${title}&outResourceType=2021&outResourceId=${playlistId}`,
1347
+ {
1348
+ headers: {
1349
+ "cookie": `pacmtoken=${pacmtoken}`
1350
+ }
1351
+ }
1352
+ );
1353
+ const newPacmToken = getSetCookieValueFromObject(res.headers, "pacmtoken");
1354
+ return { data: res.data, newPacmToken };
1355
+ };
1356
+
1357
+ // src/modules/user_collect_remove.ts
1358
+ var import_axios18 = __toESM(require("axios"), 1);
1359
+ var removeUserCollect = async (pacmtoken, playlistId) => {
1360
+ const res = await import_axios18.default.get(
1361
+ `https://app.c.nf.migu.cn/pc/v1.0/user/del_collection.do?oPType=03&resourceType=2021&resourceId=${playlistId}`,
1362
+ {
1363
+ headers: {
1364
+ "cookie": `pacmtoken=${pacmtoken}`
1365
+ }
1366
+ }
1367
+ );
1368
+ const newPacmToken = getSetCookieValueFromObject(res.headers, "pacmtoken");
1369
+ return { data: res.data, newPacmToken };
1370
+ };
1371
+
1372
+ // src/modules/user_like.ts
1373
+ var import_axios19 = __toESM(require("axios"), 1);
1374
+ var likeSong = async (pacmtoken, contentIds) => {
1375
+ const contentIdsList = contentIds.split(",");
1376
+ const res = await import_axios19.default.post(
1377
+ `https://app.c.nf.migu.cn/pc/user/api/add-music-list-song/v1.0`,
1378
+ {
1379
+ contentIds: contentIdsList
1380
+ },
1381
+ {
1382
+ headers: {
1383
+ "Cookie": `pacmtoken=${pacmtoken}`
1384
+ }
1385
+ }
1386
+ );
1387
+ const newPacmToken = getSetCookieValueFromObject(res.headers, "pacmtoken");
1388
+ return { data: res.data, newPacmToken };
1389
+ };
1390
+
1391
+ // src/modules/user_dislike.ts
1392
+ var import_axios20 = __toESM(require("axios"), 1);
1393
+ var dislikeSong = async (pacmtoken, contentId) => {
1394
+ const body = {
1395
+ "channel": "23",
1396
+ "contentId": contentId,
1397
+ "songflag": "2"
1398
+ };
1399
+ const res = await import_axios20.default.post(
1400
+ `https://app.c.nf.migu.cn/pc/user/h5-import-musiclist/v1.0`,
1401
+ body,
1402
+ {
1403
+ headers: {
1404
+ "Cookie": `pacmtoken=${pacmtoken}`
1405
+ }
1406
+ }
1407
+ );
1408
+ const newPacmToken = getSetCookieValueFromObject(res.headers, "pacmtoken");
1409
+ return { data: res.data, newPacmToken };
1410
+ };
1411
+
1412
+ // src/modules/user_myList_edit.ts
1413
+ var import_axios21 = __toESM(require("axios"), 1);
1414
+ var editUserMyList = async (pacmtoken, title, playlistId) => {
1415
+ const body = {
1416
+ "title": title,
1417
+ "channel": "23",
1418
+ "id": playlistId,
1419
+ "songflag": "0"
1420
+ };
1421
+ const res = await import_axios21.default.post(
1422
+ `https://app.c.nf.migu.cn/pc/user/h5-import-musiclist/v1.0`,
1423
+ body,
1424
+ {
1425
+ headers: {
1426
+ "Cookie": `pacmtoken=${pacmtoken}`
1427
+ }
1428
+ }
1429
+ );
1430
+ const newPacmToken = getSetCookieValueFromObject(res.headers, "pacmtoken");
1431
+ return { data: res.data, newPacmToken };
1432
+ };
1433
+
1434
+ // src/modules/user_myList_add.ts
1435
+ var import_axios22 = __toESM(require("axios"), 1);
1436
+ var addUserMyList = async (pacmtoken, title) => {
1437
+ const body = {
1438
+ "title": title,
1439
+ "channel": "23",
1440
+ "type": "self_build"
1441
+ };
1442
+ const res = await import_axios22.default.post(
1443
+ `https://app.c.nf.migu.cn/pc/open/api/music-list/add/v2.0`,
1444
+ body,
1445
+ {
1446
+ headers: {
1447
+ "Cookie": `pacmtoken=${pacmtoken}`
1448
+ }
1449
+ }
1450
+ );
1451
+ const newPacmToken = getSetCookieValueFromObject(res.headers, "pacmtoken");
1452
+ return { data: res.data, newPacmToken };
1453
+ };
1454
+
1455
+ // src/modules/user_myList_remove.ts
1456
+ var import_axios23 = __toESM(require("axios"), 1);
1457
+ var removeUserMyList = async (pacmtoken, playlistId) => {
1458
+ const res = await import_axios23.default.get(`https://app.c.nf.migu.cn/pc/v1.0/user/deleteMusicList.do?channel=23&id=${playlistId}`, {
1459
+ headers: {
1460
+ "Cookie": `pacmtoken=${pacmtoken}`
1461
+ }
1462
+ });
1463
+ const newPacmToken = getSetCookieValueFromObject(res.headers, "pacmtoken");
1464
+ return { data: res.data, newPacmToken };
1465
+ };
1466
+
1239
1467
  // src/utils/index.ts
1240
1468
  var utils_exports = {};
1241
1469
  __export(utils_exports, {
@@ -1270,13 +1498,18 @@ function createClient() {
1270
1498
  RSAKey,
1271
1499
  URLParams,
1272
1500
  YDRZ,
1501
+ addUserCollect,
1502
+ addUserMyList,
1273
1503
  checkCanListen,
1274
1504
  checkToken,
1275
1505
  createClient,
1506
+ dislikeSong,
1507
+ editUserMyList,
1276
1508
  getAlbumInfo,
1277
1509
  getAlbumSong,
1278
1510
  getComment,
1279
1511
  getDeviceId,
1512
+ getLyric,
1280
1513
  getMVRecommend,
1281
1514
  getMvHls,
1282
1515
  getMvInfo,
@@ -1294,6 +1527,10 @@ function createClient() {
1294
1527
  getRankInfo,
1295
1528
  getRecommendPlaylist,
1296
1529
  getResourceInfo,
1530
+ getSVideoInfo,
1531
+ getSVideoSearchSuggest,
1532
+ getSVideoUrl,
1533
+ getSVideoUserContent,
1297
1534
  getSceneRecommend,
1298
1535
  getSearchDefault,
1299
1536
  getSearchHot,
@@ -1310,10 +1547,13 @@ function createClient() {
1310
1547
  getUrlV1,
1311
1548
  getUrlV2,
1312
1549
  getUserBadge,
1313
- getUserCollect,
1550
+ getUserCollectList,
1314
1551
  getUserHomePage,
1315
1552
  getUserMyList,
1316
1553
  getVersion,
1554
+ getVrbtOpNum,
1555
+ getVrbtUrl,
1556
+ likeSong,
1317
1557
  loginNP,
1318
1558
  loginOneClick,
1319
1559
  loginPhone,
@@ -1321,15 +1561,18 @@ function createClient() {
1321
1561
  modules,
1322
1562
  queryUserInfo,
1323
1563
  randomUA,
1564
+ removeUserCollect,
1565
+ removeUserMyList,
1324
1566
  searchAlbum,
1325
1567
  searchConcert,
1326
1568
  searchLrc,
1569
+ searchMv,
1327
1570
  searchRbt,
1571
+ searchSVideo,
1328
1572
  searchSinger,
1329
1573
  searchSong,
1330
1574
  searchSuggest,
1331
1575
  searchTicket,
1332
- searchVideo,
1333
1576
  ua
1334
1577
  });
1335
1578
  //# sourceMappingURL=index.cjs.map