migu-api-enhanced 2.3.0 → 2.4.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/dist/index.cjs +119 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +100 -5
- package/dist/index.d.ts +100 -5
- package/dist/index.js +110 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -41,6 +41,7 @@ __export(index_exports, {
|
|
|
41
41
|
getAlbumSong: () => getAlbumSong,
|
|
42
42
|
getComment: () => getComment,
|
|
43
43
|
getDeviceId: () => getDeviceId,
|
|
44
|
+
getLyric: () => getLyric,
|
|
44
45
|
getMVRecommend: () => getMVRecommend,
|
|
45
46
|
getMvHls: () => getMvHls,
|
|
46
47
|
getMvInfo: () => getMvInfo,
|
|
@@ -58,6 +59,10 @@ __export(index_exports, {
|
|
|
58
59
|
getRankInfo: () => getRankInfo,
|
|
59
60
|
getRecommendPlaylist: () => getRecommendPlaylist,
|
|
60
61
|
getResourceInfo: () => getResourceInfo,
|
|
62
|
+
getSVideoInfo: () => getSVideoInfo,
|
|
63
|
+
getSVideoSearchSuggest: () => getSVideoSearchSuggest,
|
|
64
|
+
getSVideoUrl: () => getSVideoUrl,
|
|
65
|
+
getSVideoUserContent: () => getSVideoUserContent,
|
|
61
66
|
getSceneRecommend: () => getSceneRecommend,
|
|
62
67
|
getSearchDefault: () => getSearchDefault,
|
|
63
68
|
getSearchHot: () => getSearchHot,
|
|
@@ -78,6 +83,8 @@ __export(index_exports, {
|
|
|
78
83
|
getUserHomePage: () => getUserHomePage,
|
|
79
84
|
getUserMyList: () => getUserMyList,
|
|
80
85
|
getVersion: () => getVersion,
|
|
86
|
+
getVrbtOpNum: () => getVrbtOpNum,
|
|
87
|
+
getVrbtUrl: () => getVrbtUrl,
|
|
81
88
|
loginNP: () => loginNP,
|
|
82
89
|
loginOneClick: () => loginOneClick,
|
|
83
90
|
loginPhone: () => loginPhone,
|
|
@@ -88,12 +95,13 @@ __export(index_exports, {
|
|
|
88
95
|
searchAlbum: () => searchAlbum,
|
|
89
96
|
searchConcert: () => searchConcert,
|
|
90
97
|
searchLrc: () => searchLrc,
|
|
98
|
+
searchMv: () => searchMv,
|
|
91
99
|
searchRbt: () => searchRbt,
|
|
100
|
+
searchSVideo: () => searchSVideo,
|
|
92
101
|
searchSinger: () => searchSinger,
|
|
93
102
|
searchSong: () => searchSong,
|
|
94
103
|
searchSuggest: () => searchSuggest,
|
|
95
104
|
searchTicket: () => searchTicket,
|
|
96
|
-
searchVideo: () => searchVideo,
|
|
97
105
|
ua: () => ua
|
|
98
106
|
});
|
|
99
107
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -107,6 +115,7 @@ __export(modules_exports, {
|
|
|
107
115
|
getAlbumInfo: () => getAlbumInfo,
|
|
108
116
|
getAlbumSong: () => getAlbumSong,
|
|
109
117
|
getComment: () => getComment,
|
|
118
|
+
getLyric: () => getLyric,
|
|
110
119
|
getMVRecommend: () => getMVRecommend,
|
|
111
120
|
getMvHls: () => getMvHls,
|
|
112
121
|
getMvInfo: () => getMvInfo,
|
|
@@ -123,6 +132,10 @@ __export(modules_exports, {
|
|
|
123
132
|
getRankInfo: () => getRankInfo,
|
|
124
133
|
getRecommendPlaylist: () => getRecommendPlaylist,
|
|
125
134
|
getResourceInfo: () => getResourceInfo,
|
|
135
|
+
getSVideoInfo: () => getSVideoInfo,
|
|
136
|
+
getSVideoSearchSuggest: () => getSVideoSearchSuggest,
|
|
137
|
+
getSVideoUrl: () => getSVideoUrl,
|
|
138
|
+
getSVideoUserContent: () => getSVideoUserContent,
|
|
126
139
|
getSceneRecommend: () => getSceneRecommend,
|
|
127
140
|
getSearchDefault: () => getSearchDefault,
|
|
128
141
|
getSearchHot: () => getSearchHot,
|
|
@@ -143,6 +156,8 @@ __export(modules_exports, {
|
|
|
143
156
|
getUserHomePage: () => getUserHomePage,
|
|
144
157
|
getUserMyList: () => getUserMyList,
|
|
145
158
|
getVersion: () => getVersion,
|
|
159
|
+
getVrbtOpNum: () => getVrbtOpNum,
|
|
160
|
+
getVrbtUrl: () => getVrbtUrl,
|
|
146
161
|
loginNP: () => loginNP,
|
|
147
162
|
loginOneClick: () => loginOneClick,
|
|
148
163
|
loginPhone: () => loginPhone,
|
|
@@ -151,12 +166,13 @@ __export(modules_exports, {
|
|
|
151
166
|
searchAlbum: () => searchAlbum,
|
|
152
167
|
searchConcert: () => searchConcert,
|
|
153
168
|
searchLrc: () => searchLrc,
|
|
169
|
+
searchMv: () => searchMv,
|
|
154
170
|
searchRbt: () => searchRbt,
|
|
171
|
+
searchSVideo: () => searchSVideo,
|
|
155
172
|
searchSinger: () => searchSinger,
|
|
156
173
|
searchSong: () => searchSong,
|
|
157
174
|
searchSuggest: () => searchSuggest,
|
|
158
|
-
searchTicket: () => searchTicket
|
|
159
|
-
searchVideo: () => searchVideo
|
|
175
|
+
searchTicket: () => searchTicket
|
|
160
176
|
});
|
|
161
177
|
|
|
162
178
|
// src/utils/h5fetch.ts
|
|
@@ -221,8 +237,8 @@ var getSearchDefault = async () => {
|
|
|
221
237
|
return await h5fetch(`http://app.c.nf.migu.cn/column/search/default-text/v3.0?resourceVersion=2`);
|
|
222
238
|
};
|
|
223
239
|
|
|
224
|
-
// src/modules/
|
|
225
|
-
var
|
|
240
|
+
// src/modules/search_mv.ts
|
|
241
|
+
var searchMv = async (text, page = 1, typeOrder = 0) => {
|
|
226
242
|
return await h5fetch(`http://app.c.nf.migu.cn/bmw/search/video/v1.0?pageNo=${page}&text=${text}&typeOrder=${typeOrder}`);
|
|
227
243
|
};
|
|
228
244
|
|
|
@@ -360,8 +376,10 @@ var getComment = async (resourceId, resourceType = 2, size = 20, hotCommentStart
|
|
|
360
376
|
};
|
|
361
377
|
|
|
362
378
|
// src/modules/resourceinfo.ts
|
|
363
|
-
var getResourceInfo = async (
|
|
364
|
-
|
|
379
|
+
var getResourceInfo = async (resourceIds = "", copyrightIds = "", resourceType = 2) => {
|
|
380
|
+
resourceIds = resourceIds.replace(/,/g, "|");
|
|
381
|
+
copyrightIds = copyrightIds.replace(/,/g, "|");
|
|
382
|
+
return await h5fetch(`https://app.u.nf.migu.cn/MIGUM2.0/v1.0/content/resourceinfo.do?resourceId=${resourceIds}©rightId=${copyrightIds}&resourceType=${resourceType}`);
|
|
365
383
|
};
|
|
366
384
|
|
|
367
385
|
// src/modules/can-listen.ts
|
|
@@ -1236,6 +1254,91 @@ var getRadioRecommendAll = async (pacmtoken = "") => {
|
|
|
1236
1254
|
return { data: res.data, newPacmToken };
|
|
1237
1255
|
};
|
|
1238
1256
|
|
|
1257
|
+
// src/modules/svideo_info.ts
|
|
1258
|
+
var getSVideoInfo = async (contentIds) => {
|
|
1259
|
+
const contentIdList = contentIds.split(",");
|
|
1260
|
+
contentIdList.map((item) => {
|
|
1261
|
+
return "6000," + item;
|
|
1262
|
+
}).join("|");
|
|
1263
|
+
return await h5fetch(`https://app.c.nf.migu.cn/resource/video-info/by-id/v1.0?requestParams=${contentIdList}`);
|
|
1264
|
+
};
|
|
1265
|
+
|
|
1266
|
+
// src/modules/svideo_search.ts
|
|
1267
|
+
var searchSVideo = async (text, page = 1) => {
|
|
1268
|
+
return await h5fetch(
|
|
1269
|
+
`https://app.c.nf.migu.cn/bmw/hot-search/search/videos/v1.0?pageIndex=${page}&text=${text}`,
|
|
1270
|
+
{
|
|
1271
|
+
headers: {
|
|
1272
|
+
"deviceid": getDeviceId()
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
);
|
|
1276
|
+
};
|
|
1277
|
+
|
|
1278
|
+
// src/modules/svideo_searchSuggest.ts
|
|
1279
|
+
var getSVideoSearchSuggest = async (text) => {
|
|
1280
|
+
return await h5fetch(`https://app.c.nf.migu.cn/resource-dataloader/search-suggest/search/v1.0?text=${text}`);
|
|
1281
|
+
};
|
|
1282
|
+
|
|
1283
|
+
// src/modules/svideo_url.ts
|
|
1284
|
+
var getSVideoUrl = async (contentIds, formatType = "HQ") => {
|
|
1285
|
+
contentIds = contentIds.replace(/,/g, "|");
|
|
1286
|
+
return await h5fetch(`https://app.c.nf.migu.cn/strategy/short-video/play/v1.0?contentIds=${contentIds}&formatType=${formatType}`);
|
|
1287
|
+
};
|
|
1288
|
+
|
|
1289
|
+
// src/modules/svideo_userContent.ts
|
|
1290
|
+
var getSVideoUserContent = async (videoUserId, nextPageId = "") => {
|
|
1291
|
+
return await h5fetch(`https://app.c.nf.migu.cn/user/i/user-content-list/v1.0?nextPageId=${nextPageId}&videoUserId=${videoUserId}`);
|
|
1292
|
+
};
|
|
1293
|
+
|
|
1294
|
+
// src/modules/vrbt_opNum.ts
|
|
1295
|
+
var getVrbtOpNum = async (contentIds) => {
|
|
1296
|
+
return await h5fetch(`https://app.c.nf.migu.cn/resource/vrbt/opnum/v1.0?resourceType=M&contentIds=${contentIds}`);
|
|
1297
|
+
};
|
|
1298
|
+
|
|
1299
|
+
// src/modules/vrbt_url.ts
|
|
1300
|
+
var getVrbtUrl = async (contentIds) => {
|
|
1301
|
+
contentIds = contentIds.replace(/,/g, "|");
|
|
1302
|
+
return await h5fetch(
|
|
1303
|
+
`https://app.c.nf.migu.cn/strategy/vrbt/play/v1.0?contentIds=${contentIds}`,
|
|
1304
|
+
{
|
|
1305
|
+
headers: {
|
|
1306
|
+
"channel": "014X031"
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
);
|
|
1310
|
+
};
|
|
1311
|
+
|
|
1312
|
+
// src/modules/lyric.ts
|
|
1313
|
+
var import_axios16 = __toESM(require("axios"), 1);
|
|
1314
|
+
var getLyric = async (contentId) => {
|
|
1315
|
+
if (contentId === "") return { error: "contentId is empty!", success: false };
|
|
1316
|
+
const res = await import_axios16.default.get(`https://app.c.nf.migu.cn/resource/song/by-contentids/v2.0?contentId=${contentId}`);
|
|
1317
|
+
const code = res.data.code.toString() || "";
|
|
1318
|
+
const data = res.data.data || [];
|
|
1319
|
+
if (code !== "000000") return {
|
|
1320
|
+
success: false,
|
|
1321
|
+
status: res.status,
|
|
1322
|
+
error: res.data.info || res.data
|
|
1323
|
+
};
|
|
1324
|
+
if (data.length === 0) return { error: "data.length = 0 !", success: false, data };
|
|
1325
|
+
const lrcUrl = data[0].lrcUrl || "";
|
|
1326
|
+
if (lrcUrl === "") return { error: "lrcUrl is empty!", success: false, data };
|
|
1327
|
+
const lrcRes = await import_axios16.default.get(lrcUrl);
|
|
1328
|
+
if (lrcRes.status !== 200) return {
|
|
1329
|
+
success: false,
|
|
1330
|
+
status: lrcRes.status,
|
|
1331
|
+
error: "lrcRes.status !== 200 !",
|
|
1332
|
+
data
|
|
1333
|
+
};
|
|
1334
|
+
const lrc = lrcRes.data || "";
|
|
1335
|
+
return {
|
|
1336
|
+
success: true,
|
|
1337
|
+
lrc,
|
|
1338
|
+
lrcUrl
|
|
1339
|
+
};
|
|
1340
|
+
};
|
|
1341
|
+
|
|
1239
1342
|
// src/utils/index.ts
|
|
1240
1343
|
var utils_exports = {};
|
|
1241
1344
|
__export(utils_exports, {
|
|
@@ -1277,6 +1380,7 @@ function createClient() {
|
|
|
1277
1380
|
getAlbumSong,
|
|
1278
1381
|
getComment,
|
|
1279
1382
|
getDeviceId,
|
|
1383
|
+
getLyric,
|
|
1280
1384
|
getMVRecommend,
|
|
1281
1385
|
getMvHls,
|
|
1282
1386
|
getMvInfo,
|
|
@@ -1294,6 +1398,10 @@ function createClient() {
|
|
|
1294
1398
|
getRankInfo,
|
|
1295
1399
|
getRecommendPlaylist,
|
|
1296
1400
|
getResourceInfo,
|
|
1401
|
+
getSVideoInfo,
|
|
1402
|
+
getSVideoSearchSuggest,
|
|
1403
|
+
getSVideoUrl,
|
|
1404
|
+
getSVideoUserContent,
|
|
1297
1405
|
getSceneRecommend,
|
|
1298
1406
|
getSearchDefault,
|
|
1299
1407
|
getSearchHot,
|
|
@@ -1314,6 +1422,8 @@ function createClient() {
|
|
|
1314
1422
|
getUserHomePage,
|
|
1315
1423
|
getUserMyList,
|
|
1316
1424
|
getVersion,
|
|
1425
|
+
getVrbtOpNum,
|
|
1426
|
+
getVrbtUrl,
|
|
1317
1427
|
loginNP,
|
|
1318
1428
|
loginOneClick,
|
|
1319
1429
|
loginPhone,
|
|
@@ -1324,12 +1434,13 @@ function createClient() {
|
|
|
1324
1434
|
searchAlbum,
|
|
1325
1435
|
searchConcert,
|
|
1326
1436
|
searchLrc,
|
|
1437
|
+
searchMv,
|
|
1327
1438
|
searchRbt,
|
|
1439
|
+
searchSVideo,
|
|
1328
1440
|
searchSinger,
|
|
1329
1441
|
searchSong,
|
|
1330
1442
|
searchSuggest,
|
|
1331
1443
|
searchTicket,
|
|
1332
|
-
searchVideo,
|
|
1333
1444
|
ua
|
|
1334
1445
|
});
|
|
1335
1446
|
//# sourceMappingURL=index.cjs.map
|