migu-api-enhanced 2.22.0 → 2.25.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
@@ -1,24 +1,24 @@
1
1
  # migu-api-enhanced
2
2
 
3
- ![migu-api-enhanced](https://img.shields.io/npm/v/migu-api-enhanced?style=for-the-badge&logo=npm) ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/Domdkw/miguMusic-api-enhanced/bun-release.yml?style=for-the-badge&logo=github&link=https%3A%2F%2Fgithub.com%2FDomdkw%2FmiguMusic-api-enhanced%2Factions%2Fworkflows%2Fbun-release.yml)
4
- 基于 Hono 框架的咪咕音乐 API 服务,支持多平台部署。受[https://github.com/jsososo/MiguMusicApi](https://github.com/jsososo/MiguMusicApi)项目启发。
3
+ ![migu-api-enhanced](https://img.shields.io/npm/v/migu-api-enhanced?style=for-the-badge&logo=npm&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fmigu-api-enhanced) ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/Domdkw/miguMusic-api-enhanced/bun-release.yml?style=for-the-badge&logo=github&link=https%3A%2F%2Fgithub.com%2FDomdkw%2FmiguMusic-api-enhanced%2Factions%2Fworkflows%2Fbun-release.yml)
4
+ 基于 Hono 框架的咪咕音乐 API 服务,支持多平台部署。受[jsososo/MiguMusicApi](https://github.com/jsososo/MiguMusicApi)和[NeteaseCloudMusicApiEnhanced](https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced)项目启发。
5
5
 
6
6
  ## API 接口
7
7
 
8
- - **搜索** - 歌曲、歌手、专辑、MV、歌词、短视频、彩铃、演唱会、票务、热门搜索、搜索建议
8
+ - **搜索** - 歌曲、歌单、歌手、专辑、MV、歌词、短视频、彩铃、演唱会、票务、热门搜索、搜索建议
9
9
  - **专辑** - 详情、歌曲列表
10
- - **歌单** - 信息、列表歌曲、歌单广场、电台歌曲列表、匹配外部歌单、VIP热歌
10
+ - **歌单** - 信息、列表歌曲、歌单广场(标签,分类)、电台歌曲列表、匹配外部歌单、VIP热歌
11
11
  - **歌手** - 歌手信息、歌手歌曲、歌手专辑、相似歌手、情书、歌手MV页
12
- - **播放地址** - 多版本播放地址接口(301/m2/v1/v2/v2.4)、数据库URL、咪咕云盘、下载v1
13
- - **推荐** - 歌曲、歌单、相似歌曲、主页电台、所有电台
12
+ - **播放地址** - 多版本播放地址接口(301/m2/v1/v2/v2.4)、数据库URL、咪咕云盘、云盘下载、下载v1
13
+ - **推荐** - 歌曲、歌单、相似歌曲、主页电台、所有电台、畅听模式
14
14
  - **栏目** - 排行榜(Tab/内容)、新歌速递、新碟上架、栏目内容、主页Tab、界面信息
15
15
  - **MV** - MV详情、MV推荐、MV播放地址 (mp4 & m3u8)、歌曲MV
16
16
  - **演唱会** - 简略信息、详情、推荐、播放地址 (m3u8)、评论、推荐MV
17
17
  - **视频** - 短视频:播放地址、搜索建议、推荐、用户信息、用户作品。 视频彩铃:播放地址、统计信息
18
18
  - **资源** - 获取歌词、资源信息、播放次数、检查可听性、lrc歌词
19
- - **用户** - 个人信息、我的主页、徽章、我喜欢、收藏、自建歌单管理、今日推荐、关注操作、用户简介、用户主页-歌曲、听歌排行、咪咕云盘、心动模式、表态、消息互动通知、评论(删除)
19
+ - **用户** - 个人信息、手机号信息、我的主页、徽章、我喜欢、收藏、自建歌单管理、今日推荐、关注操作、用户简介、用户主页-歌曲、听歌排行、咪咕云盘、心动模式、表态、消息互动通知、评论(删除)、查询(手机号,已购歌曲)
20
20
  - **登录认证** - 手机号登录、短信登录、(一键登录,帐密登录)
21
- - **活动** - 呢喃(歌曲列表、日期歌曲、签到、签到记录)、AI豆(签到、数量、签到状态、兑换)
21
+ - **活动** - 官方活动、呢喃(歌曲列表、日期歌曲、签到、签到记录)、AI豆(签到、数量、签到状态、兑换)
22
22
 
23
23
  更新于 [API 文档](https://domdkw.github.io/miguMusic-api-enhanced/)
24
24
 
package/dist/index.cjs CHANGED
@@ -47,10 +47,12 @@ __export(index_exports, {
47
47
  dislikeSong: () => dislikeSong,
48
48
  editUserMyList: () => editUserMyList,
49
49
  emojiAction: () => emojiAction,
50
+ getActivities: () => getActivities,
50
51
  getAiBeanCount: () => getAiBeanCount,
51
52
  getAiBeanSignStatus: () => getAiBeanSignStatus,
52
53
  getAlbumInfo: () => getAlbumInfo,
53
54
  getAlbumSong: () => getAlbumSong,
55
+ getCloudDLUrl: () => getCloudDLUrl,
54
56
  getCloudUploadUrl: () => getCloudUploadUrl,
55
57
  getCloudUrl: () => getCloudUrl,
56
58
  getColumnInfo: () => getColumnInfo,
@@ -67,6 +69,8 @@ __export(index_exports, {
67
69
  getFollowingList: () => getFollowingList,
68
70
  getFollowingVra: () => getFollowingVra,
69
71
  getInteractionMsg: () => getInteractionMsg,
72
+ getListenFreelySongs: () => getListenFreelySongs,
73
+ getListenFreelyTab: () => getListenFreelyTab,
70
74
  getListenRank: () => getListenRank,
71
75
  getLyric: () => getLyric,
72
76
  getMVRecommend: () => getMVRecommend,
@@ -85,7 +89,6 @@ __export(index_exports, {
85
89
  getPageTab: () => getPageTab,
86
90
  getPlaylistInfo: () => getPlaylistInfo,
87
91
  getPlaylistSong: () => getPlaylistSong,
88
- getPlaylistSquarePage: () => getPlaylistSquarePage,
89
92
  getPublicKey: () => getPublicKey,
90
93
  getQuality: () => getQuality,
91
94
  getRadioRecommend: () => getRadioRecommend,
@@ -115,6 +118,11 @@ __export(index_exports, {
115
118
  getSingerMv: () => getSingerMv,
116
119
  getSingerSimilar: () => getSingerSimilar,
117
120
  getSingerSong: () => getSingerSong,
121
+ getSongInfo: () => getSongInfo,
122
+ getSquareListByTag: () => getSquareListByTag,
123
+ getSquarePage: () => getSquarePage,
124
+ getSquareRecommend: () => getSquareRecommend,
125
+ getSquareTag: () => getSquareTag,
118
126
  getThumbsMsg: () => getThumbsMsg,
119
127
  getTicketInfo: () => getTicketInfo,
120
128
  getTodayRecommend: () => getTodayRecommend,
@@ -129,6 +137,8 @@ __export(index_exports, {
129
137
  getUserHeartthrob: () => getUserHeartthrob,
130
138
  getUserHomePage: () => getUserHomePage,
131
139
  getUserMyList: () => getUserMyList,
140
+ getUserOrdered: () => getUserOrdered,
141
+ getUserPhoneInfo: () => getUserPhoneInfo,
132
142
  getUserSongPage: () => getUserSongPage,
133
143
  getVersion: () => getVersion,
134
144
  getVipPlaylist: () => getVipPlaylist,
@@ -155,6 +165,7 @@ __export(index_exports, {
155
165
  searchConcert: () => searchConcert,
156
166
  searchLrc: () => searchLrc,
157
167
  searchMv: () => searchMv,
168
+ searchPlaylist: () => searchPlaylist,
158
169
  searchRbt: () => searchRbt,
159
170
  searchSVideo: () => searchSVideo,
160
171
  searchSinger: () => searchSinger,
@@ -185,10 +196,12 @@ __export(modules_exports, {
185
196
  dislikeSong: () => dislikeSong,
186
197
  editUserMyList: () => editUserMyList,
187
198
  emojiAction: () => emojiAction,
199
+ getActivities: () => getActivities,
188
200
  getAiBeanCount: () => getAiBeanCount,
189
201
  getAiBeanSignStatus: () => getAiBeanSignStatus,
190
202
  getAlbumInfo: () => getAlbumInfo,
191
203
  getAlbumSong: () => getAlbumSong,
204
+ getCloudDLUrl: () => getCloudDLUrl,
192
205
  getCloudUploadUrl: () => getCloudUploadUrl,
193
206
  getCloudUrl: () => getCloudUrl,
194
207
  getColumnInfo: () => getColumnInfo,
@@ -204,6 +217,8 @@ __export(modules_exports, {
204
217
  getFollowingList: () => getFollowingList,
205
218
  getFollowingVra: () => getFollowingVra,
206
219
  getInteractionMsg: () => getInteractionMsg,
220
+ getListenFreelySongs: () => getListenFreelySongs,
221
+ getListenFreelyTab: () => getListenFreelyTab,
207
222
  getListenRank: () => getListenRank,
208
223
  getLyric: () => getLyric,
209
224
  getMVRecommend: () => getMVRecommend,
@@ -222,7 +237,6 @@ __export(modules_exports, {
222
237
  getPageTab: () => getPageTab,
223
238
  getPlaylistInfo: () => getPlaylistInfo,
224
239
  getPlaylistSong: () => getPlaylistSong,
225
- getPlaylistSquarePage: () => getPlaylistSquarePage,
226
240
  getRadioRecommend: () => getRadioRecommend,
227
241
  getRadioRecommendAll: () => getRadioRecommendAll,
228
242
  getRadioSong: () => getRadioSong,
@@ -249,6 +263,11 @@ __export(modules_exports, {
249
263
  getSingerMv: () => getSingerMv,
250
264
  getSingerSimilar: () => getSingerSimilar,
251
265
  getSingerSong: () => getSingerSong,
266
+ getSongInfo: () => getSongInfo,
267
+ getSquareListByTag: () => getSquareListByTag,
268
+ getSquarePage: () => getSquarePage,
269
+ getSquareRecommend: () => getSquareRecommend,
270
+ getSquareTag: () => getSquareTag,
252
271
  getThumbsMsg: () => getThumbsMsg,
253
272
  getTicketInfo: () => getTicketInfo,
254
273
  getTodayRecommend: () => getTodayRecommend,
@@ -263,6 +282,8 @@ __export(modules_exports, {
263
282
  getUserHeartthrob: () => getUserHeartthrob,
264
283
  getUserHomePage: () => getUserHomePage,
265
284
  getUserMyList: () => getUserMyList,
285
+ getUserOrdered: () => getUserOrdered,
286
+ getUserPhoneInfo: () => getUserPhoneInfo,
266
287
  getUserSongPage: () => getUserSongPage,
267
288
  getVersion: () => getVersion,
268
289
  getVipPlaylist: () => getVipPlaylist,
@@ -286,6 +307,7 @@ __export(modules_exports, {
286
307
  searchConcert: () => searchConcert,
287
308
  searchLrc: () => searchLrc,
288
309
  searchMv: () => searchMv,
310
+ searchPlaylist: () => searchPlaylist,
289
311
  searchRbt: () => searchRbt,
290
312
  searchSVideo: () => searchSVideo,
291
313
  searchSinger: () => searchSinger,
@@ -393,6 +415,11 @@ var searchSong = async (text, page = 1) => {
393
415
  return await h5fetch(`http://app.c.nf.migu.cn/bmw/search/song/v1.0?pageNo=${page}&text=${text}`);
394
416
  };
395
417
 
418
+ // src/modules/search_playlist.ts
419
+ var searchPlaylist = async (text, page = 1, typeOrder = 0) => {
420
+ return await h5fetch(`https://app.c.nf.migu.cn/bmw/search/music-list/v1.0?pageNo=${page}&text=${text}&typeOrder=${typeOrder}`);
421
+ };
422
+
396
423
  // src/modules/search_album.ts
397
424
  var searchAlbum = async (text, page = 1, typeOrder = 0) => {
398
425
  return await h5fetch(`http://app.c.nf.migu.cn/bmw/search/album/v1.0?pageNo=${page}&text=${text}&typeOrder=${typeOrder}`);
@@ -1416,7 +1443,7 @@ var getMVRecommend = async (mvContentId, page = 1) => {
1416
1443
  };
1417
1444
 
1418
1445
  // src/modules/playlist_square_page.ts
1419
- var getPlaylistSquarePage = async () => {
1446
+ var getSquarePage = async () => {
1420
1447
  return await h5fetch(`https://app.c.nf.migu.cn/pc/bmw/page-data/playlist-square-recommend/v1.0?templateVersion=2`);
1421
1448
  };
1422
1449
 
@@ -2320,6 +2347,108 @@ var redeemAiBean = async (pacmtoken) => {
2320
2347
  return { data, newPacmToken: cookies.pacmtoken || "" };
2321
2348
  };
2322
2349
 
2350
+ // src/modules/cloud_dl.ts
2351
+ var getCloudDLUrl = async (pacmtoken, contentId, toneFlag = "PQ") => {
2352
+ const { data, cookies } = await ckfetch("https://app.c.nf.migu.cn/MIGUM3.0/strategy/cloud/download-url/v1.0", {
2353
+ cookie: { pacmtoken },
2354
+ headers: { "channel": "0146931", "version": "7.41.13" },
2355
+ params: {
2356
+ contentId,
2357
+ "formatType": toneFlag,
2358
+ "type": "0"
2359
+ }
2360
+ });
2361
+ return { data, newPacmToken: cookies.pacmtoken || "" };
2362
+ };
2363
+
2364
+ // src/modules/user_phoneInfo.ts
2365
+ var getUserPhoneInfo = async (pacmtoken) => {
2366
+ const { data, cookies } = await ckfetch("https://app.c.nf.migu.cn/MIGUM2.0/v1.0/tone/isrbtuser.do", {
2367
+ cookie: { pacmtoken },
2368
+ headers: {
2369
+ "channel": "0146921",
2370
+ "version": "8.8.0"
2371
+ }
2372
+ });
2373
+ return { data, newPacmToken: cookies.pacmtoken || "" };
2374
+ };
2375
+
2376
+ // src/modules/recommend_listenFreely_tab.ts
2377
+ var getListenFreelyTab = async (pacmtoken = "") => {
2378
+ const { data, cookies } = await ckfetch(`https://app.c.nf.migu.cn/bmw/page/view/listen-freely/v1.0`, {
2379
+ cookie: pacmtoken ? { pacmtoken } : void 0
2380
+ });
2381
+ return { data, newPacmToken: cookies.pacmtoken || void 0 };
2382
+ };
2383
+
2384
+ // src/modules/recommend_listenFreely.ts
2385
+ var getListenFreelySongs = async (pacmtoken, modelId = "701000") => {
2386
+ if (!pacmtoken) return { data: { success: false, code: "290001", info: "\u8BF7\u5148\u767B\u5F55" }, newPacmToken: void 0 };
2387
+ const { data, cookies } = await ckfetch(`http://app.c.nf.migu.cn/resource-dataloader/recommend/listen-freely/v2.0?modelId=${modelId}`, {
2388
+ cookie: { pacmtoken }
2389
+ });
2390
+ return { data, newPacmToken: cookies.pacmtoken || "" };
2391
+ };
2392
+
2393
+ // src/modules/playlist_square_listByTag.ts
2394
+ var getSquareListByTag = async (tagId, page) => {
2395
+ const res = await h5fetch(`http://app.c.nf.migu.cn/MIGUM3.0/v1.0/template/musiclistplaza-listbytag?templateVersion=1&tagId=${tagId}&pageNumber=${page}`);
2396
+ res.data.contentItemList = res?.data?.contentItemList?.itemList?.reduce((acc, item) => {
2397
+ if (!item.actionUrl || !item.actionUrl.includes("song-list-info")) {
2398
+ return acc;
2399
+ }
2400
+ item.playlistId = item.actionUrl.split("id=")[1].split("&")[0] || "";
2401
+ acc.push(item);
2402
+ return acc;
2403
+ }, []) || [];
2404
+ res.data.hasNext = res.data.contentItemList.length < 30 ? false : res?.data?.nextPageUrl !== void 0 && res?.data?.nextPageUrl !== "";
2405
+ return res;
2406
+ };
2407
+
2408
+ // src/modules/playlist_square_recommend.ts
2409
+ var getSquareRecommend = async () => {
2410
+ return await h5fetch(`https://app.c.nf.migu.cn/pc/bmw/playlist-square/recommend-playlist/v1.0?templateVersion=2`);
2411
+ };
2412
+
2413
+ // src/modules/playlist_square_tag.ts
2414
+ var getSquareTag = async (needMoreTag = true) => {
2415
+ const baseTag = await h5fetch(`https://app.c.nf.migu.cn/pc/bmw/playlist-square/tab/v1.0`);
2416
+ if (!needMoreTag) {
2417
+ return baseTag;
2418
+ }
2419
+ const moreTag = await h5fetch(`https://app.c.nf.migu.cn/pc/v1.0/template/musiclistplaza-taglist/release`);
2420
+ baseTag.data.moreTag = moreTag.data.map((item) => {
2421
+ const title = item?.header?.title;
2422
+ const tagList = item?.content.map((it) => ({
2423
+ tagName: it.texts[0],
2424
+ tagId: it.texts[1]
2425
+ }));
2426
+ return { title, tagList };
2427
+ });
2428
+ return baseTag;
2429
+ };
2430
+
2431
+ // src/modules/resourceinfo_song.ts
2432
+ var getSongInfo = async (contentIds) => {
2433
+ contentIds = contentIds.replace(/,/g, "|");
2434
+ return await h5fetch(`https://app.c.nf.migu.cn/resource/song/by-contentids/v2.0?contentId=${contentIds}`);
2435
+ };
2436
+
2437
+ // src/modules/activities.ts
2438
+ var getActivities = async () => {
2439
+ return await h5fetch(`https://app.u.nf.migu.cn/MIGUM3.0/v1.0/template/index-activity/release`);
2440
+ };
2441
+
2442
+ // src/modules/user_ordered.ts
2443
+ var getUserOrdered = async (pacmtoken) => {
2444
+ if (!pacmtoken) return { data: { success: false, code: "290001", info: "\u8BF7\u5148\u767B\u5F55" }, newPacmToken: void 0 };
2445
+ const { data, cookies } = await ckfetch("https://app.c.nf.migu.cn/MIGUM3.0/strategy/song-ordered/v2.0", {
2446
+ cookie: { pacmtoken },
2447
+ headers: { "channel": "014X031" }
2448
+ });
2449
+ return { data, newPacmToken: cookies.pacmtoken || "" };
2450
+ };
2451
+
2323
2452
  // src/utils/index.ts
2324
2453
  var utils_exports = {};
2325
2454
  __export(utils_exports, {
@@ -2387,10 +2516,12 @@ function createClient() {
2387
2516
  dislikeSong,
2388
2517
  editUserMyList,
2389
2518
  emojiAction,
2519
+ getActivities,
2390
2520
  getAiBeanCount,
2391
2521
  getAiBeanSignStatus,
2392
2522
  getAlbumInfo,
2393
2523
  getAlbumSong,
2524
+ getCloudDLUrl,
2394
2525
  getCloudUploadUrl,
2395
2526
  getCloudUrl,
2396
2527
  getColumnInfo,
@@ -2407,6 +2538,8 @@ function createClient() {
2407
2538
  getFollowingList,
2408
2539
  getFollowingVra,
2409
2540
  getInteractionMsg,
2541
+ getListenFreelySongs,
2542
+ getListenFreelyTab,
2410
2543
  getListenRank,
2411
2544
  getLyric,
2412
2545
  getMVRecommend,
@@ -2425,7 +2558,6 @@ function createClient() {
2425
2558
  getPageTab,
2426
2559
  getPlaylistInfo,
2427
2560
  getPlaylistSong,
2428
- getPlaylistSquarePage,
2429
2561
  getPublicKey,
2430
2562
  getQuality,
2431
2563
  getRadioRecommend,
@@ -2455,6 +2587,11 @@ function createClient() {
2455
2587
  getSingerMv,
2456
2588
  getSingerSimilar,
2457
2589
  getSingerSong,
2590
+ getSongInfo,
2591
+ getSquareListByTag,
2592
+ getSquarePage,
2593
+ getSquareRecommend,
2594
+ getSquareTag,
2458
2595
  getThumbsMsg,
2459
2596
  getTicketInfo,
2460
2597
  getTodayRecommend,
@@ -2469,6 +2606,8 @@ function createClient() {
2469
2606
  getUserHeartthrob,
2470
2607
  getUserHomePage,
2471
2608
  getUserMyList,
2609
+ getUserOrdered,
2610
+ getUserPhoneInfo,
2472
2611
  getUserSongPage,
2473
2612
  getVersion,
2474
2613
  getVipPlaylist,
@@ -2495,6 +2634,7 @@ function createClient() {
2495
2634
  searchConcert,
2496
2635
  searchLrc,
2497
2636
  searchMv,
2637
+ searchPlaylist,
2498
2638
  searchRbt,
2499
2639
  searchSVideo,
2500
2640
  searchSinger,