migu-api-enhanced 2.4.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 +6 -75
- package/dist/index.cjs +156 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +69 -6
- package/dist/index.d.ts +69 -6
- package/dist/index.js +148 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -67,9 +67,9 @@ declare const getOpNum: (ids: string) => Promise<any>;
|
|
|
67
67
|
|
|
68
68
|
declare const getUrlV1: (contentId: string, copyrightId: string, resourceType?: string) => Promise<any>;
|
|
69
69
|
|
|
70
|
-
declare const getUrlV2: (contentId: string, copyrightId: string, toneFlag?: string,
|
|
70
|
+
declare const getUrlV2: (contentId: string, copyrightId: string, toneFlag?: string, pacmtoken?: string) => Promise<any>;
|
|
71
71
|
|
|
72
|
-
declare const getUrlH5V24: (contentId: string, copyrightId: string, toneFlag?: string
|
|
72
|
+
declare const getUrlH5V24: (contentId: string, copyrightId: string, toneFlag?: string) => Promise<any>;
|
|
73
73
|
|
|
74
74
|
declare const getVersion: (channel?: string, version?: string, ua?: string) => Promise<any>;
|
|
75
75
|
|
|
@@ -139,7 +139,7 @@ declare const loginSim: {
|
|
|
139
139
|
}>;
|
|
140
140
|
};
|
|
141
141
|
|
|
142
|
-
declare const
|
|
142
|
+
declare const getUserCollectList: (pacmtoken: string, page?: number, size?: number) => Promise<{
|
|
143
143
|
data: any;
|
|
144
144
|
newPacmToken: string;
|
|
145
145
|
}>;
|
|
@@ -332,14 +332,74 @@ declare const getLyric: (contentId: string) => Promise<{
|
|
|
332
332
|
data?: undefined;
|
|
333
333
|
}>;
|
|
334
334
|
|
|
335
|
+
/**
|
|
336
|
+
* 添加用户收藏
|
|
337
|
+
* @param pacmtoken 用户pacmtoken
|
|
338
|
+
* @param playlistId 播放列表id
|
|
339
|
+
* @param title 播放列表标题
|
|
340
|
+
*/
|
|
341
|
+
declare const addUserCollect: (pacmtoken: string, playlistId: string, title: string) => Promise<{
|
|
342
|
+
data: any;
|
|
343
|
+
newPacmToken: string;
|
|
344
|
+
}>;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* 添加用户收藏
|
|
348
|
+
* @param pacmtoken 用户pacmtoken
|
|
349
|
+
* @param playlistId 播放列表id
|
|
350
|
+
*/
|
|
351
|
+
declare const removeUserCollect: (pacmtoken: string, playlistId: string) => Promise<{
|
|
352
|
+
data: any;
|
|
353
|
+
newPacmToken: string;
|
|
354
|
+
}>;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* @param pacmtoken
|
|
358
|
+
* @param contentIds 音乐id列表,多个id用逗号隔开,例如:123,456,789
|
|
359
|
+
* @returns 添加喜欢音乐结果,包含新pacmtoken
|
|
360
|
+
*/
|
|
361
|
+
declare const likeSong: (pacmtoken: string, contentIds: string) => Promise<{
|
|
362
|
+
data: any;
|
|
363
|
+
newPacmToken: string;
|
|
364
|
+
}>;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* @param pacmtoken
|
|
368
|
+
* @param contentId 单个音乐id,例如:123
|
|
369
|
+
* @returns 移除喜欢音乐结果,包含新pacmtoken
|
|
370
|
+
*/
|
|
371
|
+
declare const dislikeSong: (pacmtoken: string, contentId: string) => Promise<{
|
|
372
|
+
data: any;
|
|
373
|
+
newPacmToken: string;
|
|
374
|
+
}>;
|
|
375
|
+
|
|
376
|
+
declare const editUserMyList: (pacmtoken: string, title: string, playlistId: string) => Promise<{
|
|
377
|
+
data: any;
|
|
378
|
+
newPacmToken: string;
|
|
379
|
+
}>;
|
|
380
|
+
|
|
381
|
+
declare const addUserMyList: (pacmtoken: string, title: string) => Promise<{
|
|
382
|
+
data: any;
|
|
383
|
+
newPacmToken: string;
|
|
384
|
+
}>;
|
|
385
|
+
|
|
386
|
+
declare const removeUserMyList: (pacmtoken: string, playlistId: string) => Promise<{
|
|
387
|
+
data: any;
|
|
388
|
+
newPacmToken: string;
|
|
389
|
+
}>;
|
|
390
|
+
|
|
335
391
|
/**
|
|
336
392
|
* modules 子目录统一入口
|
|
337
393
|
* 汇总导出所有 API 函数
|
|
338
394
|
*/
|
|
339
395
|
|
|
340
396
|
declare const api_YDRZ: typeof YDRZ;
|
|
397
|
+
declare const api_addUserCollect: typeof addUserCollect;
|
|
398
|
+
declare const api_addUserMyList: typeof addUserMyList;
|
|
341
399
|
declare const api_checkCanListen: typeof checkCanListen;
|
|
342
400
|
declare const api_checkToken: typeof checkToken;
|
|
401
|
+
declare const api_dislikeSong: typeof dislikeSong;
|
|
402
|
+
declare const api_editUserMyList: typeof editUserMyList;
|
|
343
403
|
declare const api_getAlbumInfo: typeof getAlbumInfo;
|
|
344
404
|
declare const api_getAlbumSong: typeof getAlbumSong;
|
|
345
405
|
declare const api_getComment: typeof getComment;
|
|
@@ -380,17 +440,20 @@ declare const api_getUrlH5V24: typeof getUrlH5V24;
|
|
|
380
440
|
declare const api_getUrlV1: typeof getUrlV1;
|
|
381
441
|
declare const api_getUrlV2: typeof getUrlV2;
|
|
382
442
|
declare const api_getUserBadge: typeof getUserBadge;
|
|
383
|
-
declare const
|
|
443
|
+
declare const api_getUserCollectList: typeof getUserCollectList;
|
|
384
444
|
declare const api_getUserHomePage: typeof getUserHomePage;
|
|
385
445
|
declare const api_getUserMyList: typeof getUserMyList;
|
|
386
446
|
declare const api_getVersion: typeof getVersion;
|
|
387
447
|
declare const api_getVrbtOpNum: typeof getVrbtOpNum;
|
|
388
448
|
declare const api_getVrbtUrl: typeof getVrbtUrl;
|
|
449
|
+
declare const api_likeSong: typeof likeSong;
|
|
389
450
|
declare const api_loginNP: typeof loginNP;
|
|
390
451
|
declare const api_loginOneClick: typeof loginOneClick;
|
|
391
452
|
declare const api_loginPhone: typeof loginPhone;
|
|
392
453
|
declare const api_loginSim: typeof loginSim;
|
|
393
454
|
declare const api_queryUserInfo: typeof queryUserInfo;
|
|
455
|
+
declare const api_removeUserCollect: typeof removeUserCollect;
|
|
456
|
+
declare const api_removeUserMyList: typeof removeUserMyList;
|
|
394
457
|
declare const api_searchAlbum: typeof searchAlbum;
|
|
395
458
|
declare const api_searchConcert: typeof searchConcert;
|
|
396
459
|
declare const api_searchLrc: typeof searchLrc;
|
|
@@ -402,7 +465,7 @@ declare const api_searchSong: typeof searchSong;
|
|
|
402
465
|
declare const api_searchSuggest: typeof searchSuggest;
|
|
403
466
|
declare const api_searchTicket: typeof searchTicket;
|
|
404
467
|
declare namespace api {
|
|
405
|
-
export { api_YDRZ as YDRZ, api_checkCanListen as checkCanListen, api_checkToken as checkToken, api_getAlbumInfo as getAlbumInfo, api_getAlbumSong as getAlbumSong, api_getComment as getComment, api_getLyric as getLyric, api_getMVRecommend as getMVRecommend, api_getMvHls as getMvHls, api_getMvInfo as getMvInfo, api_getNinanByDate as getNinanByDate, api_getNinanSong as getNinanSong, api_getOpNum as getOpNum, api_getPacmToken as getPacmToken, api_getPlaylistInfo as getPlaylistInfo, api_getPlaylistSong as getPlaylistSong, api_getPlaylistSquare as getPlaylistSquare, api_getRadioRecommend as getRadioRecommend, api_getRadioRecommendAll as getRadioRecommendAll, api_getRankIndex as getRankIndex, api_getRankInfo as getRankInfo, api_getRecommendPlaylist as getRecommendPlaylist, api_getResourceInfo as getResourceInfo, api_getSVideoInfo as getSVideoInfo, api_getSVideoSearchSuggest as getSVideoSearchSuggest, api_getSVideoUrl as getSVideoUrl, api_getSVideoUserContent as getSVideoUserContent, api_getSceneRecommend as getSceneRecommend, api_getSearchDefault as getSearchDefault, api_getSearchHot as getSearchHot, api_getSearchSingerTab as getSearchSingerTab, api_getSearchSingerTabList as getSearchSingerTabList, api_getSimilarSongRecommend as getSimilarSongRecommend, api_getSingerAlbum as getSingerAlbum, api_getSingerIndex as getSingerIndex, api_getSingerSimilar as getSingerSimilar, api_getSingerSong as getSingerSong, api_getTicketInfo as getTicketInfo, api_getTodayRecommend as getTodayRecommend, api_getUrlH5V24 as getUrlH5V24, api_getUrlV1 as getUrlV1, api_getUrlV2 as getUrlV2, api_getUserBadge as getUserBadge,
|
|
468
|
+
export { api_YDRZ as YDRZ, api_addUserCollect as addUserCollect, api_addUserMyList as addUserMyList, api_checkCanListen as checkCanListen, api_checkToken as checkToken, api_dislikeSong as dislikeSong, api_editUserMyList as editUserMyList, api_getAlbumInfo as getAlbumInfo, api_getAlbumSong as getAlbumSong, api_getComment as getComment, api_getLyric as getLyric, api_getMVRecommend as getMVRecommend, api_getMvHls as getMvHls, api_getMvInfo as getMvInfo, api_getNinanByDate as getNinanByDate, api_getNinanSong as getNinanSong, api_getOpNum as getOpNum, api_getPacmToken as getPacmToken, api_getPlaylistInfo as getPlaylistInfo, api_getPlaylistSong as getPlaylistSong, api_getPlaylistSquare as getPlaylistSquare, api_getRadioRecommend as getRadioRecommend, api_getRadioRecommendAll as getRadioRecommendAll, api_getRankIndex as getRankIndex, api_getRankInfo as getRankInfo, api_getRecommendPlaylist as getRecommendPlaylist, api_getResourceInfo as getResourceInfo, api_getSVideoInfo as getSVideoInfo, api_getSVideoSearchSuggest as getSVideoSearchSuggest, api_getSVideoUrl as getSVideoUrl, api_getSVideoUserContent as getSVideoUserContent, api_getSceneRecommend as getSceneRecommend, api_getSearchDefault as getSearchDefault, api_getSearchHot as getSearchHot, api_getSearchSingerTab as getSearchSingerTab, api_getSearchSingerTabList as getSearchSingerTabList, api_getSimilarSongRecommend as getSimilarSongRecommend, api_getSingerAlbum as getSingerAlbum, api_getSingerIndex as getSingerIndex, api_getSingerSimilar as getSingerSimilar, api_getSingerSong as getSingerSong, api_getTicketInfo as getTicketInfo, api_getTodayRecommend as getTodayRecommend, api_getUrlH5V24 as getUrlH5V24, api_getUrlV1 as getUrlV1, api_getUrlV2 as getUrlV2, api_getUserBadge as getUserBadge, api_getUserCollectList as getUserCollectList, api_getUserHomePage as getUserHomePage, api_getUserMyList as getUserMyList, api_getVersion as getVersion, api_getVrbtOpNum as getVrbtOpNum, api_getVrbtUrl as getVrbtUrl, api_likeSong as likeSong, api_loginNP as loginNP, api_loginOneClick as loginOneClick, api_loginPhone as loginPhone, api_loginSim as loginSim, api_queryUserInfo as queryUserInfo, api_removeUserCollect as removeUserCollect, api_removeUserMyList as removeUserMyList, api_searchAlbum as searchAlbum, api_searchConcert as searchConcert, api_searchLrc as searchLrc, api_searchMv as searchMv, api_searchRbt as searchRbt, api_searchSVideo as searchSVideo, api_searchSinger as searchSinger, api_searchSong as searchSong, api_searchSuggest as searchSuggest, api_searchTicket as searchTicket };
|
|
406
469
|
}
|
|
407
470
|
|
|
408
471
|
declare const ua: string[];
|
|
@@ -448,4 +511,4 @@ declare function createClient(): typeof api;
|
|
|
448
511
|
/** 客户端类型 */
|
|
449
512
|
type MiguClient = ReturnType<typeof createClient>;
|
|
450
513
|
|
|
451
|
-
export { type MiguClient, index as MiguUtils, RSAKey, URLParams, YDRZ, checkCanListen, checkToken, createClient, getAlbumInfo, getAlbumSong, getComment, getDeviceId, getLyric, getMVRecommend, getMvHls, getMvInfo, getNinanByDate, getNinanSong, getOpNum, getPacmToken, getPlaylistInfo, getPlaylistSong, getPlaylistSquare, getPublicKey, getRadioRecommend, getRadioRecommendAll, getRankIndex, getRankInfo, getRecommendPlaylist, getResourceInfo, getSVideoInfo, getSVideoSearchSuggest, getSVideoUrl, getSVideoUserContent, getSceneRecommend, getSearchDefault, getSearchHot, getSearchSingerTab, getSearchSingerTabList, getSimilarSongRecommend, getSingerAlbum, getSingerIndex, getSingerSimilar, getSingerSong, getTicketInfo, getTodayRecommend, getUrlH5V24, getUrlV1, getUrlV2, getUserBadge,
|
|
514
|
+
export { type MiguClient, index as MiguUtils, RSAKey, URLParams, YDRZ, addUserCollect, addUserMyList, checkCanListen, checkToken, createClient, dislikeSong, editUserMyList, getAlbumInfo, getAlbumSong, getComment, getDeviceId, getLyric, getMVRecommend, getMvHls, getMvInfo, getNinanByDate, getNinanSong, getOpNum, getPacmToken, getPlaylistInfo, getPlaylistSong, getPlaylistSquare, getPublicKey, getRadioRecommend, getRadioRecommendAll, getRankIndex, getRankInfo, getRecommendPlaylist, getResourceInfo, getSVideoInfo, getSVideoSearchSuggest, getSVideoUrl, getSVideoUserContent, getSceneRecommend, getSearchDefault, getSearchHot, getSearchSingerTab, getSearchSingerTabList, getSimilarSongRecommend, getSingerAlbum, getSingerIndex, getSingerSimilar, getSingerSong, getTicketInfo, getTodayRecommend, getUrlH5V24, getUrlV1, getUrlV2, getUserBadge, getUserCollectList, getUserHomePage, getUserMyList, getVersion, getVrbtOpNum, getVrbtUrl, likeSong, loginNP, loginOneClick, loginPhone, loginSim, api as modules, queryUserInfo, randomUA, removeUserCollect, removeUserMyList, searchAlbum, searchConcert, searchLrc, searchMv, searchRbt, searchSVideo, searchSinger, searchSong, searchSuggest, searchTicket, ua };
|
package/dist/index.d.ts
CHANGED
|
@@ -67,9 +67,9 @@ declare const getOpNum: (ids: string) => Promise<any>;
|
|
|
67
67
|
|
|
68
68
|
declare const getUrlV1: (contentId: string, copyrightId: string, resourceType?: string) => Promise<any>;
|
|
69
69
|
|
|
70
|
-
declare const getUrlV2: (contentId: string, copyrightId: string, toneFlag?: string,
|
|
70
|
+
declare const getUrlV2: (contentId: string, copyrightId: string, toneFlag?: string, pacmtoken?: string) => Promise<any>;
|
|
71
71
|
|
|
72
|
-
declare const getUrlH5V24: (contentId: string, copyrightId: string, toneFlag?: string
|
|
72
|
+
declare const getUrlH5V24: (contentId: string, copyrightId: string, toneFlag?: string) => Promise<any>;
|
|
73
73
|
|
|
74
74
|
declare const getVersion: (channel?: string, version?: string, ua?: string) => Promise<any>;
|
|
75
75
|
|
|
@@ -139,7 +139,7 @@ declare const loginSim: {
|
|
|
139
139
|
}>;
|
|
140
140
|
};
|
|
141
141
|
|
|
142
|
-
declare const
|
|
142
|
+
declare const getUserCollectList: (pacmtoken: string, page?: number, size?: number) => Promise<{
|
|
143
143
|
data: any;
|
|
144
144
|
newPacmToken: string;
|
|
145
145
|
}>;
|
|
@@ -332,14 +332,74 @@ declare const getLyric: (contentId: string) => Promise<{
|
|
|
332
332
|
data?: undefined;
|
|
333
333
|
}>;
|
|
334
334
|
|
|
335
|
+
/**
|
|
336
|
+
* 添加用户收藏
|
|
337
|
+
* @param pacmtoken 用户pacmtoken
|
|
338
|
+
* @param playlistId 播放列表id
|
|
339
|
+
* @param title 播放列表标题
|
|
340
|
+
*/
|
|
341
|
+
declare const addUserCollect: (pacmtoken: string, playlistId: string, title: string) => Promise<{
|
|
342
|
+
data: any;
|
|
343
|
+
newPacmToken: string;
|
|
344
|
+
}>;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* 添加用户收藏
|
|
348
|
+
* @param pacmtoken 用户pacmtoken
|
|
349
|
+
* @param playlistId 播放列表id
|
|
350
|
+
*/
|
|
351
|
+
declare const removeUserCollect: (pacmtoken: string, playlistId: string) => Promise<{
|
|
352
|
+
data: any;
|
|
353
|
+
newPacmToken: string;
|
|
354
|
+
}>;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* @param pacmtoken
|
|
358
|
+
* @param contentIds 音乐id列表,多个id用逗号隔开,例如:123,456,789
|
|
359
|
+
* @returns 添加喜欢音乐结果,包含新pacmtoken
|
|
360
|
+
*/
|
|
361
|
+
declare const likeSong: (pacmtoken: string, contentIds: string) => Promise<{
|
|
362
|
+
data: any;
|
|
363
|
+
newPacmToken: string;
|
|
364
|
+
}>;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* @param pacmtoken
|
|
368
|
+
* @param contentId 单个音乐id,例如:123
|
|
369
|
+
* @returns 移除喜欢音乐结果,包含新pacmtoken
|
|
370
|
+
*/
|
|
371
|
+
declare const dislikeSong: (pacmtoken: string, contentId: string) => Promise<{
|
|
372
|
+
data: any;
|
|
373
|
+
newPacmToken: string;
|
|
374
|
+
}>;
|
|
375
|
+
|
|
376
|
+
declare const editUserMyList: (pacmtoken: string, title: string, playlistId: string) => Promise<{
|
|
377
|
+
data: any;
|
|
378
|
+
newPacmToken: string;
|
|
379
|
+
}>;
|
|
380
|
+
|
|
381
|
+
declare const addUserMyList: (pacmtoken: string, title: string) => Promise<{
|
|
382
|
+
data: any;
|
|
383
|
+
newPacmToken: string;
|
|
384
|
+
}>;
|
|
385
|
+
|
|
386
|
+
declare const removeUserMyList: (pacmtoken: string, playlistId: string) => Promise<{
|
|
387
|
+
data: any;
|
|
388
|
+
newPacmToken: string;
|
|
389
|
+
}>;
|
|
390
|
+
|
|
335
391
|
/**
|
|
336
392
|
* modules 子目录统一入口
|
|
337
393
|
* 汇总导出所有 API 函数
|
|
338
394
|
*/
|
|
339
395
|
|
|
340
396
|
declare const api_YDRZ: typeof YDRZ;
|
|
397
|
+
declare const api_addUserCollect: typeof addUserCollect;
|
|
398
|
+
declare const api_addUserMyList: typeof addUserMyList;
|
|
341
399
|
declare const api_checkCanListen: typeof checkCanListen;
|
|
342
400
|
declare const api_checkToken: typeof checkToken;
|
|
401
|
+
declare const api_dislikeSong: typeof dislikeSong;
|
|
402
|
+
declare const api_editUserMyList: typeof editUserMyList;
|
|
343
403
|
declare const api_getAlbumInfo: typeof getAlbumInfo;
|
|
344
404
|
declare const api_getAlbumSong: typeof getAlbumSong;
|
|
345
405
|
declare const api_getComment: typeof getComment;
|
|
@@ -380,17 +440,20 @@ declare const api_getUrlH5V24: typeof getUrlH5V24;
|
|
|
380
440
|
declare const api_getUrlV1: typeof getUrlV1;
|
|
381
441
|
declare const api_getUrlV2: typeof getUrlV2;
|
|
382
442
|
declare const api_getUserBadge: typeof getUserBadge;
|
|
383
|
-
declare const
|
|
443
|
+
declare const api_getUserCollectList: typeof getUserCollectList;
|
|
384
444
|
declare const api_getUserHomePage: typeof getUserHomePage;
|
|
385
445
|
declare const api_getUserMyList: typeof getUserMyList;
|
|
386
446
|
declare const api_getVersion: typeof getVersion;
|
|
387
447
|
declare const api_getVrbtOpNum: typeof getVrbtOpNum;
|
|
388
448
|
declare const api_getVrbtUrl: typeof getVrbtUrl;
|
|
449
|
+
declare const api_likeSong: typeof likeSong;
|
|
389
450
|
declare const api_loginNP: typeof loginNP;
|
|
390
451
|
declare const api_loginOneClick: typeof loginOneClick;
|
|
391
452
|
declare const api_loginPhone: typeof loginPhone;
|
|
392
453
|
declare const api_loginSim: typeof loginSim;
|
|
393
454
|
declare const api_queryUserInfo: typeof queryUserInfo;
|
|
455
|
+
declare const api_removeUserCollect: typeof removeUserCollect;
|
|
456
|
+
declare const api_removeUserMyList: typeof removeUserMyList;
|
|
394
457
|
declare const api_searchAlbum: typeof searchAlbum;
|
|
395
458
|
declare const api_searchConcert: typeof searchConcert;
|
|
396
459
|
declare const api_searchLrc: typeof searchLrc;
|
|
@@ -402,7 +465,7 @@ declare const api_searchSong: typeof searchSong;
|
|
|
402
465
|
declare const api_searchSuggest: typeof searchSuggest;
|
|
403
466
|
declare const api_searchTicket: typeof searchTicket;
|
|
404
467
|
declare namespace api {
|
|
405
|
-
export { api_YDRZ as YDRZ, api_checkCanListen as checkCanListen, api_checkToken as checkToken, api_getAlbumInfo as getAlbumInfo, api_getAlbumSong as getAlbumSong, api_getComment as getComment, api_getLyric as getLyric, api_getMVRecommend as getMVRecommend, api_getMvHls as getMvHls, api_getMvInfo as getMvInfo, api_getNinanByDate as getNinanByDate, api_getNinanSong as getNinanSong, api_getOpNum as getOpNum, api_getPacmToken as getPacmToken, api_getPlaylistInfo as getPlaylistInfo, api_getPlaylistSong as getPlaylistSong, api_getPlaylistSquare as getPlaylistSquare, api_getRadioRecommend as getRadioRecommend, api_getRadioRecommendAll as getRadioRecommendAll, api_getRankIndex as getRankIndex, api_getRankInfo as getRankInfo, api_getRecommendPlaylist as getRecommendPlaylist, api_getResourceInfo as getResourceInfo, api_getSVideoInfo as getSVideoInfo, api_getSVideoSearchSuggest as getSVideoSearchSuggest, api_getSVideoUrl as getSVideoUrl, api_getSVideoUserContent as getSVideoUserContent, api_getSceneRecommend as getSceneRecommend, api_getSearchDefault as getSearchDefault, api_getSearchHot as getSearchHot, api_getSearchSingerTab as getSearchSingerTab, api_getSearchSingerTabList as getSearchSingerTabList, api_getSimilarSongRecommend as getSimilarSongRecommend, api_getSingerAlbum as getSingerAlbum, api_getSingerIndex as getSingerIndex, api_getSingerSimilar as getSingerSimilar, api_getSingerSong as getSingerSong, api_getTicketInfo as getTicketInfo, api_getTodayRecommend as getTodayRecommend, api_getUrlH5V24 as getUrlH5V24, api_getUrlV1 as getUrlV1, api_getUrlV2 as getUrlV2, api_getUserBadge as getUserBadge,
|
|
468
|
+
export { api_YDRZ as YDRZ, api_addUserCollect as addUserCollect, api_addUserMyList as addUserMyList, api_checkCanListen as checkCanListen, api_checkToken as checkToken, api_dislikeSong as dislikeSong, api_editUserMyList as editUserMyList, api_getAlbumInfo as getAlbumInfo, api_getAlbumSong as getAlbumSong, api_getComment as getComment, api_getLyric as getLyric, api_getMVRecommend as getMVRecommend, api_getMvHls as getMvHls, api_getMvInfo as getMvInfo, api_getNinanByDate as getNinanByDate, api_getNinanSong as getNinanSong, api_getOpNum as getOpNum, api_getPacmToken as getPacmToken, api_getPlaylistInfo as getPlaylistInfo, api_getPlaylistSong as getPlaylistSong, api_getPlaylistSquare as getPlaylistSquare, api_getRadioRecommend as getRadioRecommend, api_getRadioRecommendAll as getRadioRecommendAll, api_getRankIndex as getRankIndex, api_getRankInfo as getRankInfo, api_getRecommendPlaylist as getRecommendPlaylist, api_getResourceInfo as getResourceInfo, api_getSVideoInfo as getSVideoInfo, api_getSVideoSearchSuggest as getSVideoSearchSuggest, api_getSVideoUrl as getSVideoUrl, api_getSVideoUserContent as getSVideoUserContent, api_getSceneRecommend as getSceneRecommend, api_getSearchDefault as getSearchDefault, api_getSearchHot as getSearchHot, api_getSearchSingerTab as getSearchSingerTab, api_getSearchSingerTabList as getSearchSingerTabList, api_getSimilarSongRecommend as getSimilarSongRecommend, api_getSingerAlbum as getSingerAlbum, api_getSingerIndex as getSingerIndex, api_getSingerSimilar as getSingerSimilar, api_getSingerSong as getSingerSong, api_getTicketInfo as getTicketInfo, api_getTodayRecommend as getTodayRecommend, api_getUrlH5V24 as getUrlH5V24, api_getUrlV1 as getUrlV1, api_getUrlV2 as getUrlV2, api_getUserBadge as getUserBadge, api_getUserCollectList as getUserCollectList, api_getUserHomePage as getUserHomePage, api_getUserMyList as getUserMyList, api_getVersion as getVersion, api_getVrbtOpNum as getVrbtOpNum, api_getVrbtUrl as getVrbtUrl, api_likeSong as likeSong, api_loginNP as loginNP, api_loginOneClick as loginOneClick, api_loginPhone as loginPhone, api_loginSim as loginSim, api_queryUserInfo as queryUserInfo, api_removeUserCollect as removeUserCollect, api_removeUserMyList as removeUserMyList, api_searchAlbum as searchAlbum, api_searchConcert as searchConcert, api_searchLrc as searchLrc, api_searchMv as searchMv, api_searchRbt as searchRbt, api_searchSVideo as searchSVideo, api_searchSinger as searchSinger, api_searchSong as searchSong, api_searchSuggest as searchSuggest, api_searchTicket as searchTicket };
|
|
406
469
|
}
|
|
407
470
|
|
|
408
471
|
declare const ua: string[];
|
|
@@ -448,4 +511,4 @@ declare function createClient(): typeof api;
|
|
|
448
511
|
/** 客户端类型 */
|
|
449
512
|
type MiguClient = ReturnType<typeof createClient>;
|
|
450
513
|
|
|
451
|
-
export { type MiguClient, index as MiguUtils, RSAKey, URLParams, YDRZ, checkCanListen, checkToken, createClient, getAlbumInfo, getAlbumSong, getComment, getDeviceId, getLyric, getMVRecommend, getMvHls, getMvInfo, getNinanByDate, getNinanSong, getOpNum, getPacmToken, getPlaylistInfo, getPlaylistSong, getPlaylistSquare, getPublicKey, getRadioRecommend, getRadioRecommendAll, getRankIndex, getRankInfo, getRecommendPlaylist, getResourceInfo, getSVideoInfo, getSVideoSearchSuggest, getSVideoUrl, getSVideoUserContent, getSceneRecommend, getSearchDefault, getSearchHot, getSearchSingerTab, getSearchSingerTabList, getSimilarSongRecommend, getSingerAlbum, getSingerIndex, getSingerSimilar, getSingerSong, getTicketInfo, getTodayRecommend, getUrlH5V24, getUrlV1, getUrlV2, getUserBadge,
|
|
514
|
+
export { type MiguClient, index as MiguUtils, RSAKey, URLParams, YDRZ, addUserCollect, addUserMyList, checkCanListen, checkToken, createClient, dislikeSong, editUserMyList, getAlbumInfo, getAlbumSong, getComment, getDeviceId, getLyric, getMVRecommend, getMvHls, getMvInfo, getNinanByDate, getNinanSong, getOpNum, getPacmToken, getPlaylistInfo, getPlaylistSong, getPlaylistSquare, getPublicKey, getRadioRecommend, getRadioRecommendAll, getRankIndex, getRankInfo, getRecommendPlaylist, getResourceInfo, getSVideoInfo, getSVideoSearchSuggest, getSVideoUrl, getSVideoUserContent, getSceneRecommend, getSearchDefault, getSearchHot, getSearchSingerTab, getSearchSingerTabList, getSimilarSongRecommend, getSingerAlbum, getSingerIndex, getSingerSimilar, getSingerSong, getTicketInfo, getTodayRecommend, getUrlH5V24, getUrlV1, getUrlV2, getUserBadge, getUserCollectList, getUserHomePage, getUserMyList, getVersion, getVrbtOpNum, getVrbtUrl, likeSong, loginNP, loginOneClick, loginPhone, loginSim, api as modules, queryUserInfo, randomUA, removeUserCollect, removeUserMyList, searchAlbum, searchConcert, searchLrc, searchMv, searchRbt, searchSVideo, searchSinger, searchSong, searchSuggest, searchTicket, ua };
|
package/dist/index.js
CHANGED
|
@@ -8,8 +8,12 @@ var __export = (target, all) => {
|
|
|
8
8
|
var modules_exports = {};
|
|
9
9
|
__export(modules_exports, {
|
|
10
10
|
YDRZ: () => YDRZ,
|
|
11
|
+
addUserCollect: () => addUserCollect,
|
|
12
|
+
addUserMyList: () => addUserMyList,
|
|
11
13
|
checkCanListen: () => checkCanListen,
|
|
12
14
|
checkToken: () => checkToken,
|
|
15
|
+
dislikeSong: () => dislikeSong,
|
|
16
|
+
editUserMyList: () => editUserMyList,
|
|
13
17
|
getAlbumInfo: () => getAlbumInfo,
|
|
14
18
|
getAlbumSong: () => getAlbumSong,
|
|
15
19
|
getComment: () => getComment,
|
|
@@ -50,17 +54,20 @@ __export(modules_exports, {
|
|
|
50
54
|
getUrlV1: () => getUrlV1,
|
|
51
55
|
getUrlV2: () => getUrlV2,
|
|
52
56
|
getUserBadge: () => getUserBadge,
|
|
53
|
-
|
|
57
|
+
getUserCollectList: () => getUserCollectList,
|
|
54
58
|
getUserHomePage: () => getUserHomePage,
|
|
55
59
|
getUserMyList: () => getUserMyList,
|
|
56
60
|
getVersion: () => getVersion,
|
|
57
61
|
getVrbtOpNum: () => getVrbtOpNum,
|
|
58
62
|
getVrbtUrl: () => getVrbtUrl,
|
|
63
|
+
likeSong: () => likeSong,
|
|
59
64
|
loginNP: () => loginNP,
|
|
60
65
|
loginOneClick: () => loginOneClick,
|
|
61
66
|
loginPhone: () => loginPhone,
|
|
62
67
|
loginSim: () => loginSim,
|
|
63
68
|
queryUserInfo: () => queryUserInfo,
|
|
69
|
+
removeUserCollect: () => removeUserCollect,
|
|
70
|
+
removeUserMyList: () => removeUserMyList,
|
|
64
71
|
searchAlbum: () => searchAlbum,
|
|
65
72
|
searchConcert: () => searchConcert,
|
|
66
73
|
searchLrc: () => searchLrc,
|
|
@@ -313,34 +320,19 @@ var getUrlV1 = async (contentId, copyrightId, resourceType = "2") => {
|
|
|
313
320
|
|
|
314
321
|
// src/modules/url_v2.ts
|
|
315
322
|
import axios2 from "axios";
|
|
316
|
-
var getUrlV2 = async (contentId, copyrightId, toneFlag = "PQ",
|
|
323
|
+
var getUrlV2 = async (contentId, copyrightId, toneFlag = "PQ", pacmtoken = "") => {
|
|
317
324
|
const deviceId = getDeviceId();
|
|
318
|
-
const timestamp = Date.now();
|
|
319
325
|
const headers = {
|
|
320
|
-
"Accept": "application/json, text/plain, */*",
|
|
321
|
-
"test": "00",
|
|
322
326
|
"channel": "014X031",
|
|
323
327
|
"subchannel": "014X031",
|
|
324
|
-
"logId": "cfrom=&appId=h5",
|
|
325
|
-
"uid": "",
|
|
326
328
|
"pacmtoken": pacmtoken,
|
|
327
|
-
"appId": "h5",
|
|
328
|
-
"platform": "H5",
|
|
329
329
|
"deviceId": deviceId,
|
|
330
|
-
"ua": "Android_migu",
|
|
331
|
-
"version": "6.8.8",
|
|
332
|
-
"activityId": "MUSIC-WWW",
|
|
333
|
-
"birth": "h5page",
|
|
334
|
-
"signature": "1",
|
|
335
|
-
"timestamp": timestamp.toString(),
|
|
336
|
-
"Content-Type": "application/json;charset=UTF-8",
|
|
337
330
|
"referer": "https://music.migu.cn/",
|
|
338
|
-
"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",
|
|
339
331
|
"location-data": "30.6698676660,104.1229614820",
|
|
340
332
|
"location-info": ""
|
|
341
333
|
};
|
|
342
334
|
const res = await axios2.get(
|
|
343
|
-
`https://app.c.nf.migu.cn/strategy/pc/listen/v2.0?contentId=${contentId}©rightId=${copyrightId}&scene=&netType=01&resourceType
|
|
335
|
+
`https://app.c.nf.migu.cn/strategy/pc/listen/v2.0?contentId=${contentId}©rightId=${copyrightId}&scene=&netType=01&resourceType=2&toneFlag=${toneFlag}`,
|
|
344
336
|
{
|
|
345
337
|
headers,
|
|
346
338
|
responseType: "arraybuffer"
|
|
@@ -381,7 +373,7 @@ function decryptData(buf) {
|
|
|
381
373
|
|
|
382
374
|
// src/modules/url_h5v2.4.ts
|
|
383
375
|
import axios3 from "axios";
|
|
384
|
-
var getUrlH5V24 = async (contentId, copyrightId, toneFlag = "PQ"
|
|
376
|
+
var getUrlH5V24 = async (contentId, copyrightId, toneFlag = "PQ") => {
|
|
385
377
|
const headers = {
|
|
386
378
|
"birth": "h5page",
|
|
387
379
|
"channel": "014X031",
|
|
@@ -390,7 +382,7 @@ var getUrlH5V24 = async (contentId, copyrightId, toneFlag = "PQ", resourceType =
|
|
|
390
382
|
"location-info": ""
|
|
391
383
|
};
|
|
392
384
|
const res = await axios3.get(
|
|
393
|
-
`https://c.musicapp.migu.cn/strategy/listen-url/h5/v2.4?contentId=${contentId}©rightId=${copyrightId}&resourceType
|
|
385
|
+
`https://c.musicapp.migu.cn/strategy/listen-url/h5/v2.4?contentId=${contentId}©rightId=${copyrightId}&resourceType=2&netType=01&toneFlag=${toneFlag}&scene=&lowerQualityContentId=${contentId}`,
|
|
394
386
|
{
|
|
395
387
|
headers,
|
|
396
388
|
responseType: "arraybuffer"
|
|
@@ -796,9 +788,9 @@ var loginSim = {
|
|
|
796
788
|
}
|
|
797
789
|
};
|
|
798
790
|
|
|
799
|
-
// src/modules/
|
|
791
|
+
// src/modules/user_collect_list.ts
|
|
800
792
|
import axios11 from "axios";
|
|
801
|
-
var
|
|
793
|
+
var getUserCollectList = async (pacmtoken, page = 1, size = 20) => {
|
|
802
794
|
const res = await axios11.get(`https://app.c.nf.migu.cn/user/h5/user/collection/v1.0?pageNo=${page}&type=1&OPType=03&pageSize=${size}&resourceType=2021`, {
|
|
803
795
|
headers: {
|
|
804
796
|
"Cookie": `pacmtoken=${pacmtoken}`
|
|
@@ -1237,6 +1229,132 @@ var getLyric = async (contentId) => {
|
|
|
1237
1229
|
};
|
|
1238
1230
|
};
|
|
1239
1231
|
|
|
1232
|
+
// src/modules/user_collect_add.ts
|
|
1233
|
+
import axios17 from "axios";
|
|
1234
|
+
var addUserCollect = async (pacmtoken, playlistId, title) => {
|
|
1235
|
+
title = encodeURIComponent(title);
|
|
1236
|
+
const res = await axios17.get(
|
|
1237
|
+
`https://app.c.nf.migu.cn/pc/v1.0/user/add_collection.do?outOPType=03&outResourceName=${title}&outResourceType=2021&outResourceId=${playlistId}`,
|
|
1238
|
+
{
|
|
1239
|
+
headers: {
|
|
1240
|
+
"cookie": `pacmtoken=${pacmtoken}`
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
);
|
|
1244
|
+
const newPacmToken = getSetCookieValueFromObject(res.headers, "pacmtoken");
|
|
1245
|
+
return { data: res.data, newPacmToken };
|
|
1246
|
+
};
|
|
1247
|
+
|
|
1248
|
+
// src/modules/user_collect_remove.ts
|
|
1249
|
+
import axios18 from "axios";
|
|
1250
|
+
var removeUserCollect = async (pacmtoken, playlistId) => {
|
|
1251
|
+
const res = await axios18.get(
|
|
1252
|
+
`https://app.c.nf.migu.cn/pc/v1.0/user/del_collection.do?oPType=03&resourceType=2021&resourceId=${playlistId}`,
|
|
1253
|
+
{
|
|
1254
|
+
headers: {
|
|
1255
|
+
"cookie": `pacmtoken=${pacmtoken}`
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
);
|
|
1259
|
+
const newPacmToken = getSetCookieValueFromObject(res.headers, "pacmtoken");
|
|
1260
|
+
return { data: res.data, newPacmToken };
|
|
1261
|
+
};
|
|
1262
|
+
|
|
1263
|
+
// src/modules/user_like.ts
|
|
1264
|
+
import axios19 from "axios";
|
|
1265
|
+
var likeSong = async (pacmtoken, contentIds) => {
|
|
1266
|
+
const contentIdsList = contentIds.split(",");
|
|
1267
|
+
const res = await axios19.post(
|
|
1268
|
+
`https://app.c.nf.migu.cn/pc/user/api/add-music-list-song/v1.0`,
|
|
1269
|
+
{
|
|
1270
|
+
contentIds: contentIdsList
|
|
1271
|
+
},
|
|
1272
|
+
{
|
|
1273
|
+
headers: {
|
|
1274
|
+
"Cookie": `pacmtoken=${pacmtoken}`
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
);
|
|
1278
|
+
const newPacmToken = getSetCookieValueFromObject(res.headers, "pacmtoken");
|
|
1279
|
+
return { data: res.data, newPacmToken };
|
|
1280
|
+
};
|
|
1281
|
+
|
|
1282
|
+
// src/modules/user_dislike.ts
|
|
1283
|
+
import axios20 from "axios";
|
|
1284
|
+
var dislikeSong = async (pacmtoken, contentId) => {
|
|
1285
|
+
const body = {
|
|
1286
|
+
"channel": "23",
|
|
1287
|
+
"contentId": contentId,
|
|
1288
|
+
"songflag": "2"
|
|
1289
|
+
};
|
|
1290
|
+
const res = await axios20.post(
|
|
1291
|
+
`https://app.c.nf.migu.cn/pc/user/h5-import-musiclist/v1.0`,
|
|
1292
|
+
body,
|
|
1293
|
+
{
|
|
1294
|
+
headers: {
|
|
1295
|
+
"Cookie": `pacmtoken=${pacmtoken}`
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
);
|
|
1299
|
+
const newPacmToken = getSetCookieValueFromObject(res.headers, "pacmtoken");
|
|
1300
|
+
return { data: res.data, newPacmToken };
|
|
1301
|
+
};
|
|
1302
|
+
|
|
1303
|
+
// src/modules/user_myList_edit.ts
|
|
1304
|
+
import axios21 from "axios";
|
|
1305
|
+
var editUserMyList = async (pacmtoken, title, playlistId) => {
|
|
1306
|
+
const body = {
|
|
1307
|
+
"title": title,
|
|
1308
|
+
"channel": "23",
|
|
1309
|
+
"id": playlistId,
|
|
1310
|
+
"songflag": "0"
|
|
1311
|
+
};
|
|
1312
|
+
const res = await axios21.post(
|
|
1313
|
+
`https://app.c.nf.migu.cn/pc/user/h5-import-musiclist/v1.0`,
|
|
1314
|
+
body,
|
|
1315
|
+
{
|
|
1316
|
+
headers: {
|
|
1317
|
+
"Cookie": `pacmtoken=${pacmtoken}`
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
);
|
|
1321
|
+
const newPacmToken = getSetCookieValueFromObject(res.headers, "pacmtoken");
|
|
1322
|
+
return { data: res.data, newPacmToken };
|
|
1323
|
+
};
|
|
1324
|
+
|
|
1325
|
+
// src/modules/user_myList_add.ts
|
|
1326
|
+
import axios22 from "axios";
|
|
1327
|
+
var addUserMyList = async (pacmtoken, title) => {
|
|
1328
|
+
const body = {
|
|
1329
|
+
"title": title,
|
|
1330
|
+
"channel": "23",
|
|
1331
|
+
"type": "self_build"
|
|
1332
|
+
};
|
|
1333
|
+
const res = await axios22.post(
|
|
1334
|
+
`https://app.c.nf.migu.cn/pc/open/api/music-list/add/v2.0`,
|
|
1335
|
+
body,
|
|
1336
|
+
{
|
|
1337
|
+
headers: {
|
|
1338
|
+
"Cookie": `pacmtoken=${pacmtoken}`
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
);
|
|
1342
|
+
const newPacmToken = getSetCookieValueFromObject(res.headers, "pacmtoken");
|
|
1343
|
+
return { data: res.data, newPacmToken };
|
|
1344
|
+
};
|
|
1345
|
+
|
|
1346
|
+
// src/modules/user_myList_remove.ts
|
|
1347
|
+
import axios23 from "axios";
|
|
1348
|
+
var removeUserMyList = async (pacmtoken, playlistId) => {
|
|
1349
|
+
const res = await axios23.get(`https://app.c.nf.migu.cn/pc/v1.0/user/deleteMusicList.do?channel=23&id=${playlistId}`, {
|
|
1350
|
+
headers: {
|
|
1351
|
+
"Cookie": `pacmtoken=${pacmtoken}`
|
|
1352
|
+
}
|
|
1353
|
+
});
|
|
1354
|
+
const newPacmToken = getSetCookieValueFromObject(res.headers, "pacmtoken");
|
|
1355
|
+
return { data: res.data, newPacmToken };
|
|
1356
|
+
};
|
|
1357
|
+
|
|
1240
1358
|
// src/utils/index.ts
|
|
1241
1359
|
var utils_exports = {};
|
|
1242
1360
|
__export(utils_exports, {
|
|
@@ -1270,9 +1388,13 @@ export {
|
|
|
1270
1388
|
RSAKey,
|
|
1271
1389
|
URLParams,
|
|
1272
1390
|
YDRZ,
|
|
1391
|
+
addUserCollect,
|
|
1392
|
+
addUserMyList,
|
|
1273
1393
|
checkCanListen,
|
|
1274
1394
|
checkToken,
|
|
1275
1395
|
createClient,
|
|
1396
|
+
dislikeSong,
|
|
1397
|
+
editUserMyList,
|
|
1276
1398
|
getAlbumInfo,
|
|
1277
1399
|
getAlbumSong,
|
|
1278
1400
|
getComment,
|
|
@@ -1315,12 +1437,13 @@ export {
|
|
|
1315
1437
|
getUrlV1,
|
|
1316
1438
|
getUrlV2,
|
|
1317
1439
|
getUserBadge,
|
|
1318
|
-
|
|
1440
|
+
getUserCollectList,
|
|
1319
1441
|
getUserHomePage,
|
|
1320
1442
|
getUserMyList,
|
|
1321
1443
|
getVersion,
|
|
1322
1444
|
getVrbtOpNum,
|
|
1323
1445
|
getVrbtUrl,
|
|
1446
|
+
likeSong,
|
|
1324
1447
|
loginNP,
|
|
1325
1448
|
loginOneClick,
|
|
1326
1449
|
loginPhone,
|
|
@@ -1328,6 +1451,8 @@ export {
|
|
|
1328
1451
|
modules_exports as modules,
|
|
1329
1452
|
queryUserInfo,
|
|
1330
1453
|
randomUA,
|
|
1454
|
+
removeUserCollect,
|
|
1455
|
+
removeUserMyList,
|
|
1331
1456
|
searchAlbum,
|
|
1332
1457
|
searchConcert,
|
|
1333
1458
|
searchLrc,
|