migu-api-enhanced 2.27.1 → 2.27.2

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.
Files changed (89) hide show
  1. package/README.md +10 -5
  2. package/dist/YDRZ-HSTSW5FC.mjs +11 -0
  3. package/dist/YDRZ-HSTSW5FC.mjs.map +1 -0
  4. package/dist/YDRZ-KF4GXM2T.cjs +11 -0
  5. package/dist/YDRZ-KF4GXM2T.cjs.map +1 -0
  6. package/dist/activity/index.cjs +85 -0
  7. package/dist/activity/index.cjs.map +1 -0
  8. package/dist/activity/index.d.cts +70 -0
  9. package/dist/activity/index.d.ts +70 -0
  10. package/dist/activity/index.mjs +85 -0
  11. package/dist/activity/index.mjs.map +1 -0
  12. package/dist/chunk-4M7T22TX.mjs +21 -0
  13. package/dist/chunk-4M7T22TX.mjs.map +1 -0
  14. package/dist/chunk-AJYZYXNE.mjs +18 -0
  15. package/dist/chunk-AJYZYXNE.mjs.map +1 -0
  16. package/dist/chunk-C56WQXBU.cjs +13 -0
  17. package/dist/chunk-C56WQXBU.cjs.map +1 -0
  18. package/dist/chunk-EIM46AX6.mjs +144 -0
  19. package/dist/chunk-EIM46AX6.mjs.map +1 -0
  20. package/dist/chunk-H6YB76CZ.mjs +95 -0
  21. package/dist/chunk-H6YB76CZ.mjs.map +1 -0
  22. package/dist/chunk-HDGZY5R6.mjs +13 -0
  23. package/dist/chunk-HDGZY5R6.mjs.map +1 -0
  24. package/dist/chunk-ILRMRBMK.cjs +71 -0
  25. package/dist/chunk-ILRMRBMK.cjs.map +1 -0
  26. package/dist/chunk-JOOWMEQP.cjs +95 -0
  27. package/dist/chunk-JOOWMEQP.cjs.map +1 -0
  28. package/dist/chunk-JXEQGZBM.cjs +21 -0
  29. package/dist/chunk-JXEQGZBM.cjs.map +1 -0
  30. package/dist/chunk-KGXC32BN.cjs +185 -0
  31. package/dist/chunk-KGXC32BN.cjs.map +1 -0
  32. package/dist/chunk-QEH62Z4S.cjs +18 -0
  33. package/dist/chunk-QEH62Z4S.cjs.map +1 -0
  34. package/dist/chunk-QMBC3CRQ.mjs +51 -0
  35. package/dist/chunk-QMBC3CRQ.mjs.map +1 -0
  36. package/dist/chunk-QTK2O5KQ.mjs +71 -0
  37. package/dist/chunk-QTK2O5KQ.mjs.map +1 -0
  38. package/dist/chunk-RI7PQIHG.cjs +144 -0
  39. package/dist/chunk-RI7PQIHG.cjs.map +1 -0
  40. package/dist/chunk-TIKOSETY.cjs +51 -0
  41. package/dist/chunk-TIKOSETY.cjs.map +1 -0
  42. package/dist/chunk-VE3TRZRD.mjs +185 -0
  43. package/dist/chunk-VE3TRZRD.mjs.map +1 -0
  44. package/dist/decryptMrc-EGKXYBTB.mjs +11 -0
  45. package/dist/decryptMrc-EGKXYBTB.mjs.map +1 -0
  46. package/dist/decryptMrc-OOH5UIFN.cjs +11 -0
  47. package/dist/decryptMrc-OOH5UIFN.cjs.map +1 -0
  48. package/dist/index.cjs +1577 -26
  49. package/dist/index.cjs.map +1 -1
  50. package/dist/index.d.cts +982 -2
  51. package/dist/index.d.ts +982 -2
  52. package/dist/{modules/index.js → index.mjs} +43 -958
  53. package/dist/index.mjs.map +1 -0
  54. package/dist/login/index.cjs +315 -0
  55. package/dist/login/index.cjs.map +1 -0
  56. package/dist/login/index.d.cts +57 -0
  57. package/dist/login/index.d.ts +57 -0
  58. package/dist/login/index.mjs +315 -0
  59. package/dist/login/index.mjs.map +1 -0
  60. package/dist/mrc/index.cjs +39 -0
  61. package/dist/mrc/index.cjs.map +1 -0
  62. package/dist/mrc/index.d.cts +37 -0
  63. package/dist/mrc/index.d.ts +37 -0
  64. package/dist/mrc/index.mjs +39 -0
  65. package/dist/mrc/index.mjs.map +1 -0
  66. package/dist/publicKey-D2LR2HGH.cjs +8 -0
  67. package/dist/publicKey-D2LR2HGH.cjs.map +1 -0
  68. package/dist/publicKey-YCVYQ54R.mjs +8 -0
  69. package/dist/publicKey-YCVYQ54R.mjs.map +1 -0
  70. package/dist/rsalib-GGMEGQT2.cjs +9 -0
  71. package/dist/rsalib-GGMEGQT2.cjs.map +1 -0
  72. package/dist/rsalib-HO4SSCTO.mjs +9 -0
  73. package/dist/rsalib-HO4SSCTO.mjs.map +1 -0
  74. package/dist/utils/index.cjs +46 -421
  75. package/dist/utils/index.cjs.map +1 -1
  76. package/dist/utils/index.d.cts +46 -2
  77. package/dist/utils/index.d.ts +46 -2
  78. package/dist/utils/index.mjs +81 -0
  79. package/dist/utils/index.mjs.map +1 -0
  80. package/package.json +20 -10
  81. package/dist/index.js +0 -4
  82. package/dist/index.js.map +0 -1
  83. package/dist/modules/index.cjs +0 -2666
  84. package/dist/modules/index.cjs.map +0 -1
  85. package/dist/modules/index.d.cts +0 -1156
  86. package/dist/modules/index.d.ts +0 -1156
  87. package/dist/modules/index.js.map +0 -1
  88. package/dist/utils/index.js +0 -406
  89. package/dist/utils/index.js.map +0 -1
@@ -1,92 +1,13 @@
1
- // src/utils/h5fetch.ts
2
- import axios from "axios";
3
-
4
- // src/utils/setCookie.ts
5
- var getCookieValue = (cookies, key) => {
6
- for (const item of cookies) {
7
- const prefix = `${key}=`;
8
- if (item.includes(prefix)) {
9
- const mainPart = item.split(";")[0];
10
- return mainPart.split("=")[1] || "";
11
- }
12
- }
13
- return "";
14
- };
15
- var getSetCookieValueFromObject = (headers, key) => {
16
- const setCookieHeader = headers["set-cookie"];
17
- if (!setCookieHeader) {
18
- return "";
19
- }
20
- const cookies = Array.isArray(setCookieHeader) ? setCookieHeader : setCookieHeader.split(",").map((c) => c.trim());
21
- return getCookieValue(cookies, key);
22
- };
23
-
24
- // src/utils/h5fetch.ts
25
- var _fetch = async (url, init) => {
26
- const method = (init?.method || "GET").toUpperCase();
27
- const headersRaw = init?.headers;
28
- let headers = {};
29
- if (headersRaw) {
30
- if (headersRaw instanceof Headers) {
31
- headersRaw.forEach((value, key) => {
32
- headers[key] = value;
33
- });
34
- } else if (Array.isArray(headersRaw)) {
35
- headersRaw.forEach(([key, value]) => {
36
- headers[key] = value;
37
- });
38
- } else {
39
- headers = headersRaw;
40
- }
41
- }
42
- const axiosConfig = {
43
- url,
44
- method,
45
- headers,
46
- params: init?.params,
47
- maxRedirects: init?.maxRedirects,
48
- data: init?.body
49
- };
50
- if (init?.signal) {
51
- axiosConfig.signal = init.signal;
52
- }
53
- return await axios(axiosConfig);
54
- };
55
- var h5fetch = async (url, init) => {
56
- const response = await _fetch(url, init);
57
- return response.data;
58
- };
59
- var ckfetch = async (url, init) => {
60
- const cookieKeys = init?.cookie ? Object.keys(init.cookie) : [];
61
- const cookieHeader = init?.cookie ? Object.entries(init.cookie).map(([k, v]) => `${k}=${v}`).join("; ") : "";
62
- const newHeaders = {};
63
- if (init?.headers) {
64
- if (init.headers instanceof Headers) {
65
- init.headers.forEach((value, key) => {
66
- newHeaders[key] = value;
67
- });
68
- } else if (Array.isArray(init.headers)) {
69
- init.headers.forEach(([key, value]) => {
70
- newHeaders[key] = value;
71
- });
72
- } else {
73
- Object.assign(newHeaders, init.headers);
74
- }
75
- }
76
- if (cookieHeader) newHeaders["Cookie"] = cookieHeader;
77
- const response = await _fetch(url, { ...init, headers: newHeaders });
78
- const cookies = {};
79
- for (const key of cookieKeys) {
80
- const value = getSetCookieValueFromObject(response.headers, key);
81
- if (value) {
82
- cookies[key] = value;
83
- }
84
- }
85
- return {
86
- data: response.data,
87
- cookies
88
- };
89
- };
1
+ import {
2
+ changeQuality
3
+ } from "./chunk-QTK2O5KQ.mjs";
4
+ import {
5
+ getDeviceId
6
+ } from "./chunk-AJYZYXNE.mjs";
7
+ import {
8
+ ckfetch,
9
+ h5fetch
10
+ } from "./chunk-H6YB76CZ.mjs";
90
11
 
91
12
  // src/modules/search.ts
92
13
  var searchSong = async (text, page = 1) => {
@@ -205,20 +126,6 @@ var getRecommendPlaylist = async () => {
205
126
  return await h5fetch(`http://app.c.nf.migu.cn/bmw/index-show/recommend-playlist/v3.0`);
206
127
  };
207
128
 
208
- // src/utils/deviceID.ts
209
- function getDeviceId(a, b) {
210
- var c, d = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), e2 = [];
211
- if (b = b || d.length, a)
212
- for (c = 0; a > c; c++)
213
- e2[c] = d[0 | Math.random() * b];
214
- else {
215
- var f;
216
- for (e2[8] = e2[13] = e2[18] = e2[23] = "-", e2[14] = "4", c = 0; 36 > c; c++)
217
- e2[c] || (f = 0 | 16 * Math.random(), e2[c] = d[19 == c ? 3 & f | 8 : f]);
218
- }
219
- return e2.join("");
220
- }
221
-
222
129
  // src/modules/recommend_song.ts
223
130
  var getSceneRecommend = async (scene = "TODAY_RECOMMEND", size = 10) => {
224
131
  let params = "";
@@ -293,68 +200,6 @@ var getOpNum = async (ids) => {
293
200
  return await h5fetch(`https://app.c.nf.migu.cn/opnum/query-optype-v1.0?opType=play&resourceType=2021&ids=${ids}`);
294
201
  };
295
202
 
296
- // src/utils/quality.ts
297
- var qualityList = [
298
- "LQ",
299
- "PQ",
300
- "HQ",
301
- "SQ",
302
- "ZQ24",
303
- "ZQ32",
304
- "Z3D",
305
- "3D60"
306
- ];
307
- var e = encodeURI;
308
- var toneUrl = {
309
- "LQ": e("\u5168\u66F2\u8BD5\u542C/Mp3_64_22_16"),
310
- "PQ": e("\u6807\u6E05\u9AD8\u6E05/MP3_128_16_Stero"),
311
- "HQ": e("\u6807\u6E05\u9AD8\u6E05/MP3_320_16_Stero"),
312
- "SQ": e("\u6B4C\u66F2\u4E0B\u8F7D/flac"),
313
- "ZQ24": e("\u6B4C\u66F2\u4E0B\u8F7D/flac_24bit"),
314
- "ZQ32": e("\u6B4C\u66F2\u4E0B\u8F7D/wav_32bit"),
315
- "Z3D": e("\u6B4C\u66F2\u4E0B\u8F7D/wav_3d"),
316
- "3D60": e("\u6B4C\u66F2\u4E0B\u8F7D/wav_3d_60s")
317
- //3D 60s 试听
318
- };
319
- var toneUrlList = Object.entries(toneUrl);
320
- var toneFormat = {
321
- "LQ": ".mp3",
322
- "PQ": ".mp3",
323
- "HQ": ".mp3",
324
- "SQ": ".flac",
325
- "ZQ24": ".flac",
326
- "ZQ32": ".wav",
327
- "Z3D": ".wav",
328
- "3D60": ".wav"
329
- };
330
- function isQuality(quality) {
331
- return qualityList.includes(quality);
332
- }
333
- function getQuality(url) {
334
- let tone = "";
335
- if (!tone) {
336
- for (let i = 0; i < toneUrlList.length; i++) {
337
- const [key, value] = toneUrlList[i];
338
- if (url.includes(value)) {
339
- tone = key;
340
- break;
341
- }
342
- }
343
- }
344
- return tone;
345
- }
346
- function changeQuality(url, quality, originalQuality, splitQuery = true) {
347
- const originalTone = isQuality(originalQuality) ? originalQuality : getQuality(url);
348
- if (splitQuery) {
349
- url = url.split("?")[0];
350
- }
351
- if (!isQuality(quality) || !isQuality(originalTone)) {
352
- return url;
353
- } else {
354
- return url.replace(toneUrl[originalTone], toneUrl[quality]).replace(toneFormat[originalTone], toneFormat[quality]);
355
- }
356
- }
357
-
358
203
  // src/modules/url_v1.ts
359
204
  var getUrlV1 = async (contentId, copyrightId, toneFlag = "PQ", resourceType = "2") => {
360
205
  const data = await h5fetch(
@@ -371,7 +216,7 @@ var getUrlV1 = async (contentId, copyrightId, toneFlag = "PQ", resourceType = "2
371
216
  };
372
217
 
373
218
  // src/modules/url_v2.ts
374
- import axios2 from "axios";
219
+ import axios from "axios";
375
220
  var getUrlV2 = async (contentId, copyrightId, toneFlag = "PQ", pacmtoken = "") => {
376
221
  const deviceId = getDeviceId();
377
222
  const timestamp = Date.now();
@@ -388,7 +233,7 @@ var getUrlV2 = async (contentId, copyrightId, toneFlag = "PQ", pacmtoken = "") =
388
233
  "timestamp": timestamp.toString(),
389
234
  "referer": "https://music.migu.cn/"
390
235
  };
391
- const res = await axios2.get(
236
+ const res = await axios.get(
392
237
  `https://app.c.nf.migu.cn/strategy/pc/listen/v2.0?contentId=${contentId}&copyrightId=${copyrightId}&scene=&netType=01&resourceType=2&toneFlag=${toneFlag}`,
393
238
  {
394
239
  headers,
@@ -401,20 +246,20 @@ var SECURE = "Jk8qzuePiJ1qE3mDYhLQ3T73DtDoAhLP";
401
246
  var aw = 171;
402
247
  var iw = 205;
403
248
  var ow = 1;
404
- function textEncode(e2) {
405
- return new TextEncoder().encode(e2);
249
+ function textEncode(e) {
250
+ return new TextEncoder().encode(e);
406
251
  }
407
- function textDecode(e2) {
408
- return new TextDecoder("utf-8").decode(e2);
252
+ function textDecode(e) {
253
+ return new TextDecoder("utf-8").decode(e);
409
254
  }
410
- function decryptBlob(e2, r) {
255
+ function decryptBlob(e, r) {
411
256
  if (r.length == 0)
412
257
  return null;
413
- var n = e2.length;
414
- if (n < 4 || !(e2[0] == aw && e2[1] == iw) || e2[2] != ow)
258
+ var n = e.length;
259
+ if (n < 4 || !(e[0] == aw && e[1] == iw) || e[2] != ow)
415
260
  return null;
416
- for (var t = e2[3], a = textEncode(r), i = a.length, o = new Uint8Array(n - 4), s = 0, c = 4; c < n; c++, s++)
417
- o[s] = e2[c] + t - a[s % i];
261
+ for (var t = e[3], a = textEncode(r), i = a.length, o = new Uint8Array(n - 4), s = 0, c = 4; c < n; c++, s++)
262
+ o[s] = e[c] + t - a[s % i];
418
263
  return o;
419
264
  }
420
265
  function decryptData(buf) {
@@ -422,14 +267,14 @@ function decryptData(buf) {
422
267
  try {
423
268
  const data = p ? JSON.parse(p) : null;
424
269
  return data;
425
- } catch (e2) {
270
+ } catch (e) {
426
271
  return null;
427
272
  }
428
273
  ;
429
274
  }
430
275
 
431
276
  // src/modules/url_h5v2.4.ts
432
- import axios3 from "axios";
277
+ import axios2 from "axios";
433
278
  var getUrlH5V24 = async (contentId, copyrightId, toneFlag = "PQ") => {
434
279
  const headers = {
435
280
  "birth": "h5page",
@@ -438,7 +283,7 @@ var getUrlH5V24 = async (contentId, copyrightId, toneFlag = "PQ") => {
438
283
  "location-data": "30.6698676660,104.1229614820",
439
284
  "location-info": ""
440
285
  };
441
- const res = await axios3.get(
286
+ const res = await axios2.get(
442
287
  `https://c.musicapp.migu.cn/strategy/listen-url/h5/v2.4?contentId=${contentId}&copyrightId=${copyrightId}&resourceType=2&netType=01&toneFlag=PQ&scene=&lowerQualityContentId=${contentId}`,
443
288
  {
444
289
  headers,
@@ -454,8 +299,8 @@ var getUrlH5V24 = async (contentId, copyrightId, toneFlag = "PQ") => {
454
299
  return data;
455
300
  };
456
301
  var SECURE2 = ["Jk8qzuePiJ1qE3mDYhLQ3T73DtDoAhLP"];
457
- function strToUtf8Bytes(e2) {
458
- return new TextEncoder().encode(e2);
302
+ function strToUtf8Bytes(e) {
303
+ return new TextEncoder().encode(e);
459
304
  }
460
305
  function utf8Bytes2str(bytes) {
461
306
  const result = [];
@@ -469,18 +314,18 @@ function utf8Bytes2str(bytes) {
469
314
  }
470
315
  return decodeURIComponent(result.join(""));
471
316
  }
472
- function decode(e2, t) {
317
+ function decode(e, t) {
473
318
  if (0 == t.length)
474
319
  return null;
475
- var n = e2.length;
320
+ var n = e.length;
476
321
  if (n < 4)
477
322
  return null;
478
- if (171 != e2[0] || 205 != e2[1])
323
+ if (171 != e[0] || 205 != e[1])
479
324
  return null;
480
- if (1 != e2[2])
325
+ if (1 != e[2])
481
326
  return null;
482
- for (var r = e2[3], o = strToUtf8Bytes(t), a = o.length, i = new Uint8Array(n - 4), s = 0, c = 4; c < n; c++, s++)
483
- i[s] = e2[c] + r - o[s % a];
327
+ for (var r = e[3], o = strToUtf8Bytes(t), a = o.length, i = new Uint8Array(n - 4), s = 0, c = 4; c < n; c++, s++)
328
+ i[s] = e[c] + r - o[s % a];
484
329
  return i;
485
330
  }
486
331
  var decryptData2 = (ab) => {
@@ -522,133 +367,6 @@ var getMvHls = async (mvContentId, mvCopyrightId, url, size, format = "050012",
522
367
  );
523
368
  };
524
369
 
525
- // src/modules/login_np.ts
526
- import axios4 from "axios";
527
-
528
- // src/utils/rsalib.ts
529
- import crypto from "crypto";
530
- function hexToBase64Url(hex) {
531
- const buffer = Buffer.from(hex, "hex");
532
- return buffer.toString("base64url");
533
- }
534
- var RSAKey = class {
535
- publicKey = null;
536
- setPublic(modulus, exponent) {
537
- try {
538
- const jwkKey = {
539
- kty: "RSA",
540
- n: hexToBase64Url(modulus),
541
- e: hexToBase64Url(exponent)
542
- };
543
- this.publicKey = crypto.createPublicKey({
544
- key: jwkKey,
545
- format: "jwk"
546
- });
547
- } catch (error) {
548
- console.error("Failed to create public key:", error);
549
- this.publicKey = null;
550
- }
551
- }
552
- encrypt(text) {
553
- if (!this.publicKey) {
554
- console.error("Public key not set");
555
- return null;
556
- }
557
- try {
558
- const buffer = Buffer.from(text, "utf-8");
559
- const encrypted = crypto.publicEncrypt(
560
- {
561
- key: this.publicKey,
562
- padding: crypto.constants.RSA_PKCS1_PADDING
563
- },
564
- buffer
565
- );
566
- return encrypted.toString("hex");
567
- } catch (error) {
568
- console.error("RSA encryption failed:", error);
569
- return null;
570
- }
571
- }
572
- };
573
-
574
- // src/utils/publicKey.ts
575
- var getPublicKey = async () => {
576
- const data = await h5fetch(
577
- "https://passport.migu.cn/password/publickey",
578
- {
579
- method: "POST"
580
- }
581
- );
582
- const publicExponent = data.result.publicExponent;
583
- const modulus = data.result.modulus;
584
- return { publicExponent, modulus };
585
- };
586
-
587
- // src/utils/URLParams.ts
588
- function URLParams($) {
589
- const form = new URLSearchParams();
590
- for (const [key, value] of Object.entries($)) {
591
- form.append(key, String(value));
592
- }
593
- return form.toString();
594
- }
595
-
596
- // src/modules/login_np.ts
597
- function randomString() {
598
- const random = Array.from({ length: 32 }, () => Math.floor(Math.random() * 16).toString(16)).join("");
599
- return random.toLowerCase();
600
- }
601
- var loginNP = {
602
- /**
603
- * 账号密码登录
604
- * @param username 用户名
605
- * @param password 密码
606
- * @returns 登录成功后的 pacmtoken
607
- */
608
- async authn(username, password) {
609
- var $ = {
610
- "isAsync": true,
611
- "enpassword": "",
612
- "captcha": "",
613
- "appType": "0",
614
- "loginID": "",
615
- "relayState": "",
616
- "sourceID": "220029",
617
- "imgcodeType": "1",
618
- "fingerPrint": "",
619
- "fingerPrintDetail": ""
620
- };
621
- const p = await getPublicKey();
622
- const { publicExponent, modulus } = p || {};
623
- if (!modulus || !publicExponent) {
624
- return { error: "\u83B7\u53D6\u516C\u94A5\u5931\u8D25" };
625
- }
626
- var rsa = new RSAKey();
627
- rsa.setPublic(modulus, publicExponent);
628
- const rsa_pwd = rsa.encrypt(password);
629
- const rsa_username = rsa.encrypt(username);
630
- const fakeFingerprint = randomString();
631
- $.fingerPrint = fakeFingerprint;
632
- $.fingerPrintDetail = fakeFingerprint;
633
- $.enpassword = rsa_pwd || "";
634
- $.loginID = rsa_username || "";
635
- const form = URLParams($);
636
- const res = await axios4.post(
637
- `https://passport.migu.cn/authn`,
638
- form,
639
- {
640
- headers: {
641
- "Host": "passport.migu.cn",
642
- "Content-Type": "application/x-www-form-urlencoded",
643
- "Referer": "https://passport.migu.cn/login",
644
- "Origin": "https://passport.migu.cn"
645
- }
646
- }
647
- );
648
- return res.data;
649
- }
650
- };
651
-
652
370
  // src/modules/passport_checkToken.ts
653
371
  var checkToken = async (token = "") => {
654
372
  return await h5fetch(
@@ -724,91 +442,6 @@ var getTodayRecommend = async (pacmtoken) => {
724
442
  return { data, newPacmToken: cookies.pacmtoken || "" };
725
443
  };
726
444
 
727
- // src/modules/login_sim.ts
728
- import axios5 from "axios";
729
- function randomString2() {
730
- const random = Array.from({ length: 32 }, () => Math.floor(Math.random() * 16).toString(16)).join("");
731
- return random.toLowerCase();
732
- }
733
- var loginSim = {
734
- async simSend(phone) {
735
- var $;
736
- $ = {
737
- "isAsync": true,
738
- "sim": "1",
739
- "encMsisdn": "",
740
- "appType": "0",
741
- "relayState": "",
742
- "sourceID": "220029",
743
- "fingerPrint": "",
744
- "fingerPrintDetail": ""
745
- };
746
- const p = await getPublicKey();
747
- const { publicExponent, modulus } = p || {};
748
- if (!modulus || !publicExponent) {
749
- return { error: "\u83B7\u53D6\u516C\u94A5\u5931\u8D25" };
750
- }
751
- const rsa = new RSAKey();
752
- rsa.setPublic(modulus, publicExponent);
753
- const encPhone = rsa.encrypt(phone);
754
- const fakeFingerprint = randomString2();
755
- $.fingerPrint = fakeFingerprint;
756
- $.fingerPrintDetail = fakeFingerprint;
757
- $.encMsisdn = encPhone || "";
758
- const form = URLParams($);
759
- const send = await axios5.post(
760
- `https://passport.migu.cn/api/simauth/send`,
761
- form,
762
- {
763
- headers: {
764
- "Host": "passport.migu.cn",
765
- "Content-Type": "application/x-www-form-urlencoded",
766
- "Referer": "https://passport.migu.cn/login",
767
- "Origin": "https://passport.migu.cn"
768
- }
769
- }
770
- );
771
- const sendbody = send.data;
772
- if (!sendbody && sendbody.status != "2000") {
773
- return { error: sendbody };
774
- }
775
- const sim_sessionid = sendbody.result.sim_sessionid || "";
776
- if (!sim_sessionid) return { error: "sim_sessionid e" };
777
- return { sim_sessionid };
778
- },
779
- async simQuery(sim_sessionid) {
780
- const $ = {
781
- "isAsync": true,
782
- "sim_sessionid": sim_sessionid,
783
- "sourceID": "220029"
784
- };
785
- const form = URLParams($);
786
- const query = await axios5.post(
787
- `https://passport.migu.cn/api/simauth/query`,
788
- form,
789
- {
790
- method: "POST",
791
- headers: {
792
- "Host": "passport.migu.cn",
793
- "Content-Type": "application/x-www-form-urlencoded",
794
- "Referer": "https://passport.migu.cn/login",
795
- "Origin": "https://passport.migu.cn"
796
- }
797
- }
798
- );
799
- const querybody = query.data;
800
- if (querybody.status == "4071") {
801
- return { error: "waiting", body: querybody };
802
- } else if (querybody.status == "2000") {
803
- const token = querybody?.result?.token || "";
804
- const status = querybody?.status || "";
805
- return { token, status };
806
- } else {
807
- return { error: querybody.status, body: querybody };
808
- }
809
- }
810
- };
811
-
812
445
  // src/modules/user_collect_list.ts
813
446
  var getUserCollectList = async (pacmtoken, page = 1, size = 20) => {
814
447
  const { data, cookies } = await ckfetch(`https://app.c.nf.migu.cn/user/h5/user/collection/v1.0?pageNo=${page}&type=1&OPType=03&pageSize=${size}&resourceType=2021`, {
@@ -844,279 +477,6 @@ var getSimilarSongRecommend = async (contentId = "") => {
844
477
  );
845
478
  };
846
479
 
847
- // src/modules/login_oneclick.ts
848
- import axios6 from "axios";
849
- import crypto2 from "crypto";
850
- var nav = {
851
- "platform": "iPhone",
852
- "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6 Mobile/15E148 Safari/604.1",
853
- "appVersion": "5.0 (iPhone; CPU iPhone OS 17_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6 Mobile/15E148 Safari/604.1",
854
- "cookieEnabled": true,
855
- "empty": null,
856
- "hardwareConcurrency": 6,
857
- "language": "zh-CN",
858
- "plugins": "",
859
- "availWidth": 390,
860
- "availHeight": 844,
861
- "colorDepth": 24,
862
- "timezoneOffset": -480
863
- };
864
- var YDRZ = {
865
- "optparams": {
866
- "uuid": "",
867
- "msgId": "",
868
- "traceId": "",
869
- "businessType": "10",
870
- "appId": "",
871
- "timestamp": yTime(),
872
- "isimge": false,
873
- "expandParams": "",
874
- "userInformations": "",
875
- "CMRequestApi": ""
876
- },
877
- randomString(len, range = 32) {
878
- var i, bite = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), list = [];
879
- for (i = 0; i < len; i++)
880
- list[i] = bite[0 | Math.random() * range];
881
- return list.join("");
882
- },
883
- randomRange(min, max) {
884
- return Math.floor(Math.random() * (min - max) + max);
885
- },
886
- getUA() {
887
- const ua = nav.userAgent, l = [
888
- nav.platform,
889
- ua,
890
- nav.appVersion,
891
- nav.cookieEnabled,
892
- void 0,
893
- nav.hardwareConcurrency,
894
- nav.language,
895
- nav.plugins,
896
- nav.availWidth,
897
- nav.availHeight,
898
- nav.colorDepth,
899
- nav.timezoneOffset
900
- ], key = l.join("@@"), finalUA = ua.length > 100 ? ua.substring(0, 100) : ua;
901
- return nav.platform + "@@" + finalUA + "@@" + md5(key);
902
- },
903
- uaE(str) {
904
- var b, c, d, r4, r1, r2, r3, result = "", bite = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", i = 0;
905
- for (; i < str.length; )
906
- r4 = (b = str.charCodeAt(i++)) >> 2, r1 = (3 & b) << 4 | (c = str.charCodeAt(i++)) >> 4, r2 = (15 & c) << 2 | (d = str.charCodeAt(i++)) >> 6, r3 = 63 & d, isNaN(c) ? r2 = r3 = 64 : isNaN(d) && (r3 = 64), result = result + bite.charAt(r4) + bite.charAt(r1) + bite.charAt(r2) + bite.charAt(r3);
907
- return result;
908
- },
909
- getUserInfo() {
910
- return encodeURIComponent(this.uaE(this.getUA()));
911
- },
912
- getSign(appID, version) {
913
- const optparams = this.optparams;
914
- optparams.uuid = this.randomString(32, 32);
915
- optparams.msgId = this.randomString(32, 32);
916
- this.optparams = optparams;
917
- return appID + optparams.msgId + optparams.timestamp + optparams.uuid + version;
918
- },
919
- async getTokenInfo(data) {
920
- const optparams = this.optparams;
921
- const requestData = {
922
- "version": data.version,
923
- "appId": data.appId,
924
- "openType": data.openType,
925
- "expandParams": data.expandParams,
926
- "isTest": data.isTest,
927
- "sign": data.sign,
928
- "getNetworkType": data.getNetworkType,
929
- "getMsisdnMask": data.getMsisdnMask,
930
- "traceId": optparams.uuid,
931
- "msgId": optparams.msgId,
932
- "timestamp": optparams.timestamp,
933
- "uuid": optparams.uuid,
934
- "businessType": optparams.businessType,
935
- "userInformations": this.getUserInfo()
936
- };
937
- const res = await axios6.post(
938
- "https://verify.cmpassport.com/h5/getPreMobile",
939
- requestData,
940
- {
941
- headers: {
942
- "Referer": "https://passport.migu.cn/",
943
- "Origin": "https://passport.migu.cn"
944
- }
945
- }
946
- );
947
- if (!res.data) return;
948
- const json = res.data, token = json?.token || "";
949
- if (!token) return;
950
- return token;
951
- }
952
- };
953
- function yTime() {
954
- const date = /* @__PURE__ */ new Date(), a = [
955
- date.getFullYear(),
956
- date.getMonth() + 1,
957
- date.getDate(),
958
- date.getHours(),
959
- date.getMinutes(),
960
- date.getSeconds(),
961
- date.getMilliseconds()
962
- ];
963
- const f = a.map((t) => {
964
- return t.toString().padStart(2, "0");
965
- });
966
- f[6] = f[6].toString().padStart(3, "0");
967
- return f.join("");
968
- }
969
- function md5(s) {
970
- return crypto2.createHash("md5").update(s, "utf-8").digest("hex");
971
- }
972
- var genInternetSign = async () => {
973
- const time = yTime(), e2 = time, c = "220029", msgId = getDeviceId(), d = msgId;
974
- const preSign = YDRZ.getSign("300012033963", "1.2"), b = preSign;
975
- let key = "interfacename=genInternetSign&sourceid=" + c + "&systemtime=" + e2 + "&msgid=" + d + "&preSign=" + b;
976
- key = encodeURIComponent(key);
977
- const signature = md5(key);
978
- const url = `https://passport.migu.cn/api/genInternetSign?preSign=${preSign}&msgid=${msgId}&systemtime=${time}&sourceid=220029&signature=${signature}`;
979
- const res = await axios6.get(url);
980
- const data = res.data;
981
- if (!data || data.status !== 2e3) return void 0;
982
- const rsaSign = data.result?.rsaSign || "";
983
- return rsaSign;
984
- };
985
- var getSTToken = async (uniToken) => {
986
- const $ = {
987
- "sourceID": "220029",
988
- "appType": 0,
989
- "relayState": "",
990
- "token": uniToken,
991
- "userInformation": YDRZ.getUserInfo(),
992
- "isFirst": 1
993
- };
994
- const form = URLParams($);
995
- const res = await axios6.post(
996
- "https://passport.migu.cn/authn/uniTokenValidate",
997
- {
998
- headers: {
999
- "content-type": "application/x-www-form-urlencoded; charset=UTF-8"
1000
- }
1001
- }
1002
- );
1003
- if (!res.data) return { error: "fetch uni e" };
1004
- const json = res.data, status = json.status?.toString() || "", token = json.result?.token || "", msisdn = json.result?.msisdn || "";
1005
- if (status !== "2000") return { error: "status e" };
1006
- return { token, msisdn, status };
1007
- };
1008
- var authn = async () => {
1009
- const rsaSign = await genInternetSign();
1010
- if (!rsaSign) return { error: "genInternetSign failed" };
1011
- const uniToken = await YDRZ.getTokenInfo({
1012
- version: "1.2",
1013
- appId: "300012033963",
1014
- sign: rsaSign,
1015
- openType: "1",
1016
- expandParams: "",
1017
- isTest: false,
1018
- getNetworkType: "",
1019
- getMsisdnMask: ""
1020
- });
1021
- if (!uniToken) return { error: "getTokenInfo failed" };
1022
- const result = await getSTToken(uniToken);
1023
- if ("error" in result) return result;
1024
- const { token, msisdn, status } = result;
1025
- if (!token) return { error: "no token" };
1026
- if (!msisdn) return { error: "no msisdn" };
1027
- return { token, msisdn, status };
1028
- };
1029
- var loginOneClick = {
1030
- genInternetSign,
1031
- getSTToken,
1032
- authn
1033
- };
1034
-
1035
- // src/modules/login_phone.ts
1036
- import axios7 from "axios";
1037
- function randomString3() {
1038
- const random = Array.from({ length: 32 }, () => Math.floor(Math.random() * 16).toString(16)).join("");
1039
- return random.toLowerCase();
1040
- }
1041
- var loginPhone = {
1042
- //获取验证码
1043
- async getMsgCode(phone) {
1044
- var $ = {
1045
- "isAsync": true,
1046
- "msisdn": "",
1047
- "captcha": "",
1048
- "sourceID": "220029",
1049
- "imgcodeType": "2",
1050
- "fingerPrint": "",
1051
- "fingerPrintDetail": "",
1052
- "_": ""
1053
- };
1054
- const result = await getPublicKey();
1055
- const { publicExponent = "", modulus = "" } = result;
1056
- var c = new RSAKey();
1057
- c.setPublic(modulus, publicExponent);
1058
- $.msisdn = c.encrypt(phone) || "";
1059
- if (!$.msisdn) return { error: "encrypt error" };
1060
- const fakeFingerprint = randomString3();
1061
- $.fingerPrint = fakeFingerprint;
1062
- $.fingerPrintDetail = fakeFingerprint;
1063
- $._ = (/* @__PURE__ */ new Date()).getTime().toString();
1064
- const query = URLParams($);
1065
- const res = await axios7.get(
1066
- `https://passport.migu.cn/login/dynamicpassword?${query}`,
1067
- {
1068
- headers: {
1069
- "Host": "passport.migu.cn",
1070
- "Referer": "https://passport.migu.cn/login",
1071
- "Origin": "https://passport.migu.cn"
1072
- }
1073
- }
1074
- );
1075
- const data = res.data;
1076
- return data;
1077
- },
1078
- //登陆
1079
- async authn(phone, msgCode) {
1080
- var $ = {
1081
- "isAsync": true,
1082
- "msisdn": "",
1083
- "dynamicPassword": "",
1084
- "captcha": "",
1085
- "appType": "",
1086
- "securityCode": "7619",
1087
- "sourceID": "220029",
1088
- "imgcodeType": "2",
1089
- "fingerPrint": "",
1090
- "fingerPrintDetail": ""
1091
- };
1092
- const result = await getPublicKey();
1093
- const { publicExponent = "", modulus = "" } = result;
1094
- var c = new RSAKey();
1095
- c.setPublic(modulus, publicExponent);
1096
- $.msisdn = c.encrypt(phone) || "";
1097
- $.dynamicPassword = c.encrypt(msgCode) || "";
1098
- if (!$.msisdn || !$.dynamicPassword) return { error: "encrypt error" };
1099
- const fakeFingerprint = randomString3();
1100
- $.fingerPrint = fakeFingerprint;
1101
- $.fingerPrintDetail = fakeFingerprint;
1102
- const form = URLParams($);
1103
- const res = await axios7.post(
1104
- `https://passport.migu.cn/authn/dynamicpassword`,
1105
- form,
1106
- {
1107
- headers: {
1108
- "Host": "passport.migu.cn",
1109
- "Content-Type": "application/x-www-form-urlencoded",
1110
- "Referer": "https://passport.migu.cn/login",
1111
- "Origin": "https://passport.migu.cn"
1112
- }
1113
- }
1114
- );
1115
- const data = res.data;
1116
- return data;
1117
- }
1118
- };
1119
-
1120
480
  // src/modules/mv_recommend.ts
1121
481
  var getMVRecommend = async (mvContentId, page = 1) => {
1122
482
  return await h5fetch(`https://c.musicapp.migu.cn/MIGUM3.0/v3.0/content/recommend-mv?resourceId=${mvContentId}&pageNumber=${page}&resourceType=D`);
@@ -1132,29 +492,6 @@ var searchLrc = async (text, page = 1) => {
1132
492
  return await h5fetch(`http://app.c.nf.migu.cn/bmw/search/lrc/v1.0?pageNo=${page}&text=${text}`);
1133
493
  };
1134
494
 
1135
- // src/modules/ninan.ts
1136
- var getNinanSong = async () => await h5fetch(`https://c.musicapp.migu.cn/MIGUM2.0/column/ninan/song-list/v1.0`);
1137
- var getNinanByDate = async (date) => await h5fetch(`https://c.musicapp.migu.cn/MIGUM2.0/v2.0/content/getNinanByDate.do?columnTitle=${date}`);
1138
- var signNinan = async (pacmtoken) => {
1139
- const { data, cookies } = await ckfetch("http://c.musicapp.migu.cn/MIGUM2.0/v2.0/user/sign-reward", {
1140
- cookie: { pacmtoken },
1141
- headers: {
1142
- "location-data": "30.6698676660,104.1229614820",
1143
- "channel": "0146921"
1144
- }
1145
- });
1146
- return { data, newPacmToken: cookies.pacmtoken || "" };
1147
- };
1148
- var getNinanSignInfo = async (pacmtoken) => {
1149
- const { data, cookies } = await ckfetch("http://u.musicapp.migu.cn/MIGUM3.0/user/sign-center/v1.0", {
1150
- cookie: { pacmtoken },
1151
- headers: {
1152
- "channel": "014021I"
1153
- }
1154
- });
1155
- return { data, newPacmToken: cookies.pacmtoken || "" };
1156
- };
1157
-
1158
495
  // src/modules/recommend_radio_all.ts
1159
496
  var getRadioRecommendAll = async (pacmtoken = "") => {
1160
497
  const { data, cookies } = await ckfetch(`https://app.c.nf.migu.cn/pc/bmw/page-data/music-radio/v1.0?templateVersion=1`, {
@@ -1219,193 +556,12 @@ var getVrbtUrl = async (contentIds) => {
1219
556
  };
1220
557
 
1221
558
  // src/modules/lyric.ts
1222
- import axios8 from "axios";
1223
-
1224
- // src/utils/decryptMrc.ts
1225
- var DELTA = 2654435769n;
1226
- var MIN_LENGTH = 32;
1227
- var SPECIAL_CHAR = 48;
1228
- function toLong(num) {
1229
- const MAX = 9223372036854775807n;
1230
- const MIN = -9223372036854775808n;
1231
- if (num > MAX) return toLong(num - (1n << 64n));
1232
- if (num < MIN) return toLong(num + (1n << 64n));
1233
- return num;
1234
- }
1235
- function ToByteArray(data) {
1236
- const arrayList = [];
1237
- for (const j2 of data) {
1238
- const bArrLong2bytes = long2bytes(j2);
1239
- for (let i = 0; i < 8; i++) {
1240
- arrayList.push(bArrLong2bytes[i]);
1241
- }
1242
- }
1243
- while (arrayList[arrayList.length - 1] === SPECIAL_CHAR) {
1244
- arrayList.pop();
1245
- }
1246
- return Buffer.from(arrayList);
1247
- }
1248
- function long2bytes(num) {
1249
- const byteBufferOrder = Buffer.alloc(8);
1250
- byteBufferOrder.writeBigInt64LE(num, 0);
1251
- return byteBufferOrder;
1252
- }
1253
- function PadRight(source, length) {
1254
- let result = source;
1255
- while (result.length < length) {
1256
- result += "0";
1257
- }
1258
- return result;
1259
- }
1260
- function ToLongArray(data) {
1261
- const length = Math.floor(data.length / 16);
1262
- const jArr = new Array(length);
1263
- for (let i = 0; i < length; i++) {
1264
- jArr[i] = toLong(BigInt("0x" + data.substring(i * 16, i * 16 + 16)));
1265
- }
1266
- return jArr;
1267
- }
1268
- function bytes2long(buf, index) {
1269
- return buf.readBigInt64LE(index);
1270
- }
1271
- function ToLongArray2(data_) {
1272
- const bArr = Buffer.alloc(data_.length * 2);
1273
- for (let i = 0; i < data_.length; i++) {
1274
- bArr[i * 2] = data_[i];
1275
- bArr[i * 2 + 1] = 0;
1276
- }
1277
- const length = (bArr.length % 8 === 0 ? 0 : 1) + Math.floor(bArr.length / 8);
1278
- const jArr = new Array(length);
1279
- for (let i2 = 0; i2 < length - 1; i2++) {
1280
- jArr[i2] = bytes2long(bArr, i2 * 8);
1281
- }
1282
- const bArr2 = Buffer.alloc(8);
1283
- let i3 = 0;
1284
- for (let i4 = (length - 1) * 8; i4 < bArr.length; i4++) {
1285
- bArr2[i3] = bArr[i4];
1286
- i3++;
1287
- }
1288
- jArr[length - 1] = bytes2long(bArr2, 0);
1289
- return jArr;
1290
- }
1291
- function TEADecrypt(data, key) {
1292
- const length = data.length;
1293
- if (length >= 1) {
1294
- let j3 = data[0];
1295
- let j4 = toLong(
1296
- (6n + BigInt(Math.floor(52 / length))) * DELTA
1297
- );
1298
- while (true) {
1299
- const j5 = j4;
1300
- if (j5 === 0n) {
1301
- break;
1302
- }
1303
- const j6 = toLong(3n & j5 >> 2n);
1304
- let j7 = length;
1305
- while (true) {
1306
- j7--;
1307
- if (j7 > 0) {
1308
- const j8 = data[j7 - 1];
1309
- const i = j7;
1310
- j3 = toLong(
1311
- data[i] - toLong(
1312
- toLong(
1313
- toLong(j3 ^ j5) + toLong(j8 ^ key[Number(toLong(3n & BigInt(j7) ^ j6))])
1314
- ) ^ toLong(
1315
- toLong(
1316
- toLong(j8 >> 5n) ^ toLong(j3 << 2n)
1317
- ) + toLong(
1318
- toLong(j3 >> 3n) ^ toLong(j8 << 4n)
1319
- )
1320
- )
1321
- )
1322
- );
1323
- data[i] = j3;
1324
- } else {
1325
- break;
1326
- }
1327
- }
1328
- const j9 = data[length - 1];
1329
- j3 = toLong(
1330
- data[0] - toLong(
1331
- toLong(
1332
- toLong(key[Number(toLong(BigInt(j7) & 3n ^ j6))] ^ j9) + toLong(j3 ^ j5)
1333
- ) ^ toLong(
1334
- toLong(
1335
- toLong(j9 >> 5n) ^ toLong(j3 << 2n)
1336
- ) + toLong(
1337
- toLong(j3 >> 3n) ^ toLong(j9 << 4n)
1338
- )
1339
- )
1340
- )
1341
- );
1342
- data[0] = j3;
1343
- j4 = toLong(j5 - DELTA);
1344
- }
1345
- }
1346
- return data;
1347
- }
1348
- function decryptMrc(data) {
1349
- if (data == null || data.length < MIN_LENGTH) return data;
1350
- const decrypted = TEADecrypt(
1351
- ToLongArray(data),
1352
- ToLongArray2(Buffer.from(PadRight("karakal@123Qcomyidongtiantianhaoting", MIN_LENGTH), "utf8"))
1353
- );
1354
- return ToByteArray(decrypted).toString("utf16le");
1355
- }
1356
- function toWordTime(times) {
1357
- const type = times.startsWith("(") ? 1 : times.startsWith("[") ? 2 : 0;
1358
- times = times.replace(/[()\[\]]/g, "").trim();
1359
- const time = Number(times.split(",")[0]);
1360
- const mm = Math.floor(time / 6e4).toString().padStart(2, "0");
1361
- const ss = Math.floor(time / 1e3 % 60).toString().padStart(2, "0");
1362
- const ms = Math.floor(time % 1e3).toString().padStart(3, "0");
1363
- if (type === 1) {
1364
- return `[${mm}:${ss}.${ms}]`;
1365
- } else {
1366
- return times;
1367
- }
1368
- }
1369
- function formatMrc(data) {
1370
- const line = data.split("\n");
1371
- const formattedData = line.reduce((prev, cur, index) => {
1372
- cur = cur.trim();
1373
- if (cur === "") return prev;
1374
- if (!"1234567890".split("").includes(String(cur[1]))) {
1375
- prev.push(cur);
1376
- return prev;
1377
- }
1378
- cur = cur.replace(/\[[^\]]*\]/g, "");
1379
- let nextIndex = 0, partStart = 0;
1380
- let lineStr = "";
1381
- while (true) {
1382
- if (nextIndex === -1) break;
1383
- const leftPos = cur.indexOf("(", nextIndex);
1384
- if (leftPos === -1) break;
1385
- const rightPos = cur.indexOf(")", leftPos);
1386
- if (rightPos === -1) break;
1387
- const time = cur.substring(leftPos, rightPos + 1);
1388
- const word = cur.substring(partStart, leftPos);
1389
- if (!!word && !!time) {
1390
- partStart = rightPos + 1;
1391
- nextIndex = rightPos + 1;
1392
- } else {
1393
- break;
1394
- }
1395
- lineStr += `${toWordTime(time)}${word}`;
1396
- }
1397
- prev.push(lineStr + "\n");
1398
- return prev;
1399
- }, []);
1400
- return formattedData.join("");
1401
- }
1402
-
1403
- // src/modules/lyric.ts
559
+ import axios3 from "axios";
1404
560
  var getLyric = async (contentId, type = "lrc") => {
1405
561
  if (contentId === "") return { error: "contentId is empty!", success: false };
1406
562
  const types = type.split(",");
1407
563
  if (types.length === 0) return { error: "types is empty!", success: false };
1408
- const res = await axios8.get(`https://app.u.nf.migu.cn/MIGUM2.0/v1.0/content/resourceinfo.do?resourceId=${contentId}&resourceType=2`);
564
+ const res = await axios3.get(`https://app.u.nf.migu.cn/MIGUM2.0/v1.0/content/resourceinfo.do?resourceId=${contentId}&resourceType=2`);
1409
565
  const code = res.data.code.toString() || "";
1410
566
  const data = res.data.resource[0] || {};
1411
567
  if (code !== "000000") return {
@@ -1414,11 +570,11 @@ var getLyric = async (contentId, type = "lrc") => {
1414
570
  error: res.data.info || res.data
1415
571
  };
1416
572
  if (data.length === 0) return { error: "data.length = 0 !", success: false, data };
1417
- let lrc, lrcUrl, mrc, mrcUrl, trc, trcUrl;
573
+ let lrc, lrcUrl, trc, trcUrl;
1418
574
  if (types.includes("lrc")) {
1419
575
  lrcUrl = data.lrcUrl || "";
1420
576
  if (lrcUrl !== "") {
1421
- const lrcRes = await axios8.get(lrcUrl);
577
+ const lrcRes = await axios3.get(lrcUrl);
1422
578
  if (lrcRes.status === 200) {
1423
579
  lrc = lrcRes.data || "";
1424
580
  }
@@ -1427,27 +583,16 @@ var getLyric = async (contentId, type = "lrc") => {
1427
583
  if (types.includes("trc")) {
1428
584
  trcUrl = data.trcUrl || "";
1429
585
  if (trcUrl !== "") {
1430
- const trcRes = await axios8.get(trcUrl);
586
+ const trcRes = await axios3.get(trcUrl);
1431
587
  if (trcRes.status === 200) {
1432
588
  trc = trcRes.data || "";
1433
589
  }
1434
590
  }
1435
591
  }
1436
- if (types.includes("mrc")) {
1437
- mrcUrl = data.mrcUrl || "";
1438
- if (mrcUrl !== "") {
1439
- const mrcRes = await axios8.get(mrcUrl);
1440
- if (mrcRes.status === 200) {
1441
- mrc = formatMrc(decryptMrc(mrcRes.data || ""));
1442
- }
1443
- }
1444
- }
1445
592
  return {
1446
593
  success: true,
1447
594
  lrc,
1448
595
  lrcUrl,
1449
- mrc,
1450
- mrcUrl,
1451
596
  trc,
1452
597
  trcUrl
1453
598
  };
@@ -1704,10 +849,10 @@ var matchPlaylist = async (url) => {
1704
849
  };
1705
850
 
1706
851
  // src/modules/url_redirect.ts
1707
- import axios9 from "axios";
852
+ import axios4 from "axios";
1708
853
  var getRedirectUrl = async (contentId, toneFlag = "PQ", copyrightId, isVip = true) => {
1709
854
  if (isVip && (!copyrightId || copyrightId === "0")) return "";
1710
- return await axios9.head(
855
+ return await axios4.head(
1711
856
  isVip ? `https://c.musicapp.migu.cn/strategy/listen-song/v2.3` : `https://app.pd.nf.migu.cn/MIGUM2.0/v1.0/content/sub/listenSong.do`,
1712
857
  {
1713
858
  maxRedirects: 0,
@@ -2126,14 +1271,14 @@ var getThumbsMsg = async (pacmtoken, page = 1, size = 10) => {
2126
1271
  };
2127
1272
 
2128
1273
  // src/modules/cloud_upload.ts
2129
- import crypto3 from "crypto";
1274
+ import crypto from "crypto";
2130
1275
  function getExt(file) {
2131
1276
  const index = file.name.lastIndexOf(".");
2132
1277
  if (index <= 0) return "";
2133
1278
  return file.name.substring(index + 1).toLowerCase();
2134
1279
  }
2135
1280
  async function getHash(file) {
2136
- const hash = crypto3.createHash("md5");
1281
+ const hash = crypto.createHash("md5");
2137
1282
  const reader = file.stream().getReader();
2138
1283
  while (true) {
2139
1284
  const { done, value } = await reader.read();
@@ -2191,47 +1336,6 @@ var getSingerMv = async (singerId, page) => {
2191
1336
  return await h5fetch(`https://app.c.nf.migu.cn/bmw/singer/video/v1.0?pageNo=${page || 1}&singerId=${singerId}`);
2192
1337
  };
2193
1338
 
2194
- // src/modules/ai-bean.ts
2195
- var signAiBean = async (pacmtoken) => {
2196
- const { data, cookies } = await ckfetch("https://app.c.nf.migu.cn/act-jbzx/sign", {
2197
- method: "POST",
2198
- cookie: { pacmtoken },
2199
- headers: {
2200
- "location-data": "30.6698676660,104.1229614820",
2201
- "channel": "0146921",
2202
- "activityId": "MAC_KF_CBH_JBZX",
2203
- "Referer": "https://h5.nf.migu.cn"
2204
- }
2205
- });
2206
- return { data, newPacmToken: cookies.pacmtoken || "" };
2207
- };
2208
- var getAiBeanCount = async (pacmtoken) => {
2209
- const { data, cookies } = await ckfetch("https://app.c.nf.migu.cn/act-jbzx/ai-bean/query-available", {
2210
- cookie: { pacmtoken },
2211
- headers: {
2212
- "activityId": "MAC_KF_CBH_JBZX"
2213
- }
2214
- });
2215
- return { data, newPacmToken: cookies.pacmtoken || "" };
2216
- };
2217
- var getAiBeanSignStatus = async (pacmtoken) => {
2218
- const { data, cookies } = await ckfetch("https://app.c.nf.migu.cn/act-jbzx/sign/status", {
2219
- cookie: { pacmtoken },
2220
- headers: {
2221
- "channel": "0146921",
2222
- "activityId": "MAC_KF_CBH_JBZX"
2223
- }
2224
- });
2225
- return { data, newPacmToken: cookies.pacmtoken || "" };
2226
- };
2227
- var redeemAiBean = async (pacmtoken) => {
2228
- const { data, cookies } = await ckfetch("https://app.c.nf.m-jbzx/member-jbzx/member/redeem", {
2229
- method: "POST",
2230
- cookie: { pacmtoken }
2231
- });
2232
- return { data, newPacmToken: cookies.pacmtoken || "" };
2233
- };
2234
-
2235
1339
  // src/modules/cloud_dl.ts
2236
1340
  var getCloudDLUrl = async (pacmtoken, contentId, toneFlag = "PQ") => {
2237
1341
  const { data, cookies } = await ckfetch("https://app.c.nf.migu.cn/MIGUM3.0/strategy/cloud/download-url/v1.0", {
@@ -2319,11 +1423,6 @@ var getSongInfo = async (contentIds) => {
2319
1423
  return await h5fetch(`https://app.c.nf.migu.cn/resource/song/by-contentids/v2.0?contentId=${contentIds}`);
2320
1424
  };
2321
1425
 
2322
- // src/modules/activities.ts
2323
- var getActivities = async () => {
2324
- return await h5fetch(`https://app.u.nf.migu.cn/MIGUM3.0/v1.0/template/index-activity/release`);
2325
- };
2326
-
2327
1426
  // src/modules/user_ordered.ts
2328
1427
  var getUserOrdered = async (pacmtoken) => {
2329
1428
  if (!pacmtoken) return { data: { success: false, code: "290001", info: "\u8BF7\u5148\u767B\u5F55" }, newPacmToken: void 0 };
@@ -2352,7 +1451,6 @@ var getDAlbumPay = async (dAlbumId) => {
2352
1451
  );
2353
1452
  };
2354
1453
  export {
2355
- YDRZ,
2356
1454
  addFollower,
2357
1455
  addSongToMyList,
2358
1456
  addUserCollect,
@@ -2364,9 +1462,6 @@ export {
2364
1462
  dislikeSong,
2365
1463
  editUserMyList,
2366
1464
  emojiAction,
2367
- getActivities,
2368
- getAiBeanCount,
2369
- getAiBeanSignStatus,
2370
1465
  getAlbumInfo,
2371
1466
  getAlbumSong,
2372
1467
  getCloudDLUrl,
@@ -2398,9 +1493,6 @@ export {
2398
1493
  getMvInfo,
2399
1494
  getNewCDList,
2400
1495
  getNewSongList,
2401
- getNinanByDate,
2402
- getNinanSignInfo,
2403
- getNinanSong,
2404
1496
  getNoticeMsg,
2405
1497
  getOpNum,
2406
1498
  getPacmToken,
@@ -2462,14 +1554,9 @@ export {
2462
1554
  getVrbtUrl,
2463
1555
  isFollowAuthor,
2464
1556
  likeSong,
2465
- loginNP,
2466
- loginOneClick,
2467
- loginPhone,
2468
- loginSim,
2469
1557
  logout,
2470
1558
  matchPlaylist,
2471
1559
  queryUserInfo,
2472
- redeemAiBean,
2473
1560
  removeFollower,
2474
1561
  removeSongFromMyList,
2475
1562
  removeUserCollect,
@@ -2486,8 +1573,6 @@ export {
2486
1573
  searchSuggest,
2487
1574
  searchTicket,
2488
1575
  shareCommon,
2489
- shareVideo,
2490
- signAiBean,
2491
- signNinan
1576
+ shareVideo
2492
1577
  };
2493
- //# sourceMappingURL=index.js.map
1578
+ //# sourceMappingURL=index.mjs.map