migu-api-enhanced 2.0.1 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +207 -207
- package/dist/index.cjs +52 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -7
- package/dist/index.d.ts +28 -7
- package/dist/index.js +47 -4
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -45,8 +45,8 @@ declare const getRecommendPlaylist: () => Promise<any>;
|
|
|
45
45
|
declare const getSceneRecommend: (scene?: string, size?: number) => Promise<any>;
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
* 获取电台推荐
|
|
49
|
-
* @param type 1:上瘾电台 2:听见不同
|
|
48
|
+
* 获取电台推荐 (主页电台)
|
|
49
|
+
* @param type 1:上瘾电台 2:听见不同 <- 私人FM <-ALL
|
|
50
50
|
* @returns
|
|
51
51
|
*/
|
|
52
52
|
declare const getRadioRecommend: (type?: number) => Promise<any>;
|
|
@@ -56,15 +56,15 @@ size?: number, hotCommentStart?: number) => Promise<any>;
|
|
|
56
56
|
|
|
57
57
|
declare const getResourceInfo: (resourceId: string, resourceType?: number) => Promise<any>;
|
|
58
58
|
|
|
59
|
-
declare const checkCanListen: (body: any) => Promise<any>;
|
|
59
|
+
declare const checkCanListen: (body: Record<string, any>) => Promise<any>;
|
|
60
60
|
|
|
61
61
|
declare const getOpNum: (ids: string) => Promise<any>;
|
|
62
62
|
|
|
63
63
|
declare const getUrlV1: (contentId: string, copyrightId: string, resourceType?: string) => Promise<any>;
|
|
64
64
|
|
|
65
|
-
declare const getUrlV2: (contentId: string, copyrightId: string, resourceType?: string, pacmtoken?: string) => Promise<any>;
|
|
65
|
+
declare const getUrlV2: (contentId: string, copyrightId: string, toneFlag?: string, resourceType?: string, pacmtoken?: string) => Promise<any>;
|
|
66
66
|
|
|
67
|
-
declare const getUrlH5V24: (contentId: string, copyrightId: string, resourceType?: string) => Promise<any>;
|
|
67
|
+
declare const getUrlH5V24: (contentId: string, copyrightId: string, toneFlag?: string, resourceType?: string) => Promise<any>;
|
|
68
68
|
|
|
69
69
|
declare const getVersion: (channel?: string, version?: string, ua?: string) => Promise<any>;
|
|
70
70
|
|
|
@@ -232,6 +232,22 @@ declare const loginPhone: {
|
|
|
232
232
|
*/
|
|
233
233
|
declare const getMVRecommend: (mvContentId: string, page?: number) => Promise<any>;
|
|
234
234
|
|
|
235
|
+
declare const getPlaylistSquare: () => Promise<any>;
|
|
236
|
+
|
|
237
|
+
declare const searchLrc: (text: string, page?: number) => Promise<any>;
|
|
238
|
+
|
|
239
|
+
declare const getNinanSong: () => Promise<any>;
|
|
240
|
+
|
|
241
|
+
declare const getNinanByDate: (date: string) => Promise<any>;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* 获取电台推荐 (所有电台)
|
|
245
|
+
* 私人FM(上瘾电台、听见不同),时序电台,分类电台,乐游播客,YOU乐电台
|
|
246
|
+
* @param pacmtoken 可选-登录凭证,用于获取所有电台
|
|
247
|
+
* @returns
|
|
248
|
+
*/
|
|
249
|
+
declare const getRadioRecommendAll: (pacmtoken?: string) => Promise<any>;
|
|
250
|
+
|
|
235
251
|
/**
|
|
236
252
|
* modules 子目录统一入口
|
|
237
253
|
* 汇总导出所有 API 函数
|
|
@@ -246,11 +262,15 @@ declare const api_getComment: typeof getComment;
|
|
|
246
262
|
declare const api_getMVRecommend: typeof getMVRecommend;
|
|
247
263
|
declare const api_getMvHls: typeof getMvHls;
|
|
248
264
|
declare const api_getMvInfo: typeof getMvInfo;
|
|
265
|
+
declare const api_getNinanByDate: typeof getNinanByDate;
|
|
266
|
+
declare const api_getNinanSong: typeof getNinanSong;
|
|
249
267
|
declare const api_getOpNum: typeof getOpNum;
|
|
250
268
|
declare const api_getPacmToken: typeof getPacmToken;
|
|
251
269
|
declare const api_getPlaylistInfo: typeof getPlaylistInfo;
|
|
252
270
|
declare const api_getPlaylistSong: typeof getPlaylistSong;
|
|
271
|
+
declare const api_getPlaylistSquare: typeof getPlaylistSquare;
|
|
253
272
|
declare const api_getRadioRecommend: typeof getRadioRecommend;
|
|
273
|
+
declare const api_getRadioRecommendAll: typeof getRadioRecommendAll;
|
|
254
274
|
declare const api_getRankIndex: typeof getRankIndex;
|
|
255
275
|
declare const api_getRankInfo: typeof getRankInfo;
|
|
256
276
|
declare const api_getRecommendPlaylist: typeof getRecommendPlaylist;
|
|
@@ -282,6 +302,7 @@ declare const api_loginSim: typeof loginSim;
|
|
|
282
302
|
declare const api_queryUserInfo: typeof queryUserInfo;
|
|
283
303
|
declare const api_searchAlbum: typeof searchAlbum;
|
|
284
304
|
declare const api_searchConcert: typeof searchConcert;
|
|
305
|
+
declare const api_searchLrc: typeof searchLrc;
|
|
285
306
|
declare const api_searchRbt: typeof searchRbt;
|
|
286
307
|
declare const api_searchSinger: typeof searchSinger;
|
|
287
308
|
declare const api_searchSong: typeof searchSong;
|
|
@@ -289,7 +310,7 @@ declare const api_searchSuggest: typeof searchSuggest;
|
|
|
289
310
|
declare const api_searchTicket: typeof searchTicket;
|
|
290
311
|
declare const api_searchVideo: typeof searchVideo;
|
|
291
312
|
declare namespace api {
|
|
292
|
-
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_getMVRecommend as getMVRecommend, api_getMvHls as getMvHls, api_getMvInfo as getMvInfo, api_getOpNum as getOpNum, api_getPacmToken as getPacmToken, api_getPlaylistInfo as getPlaylistInfo, api_getPlaylistSong as getPlaylistSong, api_getRadioRecommend as getRadioRecommend, api_getRankIndex as getRankIndex, api_getRankInfo as getRankInfo, api_getRecommendPlaylist as getRecommendPlaylist, api_getResourceInfo as getResourceInfo, 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_getUserCollect as getUserCollect, api_getUserHomePage as getUserHomePage, api_getUserMyList as getUserMyList, api_getVersion as getVersion, api_loginNP as loginNP, api_loginOneClick as loginOneClick, api_loginPhone as loginPhone, api_loginSim as loginSim, api_queryUserInfo as queryUserInfo, api_searchAlbum as searchAlbum, api_searchConcert as searchConcert, api_searchRbt as searchRbt, api_searchSinger as searchSinger, api_searchSong as searchSong, api_searchSuggest as searchSuggest, api_searchTicket as searchTicket, api_searchVideo as searchVideo };
|
|
313
|
+
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_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_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_getUserCollect as getUserCollect, api_getUserHomePage as getUserHomePage, api_getUserMyList as getUserMyList, api_getVersion as getVersion, api_loginNP as loginNP, api_loginOneClick as loginOneClick, api_loginPhone as loginPhone, api_loginSim as loginSim, api_queryUserInfo as queryUserInfo, api_searchAlbum as searchAlbum, api_searchConcert as searchConcert, api_searchLrc as searchLrc, api_searchRbt as searchRbt, api_searchSinger as searchSinger, api_searchSong as searchSong, api_searchSuggest as searchSuggest, api_searchTicket as searchTicket, api_searchVideo as searchVideo };
|
|
293
314
|
}
|
|
294
315
|
|
|
295
316
|
declare const ua: string[];
|
|
@@ -335,4 +356,4 @@ declare function createClient(): typeof api;
|
|
|
335
356
|
/** 客户端类型 */
|
|
336
357
|
type MiguClient = ReturnType<typeof createClient>;
|
|
337
358
|
|
|
338
|
-
export { type MiguClient, index as MiguUtils, RSAKey, URLParams, YDRZ, checkCanListen, checkToken, createClient, getAlbumInfo, getAlbumSong, getComment, getDeviceId, getMVRecommend, getMvHls, getMvInfo, getOpNum, getPacmToken, getPlaylistInfo, getPlaylistSong, getPublicKey, getRadioRecommend, getRankIndex, getRankInfo, getRecommendPlaylist, getResourceInfo, getSceneRecommend, getSearchDefault, getSearchHot, getSearchSingerTab, getSearchSingerTabList, getSimilarSongRecommend, getSingerAlbum, getSingerIndex, getSingerSimilar, getSingerSong, getTicketInfo, getTodayRecommend, getUrlH5V24, getUrlV1, getUrlV2, getUserBadge, getUserCollect, getUserHomePage, getUserMyList, getVersion, loginNP, loginOneClick, loginPhone, loginSim, api as modules, queryUserInfo, randomUA, searchAlbum, searchConcert, searchRbt, searchSinger, searchSong, searchSuggest, searchTicket, searchVideo, ua };
|
|
359
|
+
export { type MiguClient, index as MiguUtils, RSAKey, URLParams, YDRZ, checkCanListen, checkToken, createClient, getAlbumInfo, getAlbumSong, getComment, getDeviceId, getMVRecommend, getMvHls, getMvInfo, getNinanByDate, getNinanSong, getOpNum, getPacmToken, getPlaylistInfo, getPlaylistSong, getPlaylistSquare, getPublicKey, getRadioRecommend, getRadioRecommendAll, getRankIndex, getRankInfo, getRecommendPlaylist, getResourceInfo, getSceneRecommend, getSearchDefault, getSearchHot, getSearchSingerTab, getSearchSingerTabList, getSimilarSongRecommend, getSingerAlbum, getSingerIndex, getSingerSimilar, getSingerSong, getTicketInfo, getTodayRecommend, getUrlH5V24, getUrlV1, getUrlV2, getUserBadge, getUserCollect, getUserHomePage, getUserMyList, getVersion, loginNP, loginOneClick, loginPhone, loginSim, api as modules, queryUserInfo, randomUA, searchAlbum, searchConcert, searchLrc, searchRbt, searchSinger, searchSong, searchSuggest, searchTicket, searchVideo, ua };
|
package/dist/index.js
CHANGED
|
@@ -16,11 +16,15 @@ __export(modules_exports, {
|
|
|
16
16
|
getMVRecommend: () => getMVRecommend,
|
|
17
17
|
getMvHls: () => getMvHls,
|
|
18
18
|
getMvInfo: () => getMvInfo,
|
|
19
|
+
getNinanByDate: () => getNinanByDate,
|
|
20
|
+
getNinanSong: () => getNinanSong,
|
|
19
21
|
getOpNum: () => getOpNum,
|
|
20
22
|
getPacmToken: () => getPacmToken,
|
|
21
23
|
getPlaylistInfo: () => getPlaylistInfo,
|
|
22
24
|
getPlaylistSong: () => getPlaylistSong,
|
|
25
|
+
getPlaylistSquare: () => getPlaylistSquare,
|
|
23
26
|
getRadioRecommend: () => getRadioRecommend,
|
|
27
|
+
getRadioRecommendAll: () => getRadioRecommendAll,
|
|
24
28
|
getRankIndex: () => getRankIndex,
|
|
25
29
|
getRankInfo: () => getRankInfo,
|
|
26
30
|
getRecommendPlaylist: () => getRecommendPlaylist,
|
|
@@ -52,6 +56,7 @@ __export(modules_exports, {
|
|
|
52
56
|
queryUserInfo: () => queryUserInfo,
|
|
53
57
|
searchAlbum: () => searchAlbum,
|
|
54
58
|
searchConcert: () => searchConcert,
|
|
59
|
+
searchLrc: () => searchLrc,
|
|
55
60
|
searchRbt: () => searchRbt,
|
|
56
61
|
searchSinger: () => searchSinger,
|
|
57
62
|
searchSong: () => searchSong,
|
|
@@ -287,7 +292,7 @@ var getUrlV1 = async (contentId, copyrightId, resourceType = "2") => {
|
|
|
287
292
|
};
|
|
288
293
|
|
|
289
294
|
// src/modules/url_v2.ts
|
|
290
|
-
var getUrlV2 = async (contentId, copyrightId, resourceType = "2", pacmtoken = "") => {
|
|
295
|
+
var getUrlV2 = async (contentId, copyrightId, toneFlag = "PQ", resourceType = "2", pacmtoken = "") => {
|
|
291
296
|
const deviceId = getDeviceId();
|
|
292
297
|
const timestamp = Date.now();
|
|
293
298
|
const headers = {
|
|
@@ -314,7 +319,7 @@ var getUrlV2 = async (contentId, copyrightId, resourceType = "2", pacmtoken = ""
|
|
|
314
319
|
"location-info": ""
|
|
315
320
|
};
|
|
316
321
|
const res = await fetch(
|
|
317
|
-
`https://app.c.nf.migu.cn/strategy/pc/listen/v2.0?contentId=${contentId}©rightId=${copyrightId}&scene=&netType=01&resourceType=${resourceType}&toneFlag
|
|
322
|
+
`https://app.c.nf.migu.cn/strategy/pc/listen/v2.0?contentId=${contentId}©rightId=${copyrightId}&scene=&netType=01&resourceType=${resourceType}&toneFlag=${toneFlag}`,
|
|
318
323
|
{
|
|
319
324
|
headers
|
|
320
325
|
}
|
|
@@ -359,7 +364,7 @@ async function decryptData(blob) {
|
|
|
359
364
|
}
|
|
360
365
|
|
|
361
366
|
// src/modules/url_h5v2.4.ts
|
|
362
|
-
var getUrlH5V24 = async (contentId, copyrightId, resourceType = "2") => {
|
|
367
|
+
var getUrlH5V24 = async (contentId, copyrightId, toneFlag = "PQ", resourceType = "2") => {
|
|
363
368
|
const headers = {
|
|
364
369
|
"birth": "h5page",
|
|
365
370
|
"channel": "014X031",
|
|
@@ -368,7 +373,7 @@ var getUrlH5V24 = async (contentId, copyrightId, resourceType = "2") => {
|
|
|
368
373
|
"location-info": ""
|
|
369
374
|
};
|
|
370
375
|
const res = await fetch(
|
|
371
|
-
`https://c.musicapp.migu.cn/strategy/listen-url/h5/v2.4?contentId=${contentId}©rightId=${copyrightId}&resourceType=${resourceType}&netType=01&toneFlag
|
|
376
|
+
`https://c.musicapp.migu.cn/strategy/listen-url/h5/v2.4?contentId=${contentId}©rightId=${copyrightId}&resourceType=${resourceType}&netType=01&toneFlag=${toneFlag}&scene=&lowerQualityContentId=${contentId}`,
|
|
372
377
|
{
|
|
373
378
|
headers
|
|
374
379
|
}
|
|
@@ -1149,6 +1154,39 @@ var getMVRecommend = async (mvContentId, page = 1) => {
|
|
|
1149
1154
|
return await h5fetch(`https://c.musicapp.migu.cn/MIGUM3.0/v3.0/content/recommend-mv?resourceId=${mvContentId}&pageNumber=${page}&resourceType=D`);
|
|
1150
1155
|
};
|
|
1151
1156
|
|
|
1157
|
+
// src/modules/playlist_square.ts
|
|
1158
|
+
var getPlaylistSquare = async () => {
|
|
1159
|
+
return await h5fetch(`https://app.c.nf.migu.cn/pc/bmw/page-data/playlist-square-recommend/v1.0?templateVersion=2`);
|
|
1160
|
+
};
|
|
1161
|
+
|
|
1162
|
+
// src/modules/search_lrc.ts
|
|
1163
|
+
var searchLrc = async (text, page = 1) => {
|
|
1164
|
+
return await h5fetch(`http://app.c.nf.migu.cn/bmw/search/lrc/v1.0?pageNo=${page}&text=${text}`);
|
|
1165
|
+
};
|
|
1166
|
+
|
|
1167
|
+
// src/modules/ninan_song.ts
|
|
1168
|
+
var getNinanSong = async () => {
|
|
1169
|
+
return await h5fetch(`https://c.musicapp.migu.cn/MIGUM2.0/column/ninan/song-list/v1.0`);
|
|
1170
|
+
};
|
|
1171
|
+
|
|
1172
|
+
// src/modules/ninan_date.ts
|
|
1173
|
+
var getNinanByDate = async (date) => {
|
|
1174
|
+
return await h5fetch(`https://c.musicapp.migu.cn/MIGUM2.0/v2.0/content/getNinanByDate.do?columnTitle=${date}`);
|
|
1175
|
+
};
|
|
1176
|
+
|
|
1177
|
+
// src/modules/recommend_radio_all.ts
|
|
1178
|
+
var getRadioRecommendAll = async (pacmtoken = "") => {
|
|
1179
|
+
return await h5fetch(
|
|
1180
|
+
`https://app.c.nf.migu.cn/pc/bmw/page-data/music-radio/v1.0?templateVersion=1`,
|
|
1181
|
+
{
|
|
1182
|
+
method: "GET",
|
|
1183
|
+
headers: {
|
|
1184
|
+
"Cookie": `pacmtoken=${pacmtoken}`
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
);
|
|
1188
|
+
};
|
|
1189
|
+
|
|
1152
1190
|
// src/utils/index.ts
|
|
1153
1191
|
var utils_exports = {};
|
|
1154
1192
|
__export(utils_exports, {
|
|
@@ -1192,12 +1230,16 @@ export {
|
|
|
1192
1230
|
getMVRecommend,
|
|
1193
1231
|
getMvHls,
|
|
1194
1232
|
getMvInfo,
|
|
1233
|
+
getNinanByDate,
|
|
1234
|
+
getNinanSong,
|
|
1195
1235
|
getOpNum,
|
|
1196
1236
|
getPacmToken,
|
|
1197
1237
|
getPlaylistInfo,
|
|
1198
1238
|
getPlaylistSong,
|
|
1239
|
+
getPlaylistSquare,
|
|
1199
1240
|
getPublicKey,
|
|
1200
1241
|
getRadioRecommend,
|
|
1242
|
+
getRadioRecommendAll,
|
|
1201
1243
|
getRankIndex,
|
|
1202
1244
|
getRankInfo,
|
|
1203
1245
|
getRecommendPlaylist,
|
|
@@ -1231,6 +1273,7 @@ export {
|
|
|
1231
1273
|
randomUA,
|
|
1232
1274
|
searchAlbum,
|
|
1233
1275
|
searchConcert,
|
|
1276
|
+
searchLrc,
|
|
1234
1277
|
searchRbt,
|
|
1235
1278
|
searchSinger,
|
|
1236
1279
|
searchSong,
|