@rexnow/netease-music 0.0.0-stage → 0.1.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.
@@ -0,0 +1,2725 @@
1
+ let e = [
2
+ "MUSIC_U",
3
+ "__csrf",
4
+ "NMTID"
5
+ ];
6
+ function t(e) {
7
+ return e.replace(/'\\''/g, "'").trim();
8
+ }
9
+ function i(e) {
10
+ return e.replace(/\\(["\\])/g, "$1").trim();
11
+ }
12
+ function r(e) {
13
+ return Object.entries(e).filter(([e, t])=>!!(e && t)).map(([e, t])=>`${e}=${t}`).join("; ");
14
+ }
15
+ function l(e) {
16
+ let l = (e || "").trim();
17
+ if (!l) return {
18
+ cookieHeader: "",
19
+ cookies: {},
20
+ hasMusicU: !1
21
+ };
22
+ let n = l;
23
+ /(?:^|\s)(?:curl\s+\^"|(?:-H|--header|-b|--cookie)\s+\^")/i.test(n) && (n = n.replace(/\^\r?\n/g, " ").replace(/\^([\s\S])/g, "$1"));
24
+ let a = "", o = /(?:^|[\s\\])(?:-b|--cookie)\s+'((?:[^']|'\\'')*)'/.exec(n);
25
+ if ((null == o ? void 0 : o[1]) && (a = t(o[1])), !a) {
26
+ let e = /(?:^|[\s\\])(?:-b|--cookie)\s+"((?:[^"\\]|\\.)*)"/.exec(n);
27
+ (null == e ? void 0 : e[1]) && (a = i(e[1]));
28
+ }
29
+ if (a || (a = function(e, r) {
30
+ let l = r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), n = RegExp(`(?:^|[\\s\\\\])(?:-H|--header)\\s+'${l}:\\s*((?:[^']|'\\\\'')*)'`, "i").exec(e);
31
+ if (null == n ? void 0 : n[1]) return t(n[1]);
32
+ let a = RegExp(`(?:^|[\\s\\\\])(?:-H|--header)\\s+"${l}:\\s*((?:[^"\\\\]|\\\\.)*)"`, "i").exec(e);
33
+ if (null == a ? void 0 : a[1]) return i(a[1]);
34
+ let o = RegExp(`"${l}"\\s*:\\s*"((?:[^"\\\\]|\\\\.)*)"`, "i").exec(e);
35
+ if (null == o ? void 0 : o[1]) return i(o[1]);
36
+ let s = RegExp(`^\\s*${l}:\\s*(.+)$`, "im").exec(e);
37
+ return (null == s ? void 0 : s[1]) ? s[1].trim() : "";
38
+ }(n, "cookie")), !a && !/^\s*(?:curl\s+|fetch\s*\()/i.test(n)) {
39
+ let e = n.replace(/\r?\n+/g, "; ").trim();
40
+ a = !e.includes("=") && !e.includes(";") && /^[A-Za-z0-9._-]{32,}$/.test(e) ? `MUSIC_U=${e}` : e;
41
+ }
42
+ let s = function(e) {
43
+ let t = {};
44
+ if (!e) return t;
45
+ for (let i of e.split(";")){
46
+ let e = i.indexOf("=");
47
+ if (e <= 0) continue;
48
+ let r = i.slice(0, e).trim(), l = i.slice(e + 1).trim();
49
+ !r || !l || /[\r\n]/.test(r) || /[\r\n]/.test(l) || (t[r] = l);
50
+ }
51
+ return t;
52
+ }(a);
53
+ return {
54
+ cookieHeader: r(s),
55
+ cookies: s,
56
+ hasMusicU: !!s.MUSIC_U
57
+ };
58
+ }
59
+ function n(t, i = Date.now()) {
60
+ let r = {}, l = [];
61
+ if (!t) return {
62
+ updates: r,
63
+ deletes: l
64
+ };
65
+ let a = "";
66
+ for (let [e, i] of Object.entries(t))"set-cookie" === e.toLowerCase() && "string" == typeof i && (a = a ? `${a}, ${i}` : i);
67
+ if (!a) return {
68
+ updates: r,
69
+ deletes: l
70
+ };
71
+ for (let t of function(e) {
72
+ if (!e) return [];
73
+ let t = [], i = 0, r = !1;
74
+ for(let l = 0; l < e.length; l++){
75
+ let n = e[l];
76
+ if (";" === n) {
77
+ let t = e.slice(l + 1).trimStart();
78
+ r = /^expires\s*=/i.test(t);
79
+ } else if ("," === n) {
80
+ if (r) {
81
+ r = !1;
82
+ continue;
83
+ }
84
+ let n = e.slice(i, l).trim();
85
+ n && t.push(n), i = l + 1;
86
+ }
87
+ }
88
+ let l = e.slice(i).trim();
89
+ return l && t.push(l), t;
90
+ }(a)){
91
+ var o;
92
+ let n = t.split(";"), a = (null == (o = n[0]) ? void 0 : o.trim()) || "", s = a.indexOf("=");
93
+ if (s <= 0) continue;
94
+ let u = a.slice(0, s).trim();
95
+ if (!e.includes(u)) continue;
96
+ let d = a.slice(s + 1).trim(), c = !d;
97
+ for (let e of n.slice(1)){
98
+ let t = e.trim(), r = /^max-age\s*=\s*(-?\d+)$/i.exec(t);
99
+ (null == r ? void 0 : r[1]) && 0 >= Number(r[1]) && (c = !0);
100
+ let l = /^expires\s*=\s*(.+)$/i.exec(t);
101
+ if (null == l ? void 0 : l[1]) {
102
+ let e = Date.parse(l[1]);
103
+ Number.isFinite(e) && e <= i && (c = !0);
104
+ }
105
+ }
106
+ if (c) delete r[u], l.includes(u) || l.push(u);
107
+ else {
108
+ r[u] = d;
109
+ let e = l.indexOf(u);
110
+ e >= 0 && l.splice(e, 1);
111
+ }
112
+ }
113
+ return {
114
+ updates: r,
115
+ deletes: l
116
+ };
117
+ }
118
+ let a = "https://music.163.com", o = "e82ckenh8dichen8", s = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36", u = {
119
+ osver: "Microsoft-Windows-10-Professional-build-19045-64bit",
120
+ os: "pc",
121
+ appver: "3.1.17.204416",
122
+ versioncode: "140",
123
+ resolution: "1920x1080",
124
+ channel: "netease"
125
+ }, d = `Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Safari/537.36 Chrome/91.0.4472.164 NeteaseMusicDesktop/${u.appver}`, c = {
126
+ standard: 128000,
127
+ higher: 192000,
128
+ exhigh: 320000,
129
+ lossless: 999000,
130
+ hires: 999000
131
+ }, p = {
132
+ ALL: 0,
133
+ ZH: 7,
134
+ EA: 96,
135
+ KR: 16,
136
+ JP: 8
137
+ }, f = {
138
+ songs: 1,
139
+ albums: 10,
140
+ artists: 100,
141
+ playlists: 1000
142
+ }, m = [
143
+ {
144
+ id: "华语",
145
+ title: "华语",
146
+ subtitle: "语种"
147
+ },
148
+ {
149
+ id: "欧美",
150
+ title: "欧美",
151
+ subtitle: "语种"
152
+ },
153
+ {
154
+ id: "日语",
155
+ title: "日语",
156
+ subtitle: "语种"
157
+ },
158
+ {
159
+ id: "韩语",
160
+ title: "韩语",
161
+ subtitle: "语种"
162
+ },
163
+ {
164
+ id: "粤语",
165
+ title: "粤语",
166
+ subtitle: "语种"
167
+ },
168
+ {
169
+ id: "流行",
170
+ title: "流行",
171
+ subtitle: "风格"
172
+ },
173
+ {
174
+ id: "摇滚",
175
+ title: "摇滚",
176
+ subtitle: "风格"
177
+ },
178
+ {
179
+ id: "民谣",
180
+ title: "民谣",
181
+ subtitle: "风格"
182
+ },
183
+ {
184
+ id: "电子",
185
+ title: "电子",
186
+ subtitle: "风格"
187
+ },
188
+ {
189
+ id: "说唱",
190
+ title: "说唱",
191
+ subtitle: "风格"
192
+ },
193
+ {
194
+ id: "轻音乐",
195
+ title: "轻音乐",
196
+ subtitle: "风格"
197
+ },
198
+ {
199
+ id: "爵士",
200
+ title: "爵士",
201
+ subtitle: "风格"
202
+ },
203
+ {
204
+ id: "古典",
205
+ title: "古典",
206
+ subtitle: "风格"
207
+ },
208
+ {
209
+ id: "古风",
210
+ title: "古风",
211
+ subtitle: "风格"
212
+ },
213
+ {
214
+ id: "R&B/Soul",
215
+ title: "R&B/Soul",
216
+ subtitle: "风格"
217
+ },
218
+ {
219
+ id: "ACG",
220
+ title: "ACG",
221
+ subtitle: "主题"
222
+ },
223
+ {
224
+ id: "影视原声",
225
+ title: "影视原声",
226
+ subtitle: "主题"
227
+ },
228
+ {
229
+ id: "游戏",
230
+ title: "游戏",
231
+ subtitle: "主题"
232
+ },
233
+ {
234
+ id: "怀旧",
235
+ title: "怀旧",
236
+ subtitle: "情感"
237
+ },
238
+ {
239
+ id: "治愈",
240
+ title: "治愈",
241
+ subtitle: "情感"
242
+ },
243
+ {
244
+ id: "夜晚",
245
+ title: "夜晚",
246
+ subtitle: "场景"
247
+ },
248
+ {
249
+ id: "学习",
250
+ title: "学习",
251
+ subtitle: "场景"
252
+ },
253
+ {
254
+ id: "运动",
255
+ title: "运动",
256
+ subtitle: "场景"
257
+ },
258
+ {
259
+ id: "驾车",
260
+ title: "驾车",
261
+ subtitle: "场景"
262
+ }
263
+ ], y = "ncm:song:", g = "ncm:album:", h = "ncm:playlist:", v = "ncm:genre:", b = "ncm:radio:";
264
+ function k(e) {
265
+ return `${b}${e}`;
266
+ }
267
+ function P(e) {
268
+ return /^\d{1,20}$/.test(e);
269
+ }
270
+ function A(e) {
271
+ if ("string" != typeof e) return;
272
+ let t = e.trim();
273
+ if (t) {
274
+ if (t.startsWith("https://")) return t;
275
+ if (t.startsWith("http://")) return `https://${t.slice(7)}`;
276
+ }
277
+ }
278
+ function C(e, t = 500) {
279
+ let i = A(e);
280
+ if (!i) return;
281
+ if (!/^https:\/\/p\d+\.music\.126\.net\//i.test(i) || /[?&]param=/i.test(i)) return i;
282
+ let r = i.includes("?") ? "&" : "?";
283
+ return `${i}${r}param=${t}y${t}`;
284
+ }
285
+ function w(e) {
286
+ let t = [];
287
+ for(let i = 0; i < e.length; i++){
288
+ let r = e.charCodeAt(i);
289
+ if (r >= 0xd800 && r <= 0xdbff && i + 1 < e.length) {
290
+ let t = e.charCodeAt(i + 1);
291
+ t >= 0xdc00 && t <= 0xdfff && (r = 0x10000 + (r - 0xd800 << 10) + (t - 0xdc00), i++);
292
+ }
293
+ r < 0x80 ? t.push(r) : r < 0x800 ? t.push(0xc0 | r >> 6, 0x80 | 0x3f & r) : r < 0x10000 ? t.push(0xe0 | r >> 12, 0x80 | r >> 6 & 0x3f, 0x80 | 0x3f & r) : t.push(0xf0 | r >> 18, 0x80 | r >> 12 & 0x3f, 0x80 | r >> 6 & 0x3f, 0x80 | 0x3f & r);
294
+ }
295
+ return new Uint8Array(t);
296
+ }
297
+ let S = [
298
+ 7,
299
+ 12,
300
+ 17,
301
+ 22,
302
+ 7,
303
+ 12,
304
+ 17,
305
+ 22,
306
+ 7,
307
+ 12,
308
+ 17,
309
+ 22,
310
+ 7,
311
+ 12,
312
+ 17,
313
+ 22,
314
+ 5,
315
+ 9,
316
+ 14,
317
+ 20,
318
+ 5,
319
+ 9,
320
+ 14,
321
+ 20,
322
+ 5,
323
+ 9,
324
+ 14,
325
+ 20,
326
+ 5,
327
+ 9,
328
+ 14,
329
+ 20,
330
+ 4,
331
+ 11,
332
+ 16,
333
+ 23,
334
+ 4,
335
+ 11,
336
+ 16,
337
+ 23,
338
+ 4,
339
+ 11,
340
+ 16,
341
+ 23,
342
+ 4,
343
+ 11,
344
+ 16,
345
+ 23,
346
+ 6,
347
+ 10,
348
+ 15,
349
+ 21,
350
+ 6,
351
+ 10,
352
+ 15,
353
+ 21,
354
+ 6,
355
+ 10,
356
+ 15,
357
+ 21,
358
+ 6,
359
+ 10,
360
+ 15,
361
+ 21
362
+ ], O = Array.from({
363
+ length: 64
364
+ }, (e, t)=>Math.floor(0x100000000 * Math.abs(Math.sin(t + 1))) >>> 0);
365
+ function U(e) {
366
+ let t = "";
367
+ for(let i = 0; i < 4; i++)t += (e >>> 8 * i & 0xff).toString(16).padStart(2, "0");
368
+ return t;
369
+ }
370
+ let I = new Uint8Array([
371
+ 0x63,
372
+ 0x7c,
373
+ 0x77,
374
+ 0x7b,
375
+ 0xf2,
376
+ 0x6b,
377
+ 0x6f,
378
+ 0xc5,
379
+ 0x30,
380
+ 0x01,
381
+ 0x67,
382
+ 0x2b,
383
+ 0xfe,
384
+ 0xd7,
385
+ 0xab,
386
+ 0x76,
387
+ 0xca,
388
+ 0x82,
389
+ 0xc9,
390
+ 0x7d,
391
+ 0xfa,
392
+ 0x59,
393
+ 0x47,
394
+ 0xf0,
395
+ 0xad,
396
+ 0xd4,
397
+ 0xa2,
398
+ 0xaf,
399
+ 0x9c,
400
+ 0xa4,
401
+ 0x72,
402
+ 0xc0,
403
+ 0xb7,
404
+ 0xfd,
405
+ 0x93,
406
+ 0x26,
407
+ 0x36,
408
+ 0x3f,
409
+ 0xf7,
410
+ 0xcc,
411
+ 0x34,
412
+ 0xa5,
413
+ 0xe5,
414
+ 0xf1,
415
+ 0x71,
416
+ 0xd8,
417
+ 0x31,
418
+ 0x15,
419
+ 0x04,
420
+ 0xc7,
421
+ 0x23,
422
+ 0xc3,
423
+ 0x18,
424
+ 0x96,
425
+ 0x05,
426
+ 0x9a,
427
+ 0x07,
428
+ 0x12,
429
+ 0x80,
430
+ 0xe2,
431
+ 0xeb,
432
+ 0x27,
433
+ 0xb2,
434
+ 0x75,
435
+ 0x09,
436
+ 0x83,
437
+ 0x2c,
438
+ 0x1a,
439
+ 0x1b,
440
+ 0x6e,
441
+ 0x5a,
442
+ 0xa0,
443
+ 0x52,
444
+ 0x3b,
445
+ 0xd6,
446
+ 0xb3,
447
+ 0x29,
448
+ 0xe3,
449
+ 0x2f,
450
+ 0x84,
451
+ 0x53,
452
+ 0xd1,
453
+ 0x00,
454
+ 0xed,
455
+ 0x20,
456
+ 0xfc,
457
+ 0xb1,
458
+ 0x5b,
459
+ 0x6a,
460
+ 0xcb,
461
+ 0xbe,
462
+ 0x39,
463
+ 0x4a,
464
+ 0x4c,
465
+ 0x58,
466
+ 0xcf,
467
+ 0xd0,
468
+ 0xef,
469
+ 0xaa,
470
+ 0xfb,
471
+ 0x43,
472
+ 0x4d,
473
+ 0x33,
474
+ 0x85,
475
+ 0x45,
476
+ 0xf9,
477
+ 0x02,
478
+ 0x7f,
479
+ 0x50,
480
+ 0x3c,
481
+ 0x9f,
482
+ 0xa8,
483
+ 0x51,
484
+ 0xa3,
485
+ 0x40,
486
+ 0x8f,
487
+ 0x92,
488
+ 0x9d,
489
+ 0x38,
490
+ 0xf5,
491
+ 0xbc,
492
+ 0xb6,
493
+ 0xda,
494
+ 0x21,
495
+ 0x10,
496
+ 0xff,
497
+ 0xf3,
498
+ 0xd2,
499
+ 0xcd,
500
+ 0x0c,
501
+ 0x13,
502
+ 0xec,
503
+ 0x5f,
504
+ 0x97,
505
+ 0x44,
506
+ 0x17,
507
+ 0xc4,
508
+ 0xa7,
509
+ 0x7e,
510
+ 0x3d,
511
+ 0x64,
512
+ 0x5d,
513
+ 0x19,
514
+ 0x73,
515
+ 0x60,
516
+ 0x81,
517
+ 0x4f,
518
+ 0xdc,
519
+ 0x22,
520
+ 0x2a,
521
+ 0x90,
522
+ 0x88,
523
+ 0x46,
524
+ 0xee,
525
+ 0xb8,
526
+ 0x14,
527
+ 0xde,
528
+ 0x5e,
529
+ 0x0b,
530
+ 0xdb,
531
+ 0xe0,
532
+ 0x32,
533
+ 0x3a,
534
+ 0x0a,
535
+ 0x49,
536
+ 0x06,
537
+ 0x24,
538
+ 0x5c,
539
+ 0xc2,
540
+ 0xd3,
541
+ 0xac,
542
+ 0x62,
543
+ 0x91,
544
+ 0x95,
545
+ 0xe4,
546
+ 0x79,
547
+ 0xe7,
548
+ 0xc8,
549
+ 0x37,
550
+ 0x6d,
551
+ 0x8d,
552
+ 0xd5,
553
+ 0x4e,
554
+ 0xa9,
555
+ 0x6c,
556
+ 0x56,
557
+ 0xf4,
558
+ 0xea,
559
+ 0x65,
560
+ 0x7a,
561
+ 0xae,
562
+ 0x08,
563
+ 0xba,
564
+ 0x78,
565
+ 0x25,
566
+ 0x2e,
567
+ 0x1c,
568
+ 0xa6,
569
+ 0xb4,
570
+ 0xc6,
571
+ 0xe8,
572
+ 0xdd,
573
+ 0x74,
574
+ 0x1f,
575
+ 0x4b,
576
+ 0xbd,
577
+ 0x8b,
578
+ 0x8a,
579
+ 0x70,
580
+ 0x3e,
581
+ 0xb5,
582
+ 0x66,
583
+ 0x48,
584
+ 0x03,
585
+ 0xf6,
586
+ 0x0e,
587
+ 0x61,
588
+ 0x35,
589
+ 0x57,
590
+ 0xb9,
591
+ 0x86,
592
+ 0xc1,
593
+ 0x1d,
594
+ 0x9e,
595
+ 0xe1,
596
+ 0xf8,
597
+ 0x98,
598
+ 0x11,
599
+ 0x69,
600
+ 0xd9,
601
+ 0x8e,
602
+ 0x94,
603
+ 0x9b,
604
+ 0x1e,
605
+ 0x87,
606
+ 0xe9,
607
+ 0xce,
608
+ 0x55,
609
+ 0x28,
610
+ 0xdf,
611
+ 0x8c,
612
+ 0xa1,
613
+ 0x89,
614
+ 0x0d,
615
+ 0xbf,
616
+ 0xe6,
617
+ 0x42,
618
+ 0x68,
619
+ 0x41,
620
+ 0x99,
621
+ 0x2d,
622
+ 0x0f,
623
+ 0xb0,
624
+ 0x54,
625
+ 0xbb,
626
+ 0x16
627
+ ]), M = [
628
+ 0x01,
629
+ 0x02,
630
+ 0x04,
631
+ 0x08,
632
+ 0x10,
633
+ 0x20,
634
+ 0x40,
635
+ 0x80,
636
+ 0x1b,
637
+ 0x36
638
+ ];
639
+ function T(e) {
640
+ return (e << 1 ^ (0x80 & e ? 0x1b : 0)) & 0xff;
641
+ }
642
+ function $(e) {
643
+ for(var t = 1; t < arguments.length; t++){
644
+ var i = null != arguments[t] ? arguments[t] : {}, r = Object.keys(i);
645
+ "function" == typeof Object.getOwnPropertySymbols && (r = r.concat(Object.getOwnPropertySymbols(i).filter(function(e) {
646
+ return Object.getOwnPropertyDescriptor(i, e).enumerable;
647
+ }))), r.forEach(function(t) {
648
+ var r;
649
+ r = i[t], t in e ? Object.defineProperty(e, t, {
650
+ value: r,
651
+ enumerable: !0,
652
+ configurable: !0,
653
+ writable: !0
654
+ }) : e[t] = r;
655
+ });
656
+ }
657
+ return e;
658
+ }
659
+ function j(e, t) {
660
+ return t = null != t ? t : {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : (function(e) {
661
+ var t = Object.keys(e);
662
+ if (Object.getOwnPropertySymbols) {
663
+ var i = Object.getOwnPropertySymbols(e);
664
+ t.push.apply(t, i);
665
+ }
666
+ return t;
667
+ })(Object(t)).forEach(function(i) {
668
+ Object.defineProperty(e, i, Object.getOwnPropertyDescriptor(t, i));
669
+ }), e;
670
+ }
671
+ function D(e) {
672
+ return null !== e && "object" == typeof e && !Array.isArray(e);
673
+ }
674
+ function N(e) {
675
+ return "string" == typeof e ? /^\d+$/.test(e.trim()) ? e.trim() : "" : "number" == typeof e && Number.isFinite(e) && e > 0 ? String(Math.floor(e)) : "";
676
+ }
677
+ function R(e) {
678
+ return "string" == typeof e ? e.trim() : "";
679
+ }
680
+ function L(e) {
681
+ let t = Number(e);
682
+ return Number.isFinite(t) ? t : 0;
683
+ }
684
+ function E(e) {
685
+ if (!Number.isFinite(e) || e <= 0) return "";
686
+ let t = Math.round(e), i = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), l = t % 60;
687
+ return i > 0 ? `${i}:${String(r).padStart(2, "0")}:${String(l).padStart(2, "0")}` : `${r}:${String(l).padStart(2, "0")}`;
688
+ }
689
+ function W(e) {
690
+ if (!D(e)) return null;
691
+ let t = N(e.id), i = R(e.name);
692
+ if (!i) return null;
693
+ let r = C(R(e.img1v1Url) || R(e.picUrl) || R(e.avatarUrl)), l = Array.isArray(e.alias) ? e.alias.map(R).filter(Boolean) : [], n = R(e.trans) || l[0] || void 0;
694
+ return $({
695
+ id: t,
696
+ name: i
697
+ }, r ? {
698
+ imageUrl: r
699
+ } : {}, n ? {
700
+ subtitle: n
701
+ } : {});
702
+ }
703
+ function _(e) {
704
+ if (!D(e)) return null;
705
+ let t = N(e.id), i = R(e.name);
706
+ if (!t || !i) return null;
707
+ let r = (Array.isArray(e.artists) ? e.artists : e.artist ? [
708
+ e.artist
709
+ ] : []).map(W).filter((e)=>null !== e), l = C(R(e.picUrl) || R(e.blurPicUrl)), n = function(e) {
710
+ let t = L(e);
711
+ if (t <= 0) return;
712
+ let i = new Date(t);
713
+ if (Number.isNaN(i.getTime())) return;
714
+ let r = i.getUTCFullYear(), l = String(i.getUTCMonth() + 1).padStart(2, "0"), n = String(i.getUTCDate()).padStart(2, "0");
715
+ return `${r}-${l}-${n}`;
716
+ }(e.publishTime), a = R(e.description) || void 0, o = L(e.size) || void 0;
717
+ return $({
718
+ id: t,
719
+ name: i,
720
+ artists: r
721
+ }, l ? {
722
+ imageUrl: l
723
+ } : {}, n ? {
724
+ released: n
725
+ } : {}, a ? {
726
+ description: a
727
+ } : {}, o ? {
728
+ trackCount: o
729
+ } : {});
730
+ }
731
+ function x(e) {
732
+ if (!D(e)) return null;
733
+ let t = N(e.id), i = R(e.name);
734
+ if (!t || !i) return null;
735
+ let r = C(R(e.coverImgUrl) || R(e.picUrl)), l = D(e.creator) ? e.creator : void 0, n = R(null == l ? void 0 : l.nickname) || R(e.copywriter) || void 0, a = L(e.trackCount) || void 0, o = [], s = R(e.updateFrequency);
736
+ s && o.push(s);
737
+ let u = R(e.description);
738
+ if (u && o.push(u), Array.isArray(e.tracks) && e.tracks.length) {
739
+ let t = e.tracks.slice(0, 3).map((e, t)=>{
740
+ if (!D(e)) return "";
741
+ let i = R(e.first), r = R(e.second);
742
+ return i ? r ? `${t + 1}. ${i} · ${r}` : `${t + 1}. ${i}` : "";
743
+ }).filter(Boolean);
744
+ t.length && o.push(t.join("\n"));
745
+ }
746
+ let d = o.filter(Boolean).join("\n") || void 0;
747
+ return $({
748
+ id: t,
749
+ name: i
750
+ }, r ? {
751
+ imageUrl: r
752
+ } : {}, n ? {
753
+ owner: n
754
+ } : {}, d ? {
755
+ description: d
756
+ } : {}, a ? {
757
+ trackCount: a
758
+ } : {});
759
+ }
760
+ function V(e) {
761
+ if (!D(e)) return null;
762
+ let t = D(e.song) ? e.song : e, i = N(t.id) || N(e.id), r = R(t.name) || R(e.name);
763
+ if (!i || !r) return null;
764
+ let l = (Array.isArray(t.ar) ? t.ar : Array.isArray(t.artists) ? t.artists : Array.isArray(e.ar) ? e.ar : []).map(W).filter((e)=>null !== e), n = D(t.al) ? t.al : D(t.album) ? t.album : void 0, a = N(null == n ? void 0 : n.id), o = R(null == n ? void 0 : n.name), s = C(R(null == n ? void 0 : n.picUrl) || R(e.picUrl)), u = L(t.dt) || L(t.duration), d = u > 0 ? Math.round(u / 1000) : 0, c = L(t.fee);
765
+ return $(j($({
766
+ id: i,
767
+ name: r,
768
+ artists: l
769
+ }, o || a ? {
770
+ album: {
771
+ id: a,
772
+ name: o,
773
+ imageUrl: s
774
+ }
775
+ } : {}), {
776
+ duration: d
777
+ }), s ? {
778
+ imageUrl: s
779
+ } : {}, c ? {
780
+ fee: c
781
+ } : {});
782
+ }
783
+ function F(e) {
784
+ let t = new Set(), i = [];
785
+ for (let r of e)!r.id || !r.name || t.has(r.id) || (t.add(r.id), i.push(j($({
786
+ id: r.id,
787
+ title: r.name
788
+ }, r.imageUrl ? {
789
+ avatar: r.imageUrl
790
+ } : {}), {
791
+ role: Widget.i18n("歌手")
792
+ })));
793
+ return i.length ? i : void 0;
794
+ }
795
+ function H(e) {
796
+ var t, i, r;
797
+ let l = e.artists.map((e)=>e.name).filter(Boolean).join(" / ") || (null == (t = e.album) ? void 0 : t.name) || void 0, n = e.imageUrl || (null == (i = e.album) ? void 0 : i.imageUrl), a = F(e.artists), o = E(e.duration);
798
+ return $({
799
+ id: e.id,
800
+ type: "url",
801
+ mediaType: "song",
802
+ link: (r = e.id, `${y}${r}`),
803
+ title: e.name
804
+ }, l ? {
805
+ subtitle: l
806
+ } : {}, n ? {
807
+ posterPath: n,
808
+ coverUrl: n
809
+ } : {}, e.duration > 0 ? {
810
+ duration: e.duration,
811
+ durationText: o
812
+ } : {}, a ? {
813
+ peoples: a
814
+ } : {});
815
+ }
816
+ function q(e) {
817
+ var t;
818
+ let i = e.artists.map((e)=>e.name).filter(Boolean).join(" / "), r = F(e.artists);
819
+ return $({
820
+ id: e.id,
821
+ type: "url",
822
+ mediaType: "album",
823
+ link: (t = e.id, `${g}${t}`),
824
+ title: e.name
825
+ }, i ? {
826
+ subtitle: i
827
+ } : {}, e.imageUrl ? {
828
+ posterPath: e.imageUrl,
829
+ coverUrl: e.imageUrl
830
+ } : {}, e.released ? {
831
+ releaseDate: e.released
832
+ } : {}, r ? {
833
+ peoples: r
834
+ } : {});
835
+ }
836
+ function B(e) {
837
+ var t;
838
+ return $({
839
+ id: e.id,
840
+ type: "url",
841
+ mediaType: "playlist",
842
+ link: (t = e.id, `${h}${t}`),
843
+ title: e.name
844
+ }, e.owner ? {
845
+ subtitle: e.owner
846
+ } : {}, e.imageUrl ? {
847
+ posterPath: e.imageUrl,
848
+ coverUrl: e.imageUrl
849
+ } : {}, e.description ? {
850
+ description: e.description
851
+ } : {});
852
+ }
853
+ function z(e, t) {
854
+ return $({
855
+ id: e.id,
856
+ type: "person",
857
+ mediaType: "person",
858
+ title: e.name
859
+ }, e.subtitle ? {
860
+ subtitle: e.subtitle
861
+ } : {}, e.imageUrl ? {
862
+ avatar: e.imageUrl,
863
+ posterPath: e.imageUrl,
864
+ coverUrl: e.imageUrl
865
+ } : {}, t ? {
866
+ description: t
867
+ } : {});
868
+ }
869
+ function G(e) {
870
+ let t = new Set(), i = [];
871
+ for (let r of e){
872
+ let e = `${r.mediaType || r.type}:${r.id}`;
873
+ t.has(e) || (t.add(e), i.push(r));
874
+ }
875
+ return i;
876
+ }
877
+ function J(e) {
878
+ for(var t = 1; t < arguments.length; t++){
879
+ var i = null != arguments[t] ? arguments[t] : {}, r = Object.keys(i);
880
+ "function" == typeof Object.getOwnPropertySymbols && (r = r.concat(Object.getOwnPropertySymbols(i).filter(function(e) {
881
+ return Object.getOwnPropertyDescriptor(i, e).enumerable;
882
+ }))), r.forEach(function(t) {
883
+ var r;
884
+ r = i[t], t in e ? Object.defineProperty(e, t, {
885
+ value: r,
886
+ enumerable: !0,
887
+ configurable: !0,
888
+ writable: !0
889
+ }) : e[t] = r;
890
+ });
891
+ }
892
+ return e;
893
+ }
894
+ let K = "ncm:config", X = "ncm:deviceId", Z = "ncm:serverCookies", Y = "ncm:account", Q = "ncm:streams", ee = "ncm:songMeta", et = {
895
+ cookie: "",
896
+ quality: "exhigh",
897
+ allowTrial: !1,
898
+ playerType: "auto"
899
+ };
900
+ function ei(e) {
901
+ try {
902
+ let t = Widget.storage.get(e);
903
+ if (null == t) return null;
904
+ if ("string" == typeof t) try {
905
+ return JSON.parse(t);
906
+ } catch (e) {}
907
+ return t;
908
+ } catch (e) {
909
+ return null;
910
+ }
911
+ }
912
+ function er(e, t) {
913
+ try {
914
+ Widget.storage.set(e, t);
915
+ } catch (e) {}
916
+ }
917
+ function el(e) {
918
+ try {
919
+ Widget.storage.remove(e);
920
+ } catch (e) {}
921
+ }
922
+ function en(e) {
923
+ return "standard" === e || "higher" === e || "exhigh" === e || "lossless" === e || "hires" === e ? e : "exhigh";
924
+ }
925
+ function ea(e) {
926
+ return "system" === e || "app" === e || "auto" === e ? e : "auto";
927
+ }
928
+ function eo() {
929
+ let e = ei(K);
930
+ return e && "object" == typeof e ? {
931
+ cookie: "string" == typeof e.cookie ? e.cookie : et.cookie,
932
+ quality: en(e.quality),
933
+ allowTrial: !!e.allowTrial,
934
+ playerType: ea(e.playerType)
935
+ } : J({}, et);
936
+ }
937
+ function es(e) {
938
+ let t = eo();
939
+ if (!e) return t;
940
+ let i = {
941
+ cookie: "string" == typeof e.cookie ? e.cookie.trim() : t.cookie,
942
+ quality: void 0 !== e.quality ? en(e.quality) : t.quality,
943
+ allowTrial: void 0 !== e.allowTrial ? "true" === e.allowTrial : t.allowTrial,
944
+ playerType: void 0 !== e.playerType ? ea(e.playerType) : t.playerType
945
+ };
946
+ return i.cookie !== t.cookie && (el(Y), el(Q)), er(K, i), i;
947
+ }
948
+ function eu() {
949
+ let e = ei(Z);
950
+ return e && "object" == typeof e ? J({}, e) : {};
951
+ }
952
+ function ed(e) {
953
+ if (!(Object.keys(e.updates).length > 0) && !e.deletes.length) return;
954
+ let t = eu();
955
+ for (let i of e.deletes)delete t[i];
956
+ for (let [i, r] of Object.entries(e.updates))r && (t[i] = r);
957
+ er(Z, t);
958
+ }
959
+ function ec(e) {
960
+ let t = e.filter((e)=>"song" === e.mediaType && "string" == typeof e.id && e.id);
961
+ if (!t.length) return;
962
+ let i = ei(ee), r = i && "object" == typeof i ? J({}, i) : {};
963
+ for (let e of t){
964
+ var l;
965
+ let t = String(e.id);
966
+ delete r[t], r[t] = J({
967
+ id: t,
968
+ title: e.title
969
+ }, e.subtitle ? {
970
+ subtitle: e.subtitle
971
+ } : {}, e.posterPath ? {
972
+ posterPath: e.posterPath
973
+ } : {}, e.coverUrl ? {
974
+ coverUrl: e.coverUrl
975
+ } : {}, "number" == typeof e.duration ? {
976
+ duration: e.duration
977
+ } : {}, e.durationText ? {
978
+ durationText: e.durationText
979
+ } : {}, (null == (l = e.peoples) ? void 0 : l.length) ? {
980
+ peoples: e.peoples
981
+ } : {});
982
+ }
983
+ let n = Object.keys(r);
984
+ if (n.length > 160) for (let e of n.slice(0, n.length - 160))delete r[e];
985
+ er(ee, r);
986
+ }
987
+ function ep(e, t, i, r, l, n, a) {
988
+ try {
989
+ var o = e[n](a), s = o.value;
990
+ } catch (e) {
991
+ i(e);
992
+ return;
993
+ }
994
+ o.done ? t(s) : Promise.resolve(s).then(r, l);
995
+ }
996
+ function ef(e) {
997
+ return function() {
998
+ var t = this, i = arguments;
999
+ return new Promise(function(r, l) {
1000
+ var n = e.apply(t, i);
1001
+ function a(e) {
1002
+ ep(n, r, l, a, o, "next", e);
1003
+ }
1004
+ function o(e) {
1005
+ ep(n, r, l, a, o, "throw", e);
1006
+ }
1007
+ a(void 0);
1008
+ });
1009
+ };
1010
+ }
1011
+ function em(e, t, i) {
1012
+ return t in e ? Object.defineProperty(e, t, {
1013
+ value: i,
1014
+ enumerable: !0,
1015
+ configurable: !0,
1016
+ writable: !0
1017
+ }) : e[t] = i, e;
1018
+ }
1019
+ function ey(e) {
1020
+ for(var t = 1; t < arguments.length; t++){
1021
+ var i = null != arguments[t] ? arguments[t] : {}, r = Object.keys(i);
1022
+ "function" == typeof Object.getOwnPropertySymbols && (r = r.concat(Object.getOwnPropertySymbols(i).filter(function(e) {
1023
+ return Object.getOwnPropertyDescriptor(i, e).enumerable;
1024
+ }))), r.forEach(function(t) {
1025
+ em(e, t, i[t]);
1026
+ });
1027
+ }
1028
+ return e;
1029
+ }
1030
+ function eg(e, t) {
1031
+ return t = null != t ? t : {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : (function(e) {
1032
+ var t = Object.keys(e);
1033
+ if (Object.getOwnPropertySymbols) {
1034
+ var i = Object.getOwnPropertySymbols(e);
1035
+ t.push.apply(t, i);
1036
+ }
1037
+ return t;
1038
+ })(Object(t)).forEach(function(i) {
1039
+ Object.defineProperty(e, i, Object.getOwnPropertyDescriptor(t, i));
1040
+ }), e;
1041
+ }
1042
+ class eh extends Error {
1043
+ constructor(e, t = 0, i = !1){
1044
+ super(e), em(this, "code", void 0), em(this, "transient", void 0), this.name = "NeteaseApiError", this.code = t, this.transient = i;
1045
+ }
1046
+ }
1047
+ let ev = new Set([
1048
+ "mp3",
1049
+ "flac",
1050
+ "m4a",
1051
+ "aac",
1052
+ "ogg",
1053
+ "wav",
1054
+ "mp4"
1055
+ ]);
1056
+ function eb(e) {
1057
+ let t = eu(), i = l(e.cookie), r = {};
1058
+ return t.NMTID && (r.NMTID = t.NMTID), t.__csrf && (r.__csrf = t.__csrf), Object.assign(r, i.cookies), !i.cookies.NMTID && t.NMTID && (r.NMTID = t.NMTID), r;
1059
+ }
1060
+ function ek(e) {
1061
+ return Object.entries(e).map(([e, t])=>`${encodeURIComponent(e)}=${encodeURIComponent(String(t))}`).join("&");
1062
+ }
1063
+ function eP(e) {
1064
+ if ("string" == typeof e) try {
1065
+ return JSON.parse(e);
1066
+ } catch (e) {
1067
+ throw new eh(Widget.i18n("网易云返回了无法解析的响应"), 0, !1);
1068
+ }
1069
+ if (e && "object" == typeof e) return e;
1070
+ throw new eh(Widget.i18n("网易云返回了无效数据"), 0, !1);
1071
+ }
1072
+ function eA(e, t) {
1073
+ let i = e.code;
1074
+ if (null == i) return;
1075
+ let r = Number(i);
1076
+ if (t.includes(r)) return;
1077
+ if (301 === r || 302 === r || 401 === r) throw new eh(Widget.i18n("网易云登录状态已失效或需要登录,请检查 Cookie 配置"), r, !1);
1078
+ if (-460 === r || 460 === r) throw new eh(Widget.i18n("网易云暂时触发风控限制,请稍后重试"), r, !0);
1079
+ if (405 === r || 429 === r) throw new eh(Widget.i18n("网易云请求过于频繁,请稍后重试"), r, !0);
1080
+ let l = "string" == typeof e.message && e.message.trim() ? e.message.trim() : `code ${r}`;
1081
+ throw new eh(`${Widget.i18n("网易云接口返回错误")} (${l})`, r, r >= 500);
1082
+ }
1083
+ function eC(e) {
1084
+ if (e instanceof eh) return e.transient;
1085
+ let t = e instanceof Error ? e.message : String(e);
1086
+ return /^HTTP\s+(?:429|5\d\d)\b/i.test(t);
1087
+ }
1088
+ function ew(e, t = 3) {
1089
+ return ef(function*() {
1090
+ let i;
1091
+ for(let r = 1; r <= t; r++)try {
1092
+ return yield e(r);
1093
+ } catch (e) {
1094
+ if (i = e, !eC(e) || r >= t) throw e;
1095
+ yield function(e) {
1096
+ return ef(function*() {
1097
+ yield new Promise((t)=>setTimeout(t, e));
1098
+ })();
1099
+ }(250 * r);
1100
+ }
1101
+ throw i;
1102
+ })();
1103
+ }
1104
+ function eS(e, t) {
1105
+ return ef(function*(e, t = {}, i, l = {}) {
1106
+ var o, u;
1107
+ let d, c = l.method || "GET", p = eb(i), f = ey({}, t);
1108
+ "POST" === c && p.__csrf && void 0 === f.csrf_token && (f.csrf_token = p.__csrf);
1109
+ let m = r(p), y = ey({
1110
+ "user-agent": s,
1111
+ referer: `${a}/`
1112
+ }, m ? {
1113
+ cookie: m
1114
+ } : {}), g = `${a}${e}`;
1115
+ if ("POST" === c) y["content-type"] = "application/x-www-form-urlencoded", d = ek(f);
1116
+ else {
1117
+ let e = ek(f);
1118
+ e && (g += (g.includes("?") ? "&" : "?") + e);
1119
+ }
1120
+ let h = yield Widget.http.request(eg(ey({
1121
+ url: g,
1122
+ method: c,
1123
+ headers: y
1124
+ }, void 0 !== d ? {
1125
+ data: d
1126
+ } : {}), {
1127
+ timeout: null != (o = l.timeout) ? o : 18
1128
+ }));
1129
+ ed(n(h.headers));
1130
+ let v = eP(h.data);
1131
+ return eA(v, null != (u = l.allowedCodes) ? u : [
1132
+ 200
1133
+ ]), v;
1134
+ }).apply(this, arguments);
1135
+ }
1136
+ function eO(e, t, i) {
1137
+ return ef(function*(e, t, i, r = {}) {
1138
+ var l, a;
1139
+ let s = eb(i), c = Date.now(), p = function() {
1140
+ let e = ei(X);
1141
+ if ("string" == typeof e && /^[0-9A-F]{52}$/.test(e)) return e;
1142
+ let t = "";
1143
+ for(let e = 0; e < 52; e++)t += Math.floor(16 * Math.random()).toString(16).toUpperCase();
1144
+ return er(X, t), t;
1145
+ }(), f = eg(ey({}, u), {
1146
+ deviceId: p,
1147
+ mobilename: "",
1148
+ buildver: String(Math.floor(c / 1000)),
1149
+ requestId: `${c}_${String(Math.floor(1000 * Math.random())).padStart(4, "0")}`,
1150
+ __csrf: s.__csrf || ""
1151
+ });
1152
+ s.MUSIC_U && (f.MUSIC_U = s.MUSIC_U), s.NMTID && (f.NMTID = s.NMTID);
1153
+ let m = function(e, t, i = o) {
1154
+ let r = JSON.stringify(t), l = function(e) {
1155
+ let t = w(e), i = 8 * t.length, r = ((t.length + 8 >>> 6) + 1) * 64, l = new Uint8Array(r);
1156
+ l.set(t), l[t.length] = 0x80;
1157
+ let n = i >>> 0, a = Math.floor(i / 0x100000000) >>> 0, o = r - 8;
1158
+ l[o] = 0xff & n, l[o + 1] = n >>> 8 & 0xff, l[o + 2] = n >>> 16 & 0xff, l[o + 3] = n >>> 24 & 0xff, l[o + 4] = 0xff & a, l[o + 5] = a >>> 8 & 0xff, l[o + 6] = a >>> 16 & 0xff, l[o + 7] = a >>> 24 & 0xff;
1159
+ let s = 0x67452301, u = 0xefcdab89, d = 0x98badcfe, c = 0x10325476, p = new Uint32Array(16);
1160
+ for(let e = 0; e < r; e += 64){
1161
+ for(let t = 0; t < 16; t++){
1162
+ let i = e + 4 * t;
1163
+ p[t] = (l[i] | l[i + 1] << 8 | l[i + 2] << 16 | l[i + 3] << 24) >>> 0;
1164
+ }
1165
+ let t = s, i = u, r = d, n = c;
1166
+ for(let e = 0; e < 64; e++){
1167
+ var f, m;
1168
+ let l, a;
1169
+ e < 16 ? (l = i & r | ~i & n, a = e) : e < 32 ? (l = n & i | ~n & r, a = 5 * e + 1 & 15) : e < 48 ? (l = i ^ r ^ n, a = 3 * e + 5 & 15) : (l = r ^ (i | ~n), a = 7 * e & 15);
1170
+ let o = n;
1171
+ n = r, r = i, i = i + ((f = t + l + O[e] + p[a] | 0) << (m = S[e]) | f >>> 32 - m) | 0, t = o;
1172
+ }
1173
+ s = s + t | 0, u = u + i | 0, d = d + r | 0, c = c + n | 0;
1174
+ }
1175
+ return U(s) + U(u) + U(d) + U(c);
1176
+ }(`nobody${e}use${r}md5forencrypt`);
1177
+ return function(e, t = o) {
1178
+ let i = w(e), r = function(e) {
1179
+ if (16 !== e.length) throw Error(`AES-128 key must be 16 bytes, got ${e.length}`);
1180
+ let t = new Uint8Array(176);
1181
+ t.set(e);
1182
+ for(let e = 4; e < 44; e++){
1183
+ let i = (e - 1) * 4, r = t[i], l = t[i + 1], n = t[i + 2], a = t[i + 3];
1184
+ if (e % 4 == 0) {
1185
+ let t = r;
1186
+ r = I[l] ^ M[e / 4 - 1], l = I[n], n = I[a], a = I[t];
1187
+ }
1188
+ let o = (e - 4) * 4, s = 4 * e;
1189
+ t[s] = t[o] ^ r, t[s + 1] = t[o + 1] ^ l, t[s + 2] = t[o + 2] ^ n, t[s + 3] = t[o + 3] ^ a;
1190
+ }
1191
+ return t;
1192
+ }(w(t)), l = 16 - i.length % 16, n = new Uint8Array(i.length + l);
1193
+ n.set(i), n.fill(l, i.length);
1194
+ let a = new Uint8Array(16), s = "";
1195
+ for(let e = 0; e < n.length; e += 16){
1196
+ a.set(n.subarray(e, e + 16)), function(e, t) {
1197
+ for(let i = 0; i < 16; i++)e[i] ^= t[i];
1198
+ for(let i = 1; i <= 10; i++){
1199
+ for(let t = 0; t < 16; t++)e[t] = I[e[t]];
1200
+ let r = e[1];
1201
+ if (e[1] = e[5], e[5] = e[9], e[9] = e[13], e[13] = r, r = e[2], e[2] = e[10], e[10] = r, r = e[6], e[6] = e[14], e[14] = r, r = e[15], e[15] = e[11], e[11] = e[7], e[7] = e[3], e[3] = r, i < 10) for(let t = 0; t < 16; t += 4){
1202
+ let i = e[t], r = e[t + 1], l = e[t + 2], n = e[t + 3], a = i ^ r ^ l ^ n;
1203
+ e[t] = i ^ a ^ T(i ^ r), e[t + 1] = r ^ a ^ T(r ^ l), e[t + 2] = l ^ a ^ T(l ^ n), e[t + 3] = n ^ a ^ T(n ^ i);
1204
+ }
1205
+ let l = 16 * i;
1206
+ for(let i = 0; i < 16; i++)e[i] ^= t[l + i];
1207
+ }
1208
+ }(a, r);
1209
+ for(let e = 0; e < 16; e++)s += a[e].toString(16).padStart(2, "0").toUpperCase();
1210
+ }
1211
+ return s;
1212
+ }(`${e}-36cd479b6b5-${r}-36cd479b6b5-${l}`, i);
1213
+ }(e, eg(ey({}, t), {
1214
+ header: f,
1215
+ e_r: !1
1216
+ })), y = Object.entries(f).map(([e, t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join("; "), g = `https://interfacepc.music.163.com${e.replace(/^\/api\//, "/eapi/")}`, h = yield Widget.http.request({
1217
+ url: g,
1218
+ method: "POST",
1219
+ headers: {
1220
+ "content-type": "application/x-www-form-urlencoded",
1221
+ "user-agent": d,
1222
+ cookie: y
1223
+ },
1224
+ data: `params=${m}`,
1225
+ timeout: null != (l = r.timeout) ? l : 18
1226
+ });
1227
+ ed(n(h.headers));
1228
+ let v = eP(h.data);
1229
+ return eA(v, null != (a = r.allowedCodes) ? a : [
1230
+ 200
1231
+ ]), v;
1232
+ }).apply(this, arguments);
1233
+ }
1234
+ function eU(e) {
1235
+ return ef(function*() {
1236
+ var t, i, r;
1237
+ let n = l(e.cookie);
1238
+ if (!n.hasMusicU) throw Error(Widget.i18n("请在模块设置中填写包含 MUSIC_U 的网易云音乐 Cookie 后查看个人内容"));
1239
+ let a = n.cookies.MUSIC_U, o = function(e, t = Date.now()) {
1240
+ if (!e) return null;
1241
+ let i = ei(Y);
1242
+ return i && i.cookieKey === e && i.uid && !(t - i.cachedAt > 1800000) ? i : null;
1243
+ }(a);
1244
+ if (o) return {
1245
+ uid: o.uid,
1246
+ nickname: o.nickname
1247
+ };
1248
+ let s = yield eS("/api/nuser/account/get", {}, e), u = null != (t = null == (i = s.profile) ? void 0 : i.userId) ? t : null == (r = s.account) ? void 0 : r.id, d = u ? String(u) : "";
1249
+ if (!d || !/^\d+$/.test(d) || !s.profile) throw Error(Widget.i18n("网易云登录状态已失效或 Cookie 无效,请更新包含 MUSIC_U 的 Cookie"));
1250
+ let c = "string" == typeof s.profile.nickname ? s.profile.nickname : "";
1251
+ return !function(e, t, i, r = Date.now()) {
1252
+ e && i && er(Y, {
1253
+ uid: e,
1254
+ nickname: t,
1255
+ cookieKey: i,
1256
+ cachedAt: r
1257
+ });
1258
+ }(d, c, a), {
1259
+ uid: d,
1260
+ nickname: c
1261
+ };
1262
+ })();
1263
+ }
1264
+ function eI(e, t) {
1265
+ return ef(function*() {
1266
+ let i = Array.from(new Set(e.filter((e)=>/^\d+$/.test(e))));
1267
+ if (!i.length) return [];
1268
+ let r = new Map();
1269
+ for(let e = 0; e < i.length; e += 100){
1270
+ let l = i.slice(e, e + 100), n = yield eS("/api/v3/song/detail", {
1271
+ c: JSON.stringify(l.map((e)=>({
1272
+ id: Number(e)
1273
+ })))
1274
+ }, t, {
1275
+ method: "POST"
1276
+ });
1277
+ for (let e of Array.isArray(n.songs) ? n.songs : []){
1278
+ let t = V(e);
1279
+ t && r.set(t.id, t);
1280
+ }
1281
+ }
1282
+ let l = [];
1283
+ for (let e of i){
1284
+ let t = r.get(e);
1285
+ t && l.push(t);
1286
+ }
1287
+ return l;
1288
+ })();
1289
+ }
1290
+ function eM(e, t, i, r, l, n, a) {
1291
+ try {
1292
+ var o = e[n](a), s = o.value;
1293
+ } catch (e) {
1294
+ i(e);
1295
+ return;
1296
+ }
1297
+ o.done ? t(s) : Promise.resolve(s).then(r, l);
1298
+ }
1299
+ function eT(e) {
1300
+ return function() {
1301
+ var t = this, i = arguments;
1302
+ return new Promise(function(r, l) {
1303
+ var n = e.apply(t, i);
1304
+ function a(e) {
1305
+ eM(n, r, l, a, o, "next", e);
1306
+ }
1307
+ function o(e) {
1308
+ eM(n, r, l, a, o, "throw", e);
1309
+ }
1310
+ a(void 0);
1311
+ });
1312
+ };
1313
+ }
1314
+ function e$(e) {
1315
+ for(var t = 1; t < arguments.length; t++){
1316
+ var i = null != arguments[t] ? arguments[t] : {}, r = Object.keys(i);
1317
+ "function" == typeof Object.getOwnPropertySymbols && (r = r.concat(Object.getOwnPropertySymbols(i).filter(function(e) {
1318
+ return Object.getOwnPropertyDescriptor(i, e).enumerable;
1319
+ }))), r.forEach(function(t) {
1320
+ var r;
1321
+ r = i[t], t in e ? Object.defineProperty(e, t, {
1322
+ value: r,
1323
+ enumerable: !0,
1324
+ configurable: !0,
1325
+ writable: !0
1326
+ }) : e[t] = r;
1327
+ });
1328
+ }
1329
+ return e;
1330
+ }
1331
+ function ej(e, t) {
1332
+ return t = null != t ? t : {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : (function(e) {
1333
+ var t = Object.keys(e);
1334
+ if (Object.getOwnPropertySymbols) {
1335
+ var i = Object.getOwnPropertySymbols(e);
1336
+ t.push.apply(t, i);
1337
+ }
1338
+ return t;
1339
+ })(Object(t)).forEach(function(i) {
1340
+ Object.defineProperty(e, i, Object.getOwnPropertyDescriptor(t, i));
1341
+ }), e;
1342
+ }
1343
+ function eD(e) {
1344
+ let t = Number(e);
1345
+ return Number.isFinite(t) && t >= 1 ? Math.floor(t) : 1;
1346
+ }
1347
+ function eN(e, t = 30) {
1348
+ let i = Number(e.offset);
1349
+ return void 0 !== e.offset && "" !== e.offset && Number.isFinite(i) && i >= 0 ? Math.floor(i) : (eD(e.page) - 1) * t;
1350
+ }
1351
+ function eR(e, t, i = 30) {
1352
+ let r = eN(t, i);
1353
+ return e.slice(r, r + i);
1354
+ }
1355
+ function eL(e, t) {
1356
+ return e.startsWith(t) ? e.slice(t.length) : e;
1357
+ }
1358
+ function eE(e, t) {
1359
+ return eT(function*(e, t, i = 300) {
1360
+ var r;
1361
+ let l = (yield eS("/api/v6/playlist/detail", {
1362
+ id: e,
1363
+ n: 100000,
1364
+ s: 0
1365
+ }, t, {
1366
+ method: "POST"
1367
+ })).playlist, n = null != (r = x(l)) ? r : {
1368
+ id: e,
1369
+ name: e
1370
+ }, a = (Array.isArray(null == l ? void 0 : l.tracks) ? l.tracks : []).map(V).filter((e)=>null !== e), o = new Map(a.map((e)=>[
1371
+ e.id,
1372
+ e
1373
+ ])), s = (Array.isArray(null == l ? void 0 : l.trackIds) ? l.trackIds : []).map((e)=>(null == e ? void 0 : e.id) !== void 0 ? String(e.id) : "").filter((e)=>P(e)).slice(0, i);
1374
+ if (!s.length) return {
1375
+ playlist: n,
1376
+ tracks: a.slice(0, i)
1377
+ };
1378
+ let u = s.filter((e)=>!o.has(e));
1379
+ if (u.length) for (let e of yield eI(u, t))o.set(e.id, e);
1380
+ let d = [];
1381
+ for (let e of s){
1382
+ let t = o.get(e);
1383
+ t && d.push(t);
1384
+ }
1385
+ return {
1386
+ playlist: n,
1387
+ tracks: d
1388
+ };
1389
+ }).apply(this, arguments);
1390
+ }
1391
+ function eW(e, t) {
1392
+ return eT(function*() {
1393
+ if (!l(t.cookie).hasMusicU) throw Error(Widget.i18n("私人漫游需要配置网易云音乐 Cookie(含 MUSIC_U)"));
1394
+ let i = yield eO("/api/v1/radio/get", {
1395
+ mode: e,
1396
+ subMode: "",
1397
+ limit: 10
1398
+ }, t);
1399
+ return (Array.isArray(i.data) ? i.data : []).map(V).filter((e)=>null !== e);
1400
+ })();
1401
+ }
1402
+ function e_(e, t, i, r, l, n, a) {
1403
+ try {
1404
+ var o = e[n](a), s = o.value;
1405
+ } catch (e) {
1406
+ i(e);
1407
+ return;
1408
+ }
1409
+ o.done ? t(s) : Promise.resolve(s).then(r, l);
1410
+ }
1411
+ function ex(e) {
1412
+ return function() {
1413
+ var t = this, i = arguments;
1414
+ return new Promise(function(r, l) {
1415
+ var n = e.apply(t, i);
1416
+ function a(e) {
1417
+ e_(n, r, l, a, o, "next", e);
1418
+ }
1419
+ function o(e) {
1420
+ e_(n, r, l, a, o, "throw", e);
1421
+ }
1422
+ a(void 0);
1423
+ });
1424
+ };
1425
+ }
1426
+ WidgetMetadata = {
1427
+ id: "baranwang.music.netease",
1428
+ title: "网易云音乐",
1429
+ description: "网易云音乐插件,支持首页推荐、排行榜、新歌速递、歌单分类、私人漫游、歌手主页、搜索、个人音乐库与直接音频播放",
1430
+ author: "Baran",
1431
+ version: "0.1.0",
1432
+ site: "https://github.com/baranwang/rex-widget/tree/main/apps/netease-music",
1433
+ requiredVersion: "0.0.7",
1434
+ contentType: "music",
1435
+ continuousPlay: !0,
1436
+ iconurl: "https://s1.music.126.net/style/favicon.ico",
1437
+ detailCacheDuration: 60,
1438
+ i18n: {
1439
+ en: {
1440
+ 网易云音乐: "NetEase Cloud Music",
1441
+ "网易云音乐 (测试)": "NetEase Cloud Music (Dev)",
1442
+ "网易云音乐插件,支持首页推荐、排行榜、新歌速递、歌单分类、私人漫游、歌手主页、搜索、个人音乐库与直接音频播放": "NetEase Cloud Music plugin supporting Home, Charts, New Releases, Playlist Categories, Personal FM, Artists, Search, My Library, and direct audio playback",
1443
+ "网易云音乐 Cookie(可选)": "NetEase Cloud Music Cookie (Optional)",
1444
+ "可选。支持直接粘贴 MUSIC_U 值、完整 Cookie 请求头或 Copy as cURL;不填可直接使用公开曲库与免费歌曲,填写后解锁每日推荐、私人漫游、个人歌单、云盘与黑胶 VIP / 无损音质。": "Optional. Paste a raw MUSIC_U token, full Cookie header, or Copy as cURL; leave empty for public catalog and free songs, or set it to unlock Daily Recommendations, Personal FM, My Library, Cloud Drive, and VIP / Lossless quality.",
1445
+ 音质偏好: "Audio Quality",
1446
+ "无损与 Hi-Res 需要黑胶 VIP / SVIP Cookie,FLAC 在自动模式下优先使用软件解码": "Lossless and Hi-Res require VIP / SVIP Cookie; standalone FLAC automatically prefers software decoder in Auto mode.",
1447
+ "标准 (128k)": "Standard (128k)",
1448
+ "较高 (192k)": "Higher (192k)",
1449
+ "极高 (320k,兼容性最佳)": "ExHigh (320k, Best Compatibility)",
1450
+ "无损 (FLAC,需 VIP)": "Lossless (FLAC, VIP)",
1451
+ "Hi-Res (FLAC,需 SVIP)": "Hi-Res (FLAC, SVIP)",
1452
+ "VIP 试听片段": "VIP Trial Previews",
1453
+ "遇到无完整权限的 VIP 歌曲时,是否允许播放 30 秒试听片段": "Whether to allow playing 30-second trial previews for VIP tracks without full access",
1454
+ "跳过试听(仅播放完整歌曲)": "Skip Previews (Full Tracks Only)",
1455
+ "允许播放 30 秒试听": "Allow 30s Previews",
1456
+ 播放器偏好: "Player Preference",
1457
+ 自动: "Auto",
1458
+ "系统播放器 (system)": "System Player (system)",
1459
+ "软件解码 (app)": "App Decoder (app)",
1460
+ 首页推荐: "Home",
1461
+ "每日推荐、推荐歌单与新歌精选": "Daily recommendations, featured playlists, and new songs",
1462
+ 筛选: "Filter",
1463
+ 全部: "All",
1464
+ 每日推荐: "Daily Picks",
1465
+ 歌曲: "Songs",
1466
+ 歌单: "Playlists",
1467
+ 页码: "Page",
1468
+ 排行榜: "Charts",
1469
+ 官方榜与全球精选榜单: "Official and global music charts",
1470
+ 分类: "Category",
1471
+ 官方榜: "Official Charts",
1472
+ 全球榜: "Global Charts",
1473
+ 新歌速递: "New Releases",
1474
+ 最新上架专辑与新歌速递: "Newly released albums and singles",
1475
+ 地区: "Region",
1476
+ 新专辑: "New Albums",
1477
+ 新歌: "New Songs",
1478
+ 华语: "Chinese",
1479
+ 欧美: "Western",
1480
+ 韩国: "Korean",
1481
+ 日本: "Japanese",
1482
+ 歌单分类: "Categories",
1483
+ "按语种、风格、场景与情感浏览歌单": "Browse playlists by language, genre, mood, and scene",
1484
+ "分类 ID": "Category ID",
1485
+ 分区: "Section",
1486
+ 专辑: "Albums",
1487
+ 偏移量: "Offset",
1488
+ 电台与漫游: "Radio & FM",
1489
+ "私人漫游、心动模式、私人雷达与榜单电台": "Personal FM, Heart Mode, Private Radar, and chart stations",
1490
+ "电台 ID": "Radio ID",
1491
+ 歌手: "Artists",
1492
+ 热门歌手与歌手主页: "Popular artists and artist profiles",
1493
+ "歌手 ID": "Artist ID",
1494
+ 歌手分区: "Artist Section",
1495
+ 资料: "Profile",
1496
+ 相似歌手: "Similar Artists",
1497
+ 我的音乐库: "My Library",
1498
+ "我喜欢的音乐、个人歌单、音乐云盘与听歌排行(需配置 Cookie)": "Liked songs, playlists, cloud drive, and listening ranks (Requires Cookie)",
1499
+ 我喜欢的音乐: "Liked Songs",
1500
+ 我的歌单: "My Playlists",
1501
+ 音乐云盘: "Cloud Drive",
1502
+ 最近一周听歌排行: "Weekly Top Played",
1503
+ 所有时间听歌排行: "All-Time Top Played",
1504
+ 搜索: "Search",
1505
+ "搜索歌曲、专辑、歌手与歌单": "Search songs, albums, artists, and playlists",
1506
+ 结果类型: "Result Type",
1507
+ "全部(音乐混合)": "All (Mixed Music)",
1508
+ 语种: "Language",
1509
+ 风格: "Genre",
1510
+ 主题: "Theme",
1511
+ 情感: "Mood",
1512
+ 场景: "Scene",
1513
+ 日语: "Japanese",
1514
+ 韩语: "Korean",
1515
+ 粤语: "Cantonese",
1516
+ 流行: "Pop",
1517
+ 摇滚: "Rock",
1518
+ 民谣: "Folk",
1519
+ 电子: "Electronic",
1520
+ 说唱: "Hip-Hop",
1521
+ 轻音乐: "Easy Listening",
1522
+ 爵士: "Jazz",
1523
+ 古典: "Classical",
1524
+ 古风: "Chinese Traditional",
1525
+ 影视原声: "Soundtrack",
1526
+ 游戏: "Gaming",
1527
+ 怀旧: "Nostalgic",
1528
+ 治愈: "Healing",
1529
+ 夜晚: "Night",
1530
+ 学习: "Study",
1531
+ 运动: "Workout",
1532
+ 驾车: "Driving",
1533
+ "私人漫游 · 默认": "Personal FM · Default",
1534
+ "根据你的听歌口味持续推荐(需配置 Cookie)": "Continuous recommendations tailored to your taste (Requires Cookie)",
1535
+ "私人漫游 · 熟悉": "Personal FM · Familiar",
1536
+ "重温你熟悉和喜欢的旋律(需配置 Cookie)": "Revisit familiar favorites (Requires Cookie)",
1537
+ "私人漫游 · 探索": "Personal FM · Explore",
1538
+ "发现新鲜小众好音乐(需配置 Cookie)": "Discover fresh tracks (Requires Cookie)",
1539
+ 心动模式: "Heart Mode",
1540
+ "以我喜欢的音乐为种子智能推荐(需配置 Cookie)": "Smart mix seeded from your liked songs (Requires Cookie)",
1541
+ 私人雷达: "Private Radar",
1542
+ 每日更新的个性化精选电台: "Daily updated personalized radar station",
1543
+ 首歌曲: "songs",
1544
+ 张专辑: "albums",
1545
+ 试听: "Preview",
1546
+ 未找到该专辑: "Album not found",
1547
+ 无法识别的详情链接: "Unrecognized detail link",
1548
+ "请在模块设置中填写包含 MUSIC_U 的网易云音乐 Cookie 后查看个人内容": "Please set your NetEase Cloud Music Cookie (including MUSIC_U) in module settings to view personal library",
1549
+ "私人漫游需要配置网易云音乐 Cookie(含 MUSIC_U)": "Personal FM requires a NetEase Cloud Music Cookie (including MUSIC_U)",
1550
+ "未找到「我喜欢的音乐」歌单,无法开启心动模式": "Could not find your Liked Songs playlist for Heart Mode",
1551
+ "「我喜欢的音乐」为空,请先收藏几首歌曲再使用心动模式": "Your Liked Songs playlist is empty; like some songs first",
1552
+ 网易云返回了无法解析的响应: "NetEase returned an unparseable response",
1553
+ 网易云返回了无效数据: "NetEase returned invalid data",
1554
+ "网易云登录状态已失效或需要登录,请检查 Cookie 配置": "NetEase session expired or login required; please check your Cookie",
1555
+ "网易云登录状态已失效或 Cookie 无效,请更新包含 MUSIC_U 的 Cookie": "NetEase session expired or invalid Cookie; please update MUSIC_U",
1556
+ "网易云暂时触发风控限制,请稍后重试": "NetEase temporarily rate-limited this request; please try again later",
1557
+ "网易云请求过于频繁,请稍后重试": "Too many requests to NetEase; please try again later",
1558
+ 网易云接口返回错误: "NetEase API returned an error",
1559
+ "当前歌曲暂无可用播放源,可能需要登录网易云黑胶 VIP 账号或受地区版权限制": "No playable audio stream found; VIP account or region availability may be required",
1560
+ "当前歌曲仅返回 30 秒 VIP 试听片段;请配置黑胶 VIP Cookie,或在模块设置中开启「允许播放 30 秒试听」": "Only a 30s VIP preview is available; provide a VIP Cookie or enable 30s previews in settings"
1561
+ },
1562
+ "zh-Hant": {
1563
+ 网易云音乐: "網易雲音樂",
1564
+ "网易云音乐 (测试)": "網易雲音樂 (測試)",
1565
+ "网易云音乐插件,支持首页推荐、排行榜、新歌速递、歌单分类、私人漫游、歌手主页、搜索、个人音乐库与直接音频播放": "網易雲音樂插件,支援首頁推薦、排行榜、新歌速遞、歌單分類、私人漫遊、歌手主頁、搜尋、個人音樂庫與直接音訊播放",
1566
+ "网易云音乐 Cookie(可选)": "網易雲音樂 Cookie(選填)",
1567
+ "可选。支持直接粘贴 MUSIC_U 值、完整 Cookie 请求头或 Copy as cURL;不填可直接使用公开曲库与免费歌曲,填写后解锁每日推荐、私人漫游、个人歌单、云盘与黑胶 VIP / 无损音质。": "選填。支援直接貼上 MUSIC_U 值、完整 Cookie 請求標頭或 Copy as cURL;不填可直接使用公開曲庫與免費歌曲,填寫後解鎖每日推薦、私人漫遊、個人歌單、雲端硬碟與黑膠 VIP / 無損音質。",
1568
+ 音质偏好: "音質偏好",
1569
+ "无损与 Hi-Res 需要黑胶 VIP / SVIP Cookie,FLAC 在自动模式下优先使用软件解码": "無損與 Hi-Res 需要黑膠 VIP / SVIP Cookie,FLAC 在自動模式下優先使用軟體解碼",
1570
+ "标准 (128k)": "標準 (128k)",
1571
+ "较高 (192k)": "較高 (192k)",
1572
+ "极高 (320k,兼容性最佳)": "極高 (320k,相容性最佳)",
1573
+ "无损 (FLAC,需 VIP)": "無損 (FLAC,需 VIP)",
1574
+ "Hi-Res (FLAC,需 SVIP)": "Hi-Res (FLAC,需 SVIP)",
1575
+ "VIP 试听片段": "VIP 試聽片段",
1576
+ "遇到无完整权限的 VIP 歌曲时,是否允许播放 30 秒试听片段": "遇到無完整權限的 VIP 歌曲時,是否允許播放 30 秒試聽片段",
1577
+ "跳过试听(仅播放完整歌曲)": "略過試聽(僅播放完整歌曲)",
1578
+ "允许播放 30 秒试听": "允許播放 30 秒試聽",
1579
+ 播放器偏好: "播放器偏好",
1580
+ 自动: "自動",
1581
+ "系统播放器 (system)": "系統播放器 (system)",
1582
+ "软件解码 (app)": "軟體解碼 (app)",
1583
+ 首页推荐: "首頁推薦",
1584
+ "每日推荐、推荐歌单与新歌精选": "每日推薦、推薦歌單與新歌精選",
1585
+ 筛选: "篩選",
1586
+ 全部: "全部",
1587
+ 每日推荐: "每日推薦",
1588
+ 歌曲: "歌曲",
1589
+ 歌单: "歌單",
1590
+ 页码: "頁碼",
1591
+ 排行榜: "排行榜",
1592
+ 官方榜与全球精选榜单: "官方榜與全球精選榜單",
1593
+ 分类: "分類",
1594
+ 官方榜: "官方榜",
1595
+ 全球榜: "全球榜",
1596
+ 新歌速递: "新歌速遞",
1597
+ 最新上架专辑与新歌速递: "最新上架專輯與新歌速遞",
1598
+ 地区: "地區",
1599
+ 新专辑: "新專輯",
1600
+ 新歌: "新歌",
1601
+ 华语: "華語",
1602
+ 欧美: "歐美",
1603
+ 韩国: "韓國",
1604
+ 日本: "日本",
1605
+ 歌单分类: "歌單分類",
1606
+ "按语种、风格、场景与情感浏览歌单": "按語種、風格、場景與情感瀏覽歌單",
1607
+ "分类 ID": "分類 ID",
1608
+ 分区: "分區",
1609
+ 专辑: "專輯",
1610
+ 偏移量: "偏移量",
1611
+ 电台与漫游: "電台與漫遊",
1612
+ "私人漫游、心动模式、私人雷达与榜单电台": "私人漫遊、心動模式、私人雷達與榜單電台",
1613
+ "电台 ID": "電台 ID",
1614
+ 歌手: "歌手",
1615
+ 热门歌手与歌手主页: "熱門歌手與歌手主頁",
1616
+ "歌手 ID": "歌手 ID",
1617
+ 歌手分区: "歌手分區",
1618
+ 资料: "資料",
1619
+ 相似歌手: "相似歌手",
1620
+ 我的音乐库: "我的音樂庫",
1621
+ "我喜欢的音乐、个人歌单、音乐云盘与听歌排行(需配置 Cookie)": "我喜歡的音樂、個人歌單、音樂雲端硬碟與聽歌排行(需設定 Cookie)",
1622
+ 我喜欢的音乐: "我喜歡的音樂",
1623
+ 我的歌单: "我的歌單",
1624
+ 音乐云盘: "音樂雲端硬碟",
1625
+ 最近一周听歌排行: "最近一週聽歌排行",
1626
+ 所有时间听歌排行: "所有時間聽歌排行",
1627
+ 搜索: "搜尋",
1628
+ "搜索歌曲、专辑、歌手与歌单": "搜尋歌曲、專輯、歌手與歌單",
1629
+ 结果类型: "結果類型",
1630
+ "全部(音乐混合)": "全部(音樂混合)",
1631
+ 语种: "語種",
1632
+ 风格: "風格",
1633
+ 主题: "主題",
1634
+ 情感: "情感",
1635
+ 场景: "場景",
1636
+ 日语: "日語",
1637
+ 韩语: "韓語",
1638
+ 粤语: "粵語",
1639
+ 流行: "流行",
1640
+ 摇滚: "搖滾",
1641
+ 民谣: "民謠",
1642
+ 电子: "電子",
1643
+ 说唱: "饒舌",
1644
+ 轻音乐: "輕音樂",
1645
+ 爵士: "爵士",
1646
+ 古典: "古典",
1647
+ 古风: "古風",
1648
+ 影视原声: "影視原聲",
1649
+ 游戏: "遊戲",
1650
+ 怀旧: "懷舊",
1651
+ 治愈: "治癒",
1652
+ 夜晚: "夜晚",
1653
+ 学习: "學習",
1654
+ 运动: "運動",
1655
+ 驾车: "駕車",
1656
+ "私人漫游 · 默认": "私人漫遊 · 預設",
1657
+ "根据你的听歌口味持续推荐(需配置 Cookie)": "根據你的聽歌口味持續推薦(需設定 Cookie)",
1658
+ "私人漫游 · 熟悉": "私人漫遊 · 熟悉",
1659
+ "重温你熟悉和喜欢的旋律(需配置 Cookie)": "重溫你熟悉和喜歡的旋律(需設定 Cookie)",
1660
+ "私人漫游 · 探索": "私人漫遊 · 探索",
1661
+ "发现新鲜小众好音乐(需配置 Cookie)": "發現新鮮小眾好音樂(需設定 Cookie)",
1662
+ 心动模式: "心動模式",
1663
+ "以我喜欢的音乐为种子智能推荐(需配置 Cookie)": "以我喜歡的音樂為種子智慧推薦(需設定 Cookie)",
1664
+ 私人雷达: "私人雷達",
1665
+ 每日更新的个性化精选电台: "每日更新的個人化精選電台",
1666
+ 首歌曲: "首歌曲",
1667
+ 张专辑: "張專輯",
1668
+ 试听: "試聽",
1669
+ 未找到该专辑: "找不到該專輯",
1670
+ 无法识别的详情链接: "無法識別的詳情連結",
1671
+ "请在模块设置中填写包含 MUSIC_U 的网易云音乐 Cookie 后查看个人内容": "請在模組設定中填寫包含 MUSIC_U 的網易雲音樂 Cookie 後檢視個人內容",
1672
+ "私人漫游需要配置网易云音乐 Cookie(含 MUSIC_U)": "私人漫遊需要設定網易雲音樂 Cookie(含 MUSIC_U)",
1673
+ "未找到「我喜欢的音乐」歌单,无法开启心动模式": "找不到「我喜歡的音樂」歌單,無法開啟心動模式",
1674
+ "「我喜欢的音乐」为空,请先收藏几首歌曲再使用心动模式": "「我喜歡的音樂」為空,請先收藏幾首歌曲再使用心動模式",
1675
+ 网易云返回了无法解析的响应: "網易雲回傳了無法解析的回應",
1676
+ 网易云返回了无效数据: "網易雲回傳了無效資料",
1677
+ "网易云登录状态已失效或需要登录,请检查 Cookie 配置": "網易雲登入狀態已失效或需要登入,請檢查 Cookie 設定",
1678
+ "网易云登录状态已失效或 Cookie 无效,请更新包含 MUSIC_U 的 Cookie": "網易雲登入狀態已失效或 Cookie 無效,請更新包含 MUSIC_U 的 Cookie",
1679
+ "网易云暂时触发风控限制,请稍后重试": "網易雲暫時觸發風控限制,請稍後重試",
1680
+ "网易云请求过于频繁,请稍后重试": "網易雲請求過於頻繁,請稍後重試",
1681
+ 网易云接口返回错误: "網易雲介面回傳錯誤",
1682
+ "当前歌曲暂无可用播放源,可能需要登录网易云黑胶 VIP 账号或受地区版权限制": "目前歌曲暫無可用播放來源,可能需要登入網易雲黑膠 VIP 帳號或受地區版權限制",
1683
+ "当前歌曲仅返回 30 秒 VIP 试听片段;请配置黑胶 VIP Cookie,或在模块设置中开启「允许播放 30 秒试听」": "目前歌曲僅回傳 30 秒 VIP 試聽片段;請設定黑膠 VIP Cookie,或在模組設定中開啟「允許播放 30 秒試聽」"
1684
+ }
1685
+ },
1686
+ globalParams: [
1687
+ {
1688
+ name: "cookie",
1689
+ title: "网易云音乐 Cookie(可选)",
1690
+ description: "可选。支持直接粘贴 MUSIC_U 值、完整 Cookie 请求头或 Copy as cURL;不填可直接使用公开曲库与免费歌曲,填写后解锁每日推荐、私人漫游、个人歌单、云盘与黑胶 VIP / 无损音质。",
1691
+ type: "input",
1692
+ value: ""
1693
+ },
1694
+ {
1695
+ name: "quality",
1696
+ title: "音质偏好",
1697
+ description: "无损与 Hi-Res 需要黑胶 VIP / SVIP Cookie,FLAC 在自动模式下优先使用软件解码",
1698
+ type: "enumeration",
1699
+ value: "exhigh",
1700
+ enumOptions: [
1701
+ {
1702
+ title: "标准 (128k)",
1703
+ value: "standard"
1704
+ },
1705
+ {
1706
+ title: "较高 (192k)",
1707
+ value: "higher"
1708
+ },
1709
+ {
1710
+ title: "极高 (320k,兼容性最佳)",
1711
+ value: "exhigh"
1712
+ },
1713
+ {
1714
+ title: "无损 (FLAC,需 VIP)",
1715
+ value: "lossless"
1716
+ },
1717
+ {
1718
+ title: "Hi-Res (FLAC,需 SVIP)",
1719
+ value: "hires"
1720
+ }
1721
+ ]
1722
+ },
1723
+ {
1724
+ name: "allowTrial",
1725
+ title: "VIP 试听片段",
1726
+ description: "遇到无完整权限的 VIP 歌曲时,是否允许播放 30 秒试听片段",
1727
+ type: "enumeration",
1728
+ value: "false",
1729
+ enumOptions: [
1730
+ {
1731
+ title: "跳过试听(仅播放完整歌曲)",
1732
+ value: "false"
1733
+ },
1734
+ {
1735
+ title: "允许播放 30 秒试听",
1736
+ value: "true"
1737
+ }
1738
+ ]
1739
+ },
1740
+ {
1741
+ name: "playerType",
1742
+ title: "播放器偏好",
1743
+ type: "enumeration",
1744
+ value: "auto",
1745
+ enumOptions: [
1746
+ {
1747
+ title: "自动",
1748
+ value: "auto"
1749
+ },
1750
+ {
1751
+ title: "系统播放器 (system)",
1752
+ value: "system"
1753
+ },
1754
+ {
1755
+ title: "软件解码 (app)",
1756
+ value: "app"
1757
+ }
1758
+ ]
1759
+ }
1760
+ ],
1761
+ modules: [
1762
+ {
1763
+ id: "home",
1764
+ title: "首页推荐",
1765
+ subtitle: "每日推荐、推荐歌单与新歌精选",
1766
+ type: "video",
1767
+ functionName: "loadHome",
1768
+ cacheDuration: 600,
1769
+ params: [
1770
+ {
1771
+ name: "filter",
1772
+ title: "筛选",
1773
+ type: "enumeration",
1774
+ value: "all",
1775
+ enumOptions: [
1776
+ {
1777
+ title: "全部",
1778
+ value: "all"
1779
+ },
1780
+ {
1781
+ title: "每日推荐",
1782
+ value: "daily"
1783
+ },
1784
+ {
1785
+ title: "歌曲",
1786
+ value: "songs"
1787
+ },
1788
+ {
1789
+ title: "歌单",
1790
+ value: "playlists"
1791
+ }
1792
+ ]
1793
+ },
1794
+ {
1795
+ name: "page",
1796
+ title: "页码",
1797
+ type: "page"
1798
+ }
1799
+ ]
1800
+ },
1801
+ {
1802
+ id: "charts",
1803
+ title: "排行榜",
1804
+ subtitle: "官方榜与全球精选榜单",
1805
+ type: "video",
1806
+ functionName: "loadCharts",
1807
+ cacheDuration: 3600,
1808
+ params: [
1809
+ {
1810
+ name: "category",
1811
+ title: "分类",
1812
+ type: "enumeration",
1813
+ value: "all",
1814
+ enumOptions: [
1815
+ {
1816
+ title: "全部",
1817
+ value: "all"
1818
+ },
1819
+ {
1820
+ title: "官方榜",
1821
+ value: "official"
1822
+ },
1823
+ {
1824
+ title: "全球榜",
1825
+ value: "global"
1826
+ }
1827
+ ]
1828
+ },
1829
+ {
1830
+ name: "page",
1831
+ title: "页码",
1832
+ type: "page"
1833
+ }
1834
+ ]
1835
+ },
1836
+ {
1837
+ id: "newReleases",
1838
+ title: "新歌速递",
1839
+ subtitle: "最新上架专辑与新歌速递",
1840
+ type: "video",
1841
+ functionName: "loadNewReleases",
1842
+ cacheDuration: 3600,
1843
+ params: [
1844
+ {
1845
+ name: "category",
1846
+ title: "分类",
1847
+ type: "enumeration",
1848
+ value: "albums",
1849
+ enumOptions: [
1850
+ {
1851
+ title: "新专辑",
1852
+ value: "albums"
1853
+ },
1854
+ {
1855
+ title: "新歌",
1856
+ value: "songs"
1857
+ }
1858
+ ]
1859
+ },
1860
+ {
1861
+ name: "area",
1862
+ title: "地区",
1863
+ type: "enumeration",
1864
+ value: "ALL",
1865
+ enumOptions: [
1866
+ {
1867
+ title: "全部",
1868
+ value: "ALL"
1869
+ },
1870
+ {
1871
+ title: "华语",
1872
+ value: "ZH"
1873
+ },
1874
+ {
1875
+ title: "欧美",
1876
+ value: "EA"
1877
+ },
1878
+ {
1879
+ title: "韩国",
1880
+ value: "KR"
1881
+ },
1882
+ {
1883
+ title: "日本",
1884
+ value: "JP"
1885
+ }
1886
+ ]
1887
+ },
1888
+ {
1889
+ name: "page",
1890
+ title: "页码",
1891
+ type: "page"
1892
+ }
1893
+ ]
1894
+ },
1895
+ {
1896
+ id: "musicGenres",
1897
+ title: "歌单分类",
1898
+ subtitle: "按语种、风格、场景与情感浏览歌单",
1899
+ type: "video",
1900
+ functionName: "loadGenres",
1901
+ cacheDuration: 3600,
1902
+ params: [
1903
+ {
1904
+ name: "genreId",
1905
+ title: "分类 ID",
1906
+ type: "input"
1907
+ },
1908
+ {
1909
+ name: "section",
1910
+ title: "分区",
1911
+ type: "enumeration",
1912
+ enumOptions: [
1913
+ {
1914
+ title: "歌单",
1915
+ value: "albums"
1916
+ },
1917
+ {
1918
+ title: "歌曲",
1919
+ value: "songs"
1920
+ }
1921
+ ]
1922
+ },
1923
+ {
1924
+ name: "page",
1925
+ title: "页码",
1926
+ type: "page"
1927
+ },
1928
+ {
1929
+ name: "offset",
1930
+ title: "偏移量",
1931
+ type: "offset"
1932
+ }
1933
+ ]
1934
+ },
1935
+ {
1936
+ id: "musicRadios",
1937
+ title: "电台与漫游",
1938
+ subtitle: "私人漫游、心动模式、私人雷达与榜单电台",
1939
+ type: "video",
1940
+ functionName: "loadRadios",
1941
+ cacheDuration: 300,
1942
+ params: [
1943
+ {
1944
+ name: "radioId",
1945
+ title: "电台 ID",
1946
+ type: "input"
1947
+ },
1948
+ {
1949
+ name: "section",
1950
+ title: "分区",
1951
+ type: "enumeration",
1952
+ enumOptions: [
1953
+ {
1954
+ title: "歌曲",
1955
+ value: "songs"
1956
+ },
1957
+ {
1958
+ title: "专辑",
1959
+ value: "albums"
1960
+ },
1961
+ {
1962
+ title: "歌手",
1963
+ value: "artists"
1964
+ }
1965
+ ]
1966
+ },
1967
+ {
1968
+ name: "page",
1969
+ title: "页码",
1970
+ type: "page"
1971
+ },
1972
+ {
1973
+ name: "offset",
1974
+ title: "偏移量",
1975
+ type: "offset"
1976
+ }
1977
+ ]
1978
+ },
1979
+ {
1980
+ id: "musicArtists",
1981
+ title: "歌手",
1982
+ subtitle: "热门歌手与歌手主页",
1983
+ type: "person",
1984
+ functionName: "loadArtists",
1985
+ cacheDuration: 3600,
1986
+ params: [
1987
+ {
1988
+ name: "peopleId",
1989
+ title: "歌手 ID",
1990
+ type: "input"
1991
+ },
1992
+ {
1993
+ name: "section",
1994
+ title: "歌手分区",
1995
+ type: "enumeration",
1996
+ enumOptions: [
1997
+ {
1998
+ title: "歌曲",
1999
+ value: "songs"
2000
+ },
2001
+ {
2002
+ title: "专辑",
2003
+ value: "albums"
2004
+ },
2005
+ {
2006
+ title: "资料",
2007
+ value: "profile"
2008
+ },
2009
+ {
2010
+ title: "相似歌手",
2011
+ value: "artists"
2012
+ }
2013
+ ]
2014
+ },
2015
+ {
2016
+ name: "page",
2017
+ title: "页码",
2018
+ type: "page"
2019
+ },
2020
+ {
2021
+ name: "offset",
2022
+ title: "偏移量",
2023
+ type: "offset"
2024
+ }
2025
+ ]
2026
+ },
2027
+ {
2028
+ id: "library",
2029
+ title: "我的音乐库",
2030
+ subtitle: "我喜欢的音乐、个人歌单、音乐云盘与听歌排行(需配置 Cookie)",
2031
+ type: "video",
2032
+ functionName: "loadLibrary",
2033
+ cacheDuration: 120,
2034
+ params: [
2035
+ {
2036
+ name: "tab",
2037
+ title: "分类",
2038
+ type: "enumeration",
2039
+ value: "liked",
2040
+ enumOptions: [
2041
+ {
2042
+ title: "我喜欢的音乐",
2043
+ value: "liked"
2044
+ },
2045
+ {
2046
+ title: "我的歌单",
2047
+ value: "playlists"
2048
+ },
2049
+ {
2050
+ title: "音乐云盘",
2051
+ value: "cloud"
2052
+ },
2053
+ {
2054
+ title: "最近一周听歌排行",
2055
+ value: "recent_week"
2056
+ },
2057
+ {
2058
+ title: "所有时间听歌排行",
2059
+ value: "recent_all"
2060
+ }
2061
+ ]
2062
+ },
2063
+ {
2064
+ name: "page",
2065
+ title: "页码",
2066
+ type: "page"
2067
+ }
2068
+ ]
2069
+ }
2070
+ ],
2071
+ search: {
2072
+ id: "search",
2073
+ title: "搜索",
2074
+ subtitle: "搜索歌曲、专辑、歌手与歌单",
2075
+ functionName: "search",
2076
+ params: [
2077
+ {
2078
+ name: "kind",
2079
+ title: "结果类型",
2080
+ type: "enumeration",
2081
+ value: "all",
2082
+ enumOptions: [
2083
+ {
2084
+ title: "全部(音乐混合)",
2085
+ value: "all"
2086
+ },
2087
+ {
2088
+ title: "歌曲",
2089
+ value: "songs"
2090
+ },
2091
+ {
2092
+ title: "专辑",
2093
+ value: "albums"
2094
+ },
2095
+ {
2096
+ title: "歌手",
2097
+ value: "artists"
2098
+ },
2099
+ {
2100
+ title: "歌单",
2101
+ value: "playlists"
2102
+ }
2103
+ ]
2104
+ },
2105
+ {
2106
+ name: "page",
2107
+ title: "页码",
2108
+ type: "page"
2109
+ }
2110
+ ]
2111
+ }
2112
+ }, loadHome = (e)=>ex(function*() {
2113
+ return eT(function*() {
2114
+ var t, i, r, n, a;
2115
+ let o = es(e), s = e.filter || "all", u = l(o.cookie).hasMusicU;
2116
+ if ("daily" === s) {
2117
+ let t = yield eS("/api/v3/discovery/recommend/songs", {}, o), i = G((Array.isArray(null == (a = t.data) ? void 0 : a.dailySongs) ? t.data.dailySongs : []).map(V).filter((e)=>null !== e).map(H));
2118
+ return ec(i), eR(i, e);
2119
+ }
2120
+ let d = {};
2121
+ ("all" === s || "songs" === s) && (u && (d.dailySongs = eS("/api/v3/discovery/recommend/songs", {}, o).then((e)=>{
2122
+ var t;
2123
+ return (Array.isArray(null == (t = e.data) ? void 0 : t.dailySongs) ? e.data.dailySongs : []).map(V).filter((e)=>null !== e);
2124
+ })), d.newSongs = eS("/api/personalized/newsong", {
2125
+ limit: 20
2126
+ }, o).then((e)=>(Array.isArray(e.result) ? e.result : []).map(V).filter((e)=>null !== e))), ("all" === s || "playlists" === s) && (u && (d.dailyPlaylists = eS("/api/v1/discovery/recommend/resource", {}, o).then((e)=>(Array.isArray(e.recommend) ? e.recommend : []).map(x).filter((e)=>null !== e))), d.recommendedPlaylists = eS("/api/personalized/playlist", {
2127
+ limit: 30
2128
+ }, o).then((e)=>(Array.isArray(e.result) ? e.result : []).map(x).filter((e)=>null !== e)));
2129
+ let [c, p, f, m] = yield Promise.allSettled([
2130
+ null != (t = d.dailySongs) ? t : Promise.resolve([]),
2131
+ null != (i = d.dailyPlaylists) ? i : Promise.resolve([]),
2132
+ null != (r = d.recommendedPlaylists) ? r : Promise.resolve([]),
2133
+ null != (n = d.newSongs) ? n : Promise.resolve([])
2134
+ ]), y = [];
2135
+ if ("fulfilled" === c.status) for (let e of c.value)y.push(H(e));
2136
+ if ("fulfilled" === p.status) for (let e of p.value)y.push(B(e));
2137
+ if ("fulfilled" === f.status) for (let e of f.value)y.push(B(e));
2138
+ if ("fulfilled" === m.status) for (let e of m.value)y.push(H(e));
2139
+ if (!y.length) {
2140
+ let e = [
2141
+ c,
2142
+ p,
2143
+ f,
2144
+ m
2145
+ ].find((e)=>"rejected" === e.status);
2146
+ if ((null == e ? void 0 : e.status) === "rejected") throw e.reason;
2147
+ }
2148
+ let g = G(y);
2149
+ return ec(g), eR(g, e);
2150
+ })();
2151
+ })(), loadCharts = (e)=>ex(function*() {
2152
+ return eT(function*() {
2153
+ let t = es(e), i = e.category || "all", r = yield eS("/api/toplist/detail", {}, t);
2154
+ return eR(G((Array.isArray(r.list) ? r.list : []).filter((e)=>{
2155
+ let t = "string" == typeof e.ToplistType && e.ToplistType.length > 0;
2156
+ return "official" === i ? t : "global" !== i || !t;
2157
+ }).map(x).filter((e)=>null !== e).map(B)), e);
2158
+ })();
2159
+ })(), loadNewReleases = (e)=>ex(function*() {
2160
+ return eT(function*() {
2161
+ var t;
2162
+ let i = es(e), r = e.category || "albums", l = "ZH" === (t = e.area) || "EA" === t || "KR" === t || "JP" === t ? t : "ALL", n = eN(e);
2163
+ if ("songs" === r) {
2164
+ let e = p[l], t = yield eS("/api/v1/discovery/new/songs", {
2165
+ areaId: e,
2166
+ total: !0
2167
+ }, i, {
2168
+ method: "POST"
2169
+ }), r = G((Array.isArray(t.data) ? t.data : []).map(V).filter((e)=>null !== e).map(H));
2170
+ return ec(r), r.slice(n, n + 30);
2171
+ }
2172
+ let a = yield eS("/api/album/new", {
2173
+ area: l,
2174
+ limit: 30,
2175
+ offset: n
2176
+ }, i);
2177
+ return G((Array.isArray(a.albums) ? a.albums : []).map(_).filter((e)=>null !== e).map(q));
2178
+ })();
2179
+ })(), loadGenres = (e)=>ex(function*() {
2180
+ return eT(function*() {
2181
+ let t = es(e), i = eL((e.genreId || "").trim(), v);
2182
+ if (!i) return eR(m.map((e)=>{
2183
+ var t;
2184
+ return {
2185
+ id: e.id,
2186
+ type: "url",
2187
+ mediaType: "genre",
2188
+ link: (t = e.id, `${v}${t}`),
2189
+ title: Widget.i18n(e.title),
2190
+ subtitle: Widget.i18n(e.subtitle),
2191
+ genreTitle: Widget.i18n(e.title)
2192
+ };
2193
+ }), e);
2194
+ let r = eN(e), l = e.section || "albums", n = yield eS("/api/playlist/list", {
2195
+ cat: i,
2196
+ order: "hot",
2197
+ limit: 30,
2198
+ offset: r,
2199
+ total: !0
2200
+ }, t), a = (Array.isArray(n.playlists) ? n.playlists : []).map(x).filter((e)=>null !== e);
2201
+ if ("songs" === l) {
2202
+ let e = a[0];
2203
+ if (!e) return [];
2204
+ let { tracks: i } = yield eE(e.id, t, 60), r = G(i.map(H));
2205
+ return ec(r), r;
2206
+ }
2207
+ return G(a.map(B));
2208
+ })();
2209
+ })(), loadRadios = (e)=>ex(function*() {
2210
+ return eT(function*() {
2211
+ let t = es(e), i = eL((e.radioId || "").trim(), b);
2212
+ if (!i) {
2213
+ let i = [
2214
+ {
2215
+ id: "fm:DEFAULT",
2216
+ type: "url",
2217
+ mediaType: "radio",
2218
+ link: k("fm:DEFAULT"),
2219
+ title: Widget.i18n("私人漫游 · 默认"),
2220
+ subtitle: Widget.i18n("根据你的听歌口味持续推荐(需配置 Cookie)")
2221
+ },
2222
+ {
2223
+ id: "fm:FAMILIAR",
2224
+ type: "url",
2225
+ mediaType: "radio",
2226
+ link: k("fm:FAMILIAR"),
2227
+ title: Widget.i18n("私人漫游 · 熟悉"),
2228
+ subtitle: Widget.i18n("重温你熟悉和喜欢的旋律(需配置 Cookie)")
2229
+ },
2230
+ {
2231
+ id: "fm:EXPLORE",
2232
+ type: "url",
2233
+ mediaType: "radio",
2234
+ link: k("fm:EXPLORE"),
2235
+ title: Widget.i18n("私人漫游 · 探索"),
2236
+ subtitle: Widget.i18n("发现新鲜小众好音乐(需配置 Cookie)")
2237
+ },
2238
+ {
2239
+ id: "heart",
2240
+ type: "url",
2241
+ mediaType: "radio",
2242
+ link: k("heart"),
2243
+ title: Widget.i18n("心动模式"),
2244
+ subtitle: Widget.i18n("以我喜欢的音乐为种子智能推荐(需配置 Cookie)")
2245
+ },
2246
+ {
2247
+ id: "radar",
2248
+ type: "url",
2249
+ mediaType: "radio",
2250
+ link: k("radar"),
2251
+ title: Widget.i18n("私人雷达"),
2252
+ subtitle: Widget.i18n("每日更新的个性化精选电台")
2253
+ }
2254
+ ];
2255
+ try {
2256
+ let e = yield eS("/api/toplist/detail", {}, t);
2257
+ for (let t of (Array.isArray(e.list) ? e.list : []).map(x).filter((e)=>null !== e).slice(0, 8))i.push(e$({
2258
+ id: `pl:${t.id}`,
2259
+ type: "url",
2260
+ mediaType: "radio",
2261
+ link: k(`pl:${t.id}`),
2262
+ title: t.name
2263
+ }, t.owner ? {
2264
+ subtitle: t.owner
2265
+ } : {}, t.imageUrl ? {
2266
+ posterPath: t.imageUrl,
2267
+ coverUrl: t.imageUrl
2268
+ } : {}));
2269
+ } catch (e) {}
2270
+ return eR(i, e);
2271
+ }
2272
+ let r = [];
2273
+ if ("fm:DEFAULT" === i || "fm:FAMILIAR" === i || "fm:EXPLORE" === i) {
2274
+ let e = i.slice(3), [l, n] = yield Promise.allSettled([
2275
+ eW(e, t),
2276
+ eW(e, t)
2277
+ ]);
2278
+ if ("fulfilled" === l.status && r.push(...l.value), "fulfilled" === n.status && r.push(...n.value), !r.length && "rejected" === l.status) throw l.reason;
2279
+ } else if ("heart" === i) r = yield eT(function*() {
2280
+ let { uid: e } = yield eU(t), i = yield eS("/api/user/playlist", {
2281
+ uid: e,
2282
+ limit: 30,
2283
+ offset: 0
2284
+ }, t), r = (Array.isArray(i.playlist) ? i.playlist : []).find((e)=>5 === Number(e.specialType)), l = (null == r ? void 0 : r.id) ? String(r.id) : "";
2285
+ if (!l) throw Error(Widget.i18n("未找到「我喜欢的音乐」歌单,无法开启心动模式"));
2286
+ let { tracks: n } = yield eE(l, t, 50), a = n[Math.floor(Math.random() * n.length)];
2287
+ if (!a) throw Error(Widget.i18n("「我喜欢的音乐」为空,请先收藏几首歌曲再使用心动模式"));
2288
+ let o = yield eO("/api/playmode/intelligence/list", {
2289
+ songId: a.id,
2290
+ startMusicId: a.id,
2291
+ playlistId: l,
2292
+ type: "fromPlayOne",
2293
+ count: 30
2294
+ }, t), s = (Array.isArray(o.data) ? o.data : []).map((e)=>V(null == e ? void 0 : e.songInfo)).filter((e)=>null !== e);
2295
+ return s.length ? s : n;
2296
+ })();
2297
+ else "radar" === i ? r = (yield eE("3136952023", t, 60)).tracks : i.startsWith("pl:") && P(i.slice(3)) ? r = (yield eE(i.slice(3), t, 60)).tracks : P(i) && (r = (yield eE(i, t, 60)).tracks);
2298
+ let l = e.section || "songs";
2299
+ if ("artists" === l) return eR(G(r.flatMap((e)=>e.artists).filter((e)=>e.id).map((e)=>z(e))), e);
2300
+ if ("albums" === l) return eR(G(r.flatMap((e)=>{
2301
+ var t;
2302
+ return (null == (t = e.album) ? void 0 : t.id) ? [
2303
+ q({
2304
+ id: e.album.id,
2305
+ name: e.album.name,
2306
+ imageUrl: e.album.imageUrl || e.imageUrl,
2307
+ artists: e.artists
2308
+ })
2309
+ ] : [];
2310
+ })), e);
2311
+ let n = G(r.map(H));
2312
+ return ec(n), eR(n, e);
2313
+ })();
2314
+ })(), loadArtists = (e)=>ex(function*() {
2315
+ return eT(function*() {
2316
+ let t = es(e), i = (e.peopleId || "").trim(), r = eN(e);
2317
+ if (!i) {
2318
+ let e = yield eS("/api/artist/top", {
2319
+ limit: 30,
2320
+ offset: r
2321
+ }, t);
2322
+ return G((Array.isArray(e.artists) ? e.artists : []).map(W).filter((e)=>null !== e && !!e.id).map((e)=>z(e)));
2323
+ }
2324
+ if (!P(i)) return [];
2325
+ if ("profile" === e.section) {
2326
+ let e = yield eS(`/api/v1/artist/${i}`, {}, t), r = W(e.artist);
2327
+ if (!r) return [];
2328
+ let l = e.artist || {}, n = "string" == typeof l.briefDesc ? l.briefDesc.trim() : "", a = Number(l.musicSize) || 0, o = Number(l.albumSize) || 0;
2329
+ return [
2330
+ z(r, [
2331
+ [
2332
+ a > 0 ? `${a} ${Widget.i18n("首歌曲")}` : "",
2333
+ o > 0 ? `${o} ${Widget.i18n("张专辑")}` : ""
2334
+ ].filter(Boolean).join(" · "),
2335
+ n
2336
+ ].filter(Boolean).join("\n") || void 0)
2337
+ ];
2338
+ }
2339
+ if ("albums" === e.section) {
2340
+ let e = yield eS(`/api/artist/albums/${i}`, {
2341
+ limit: 30,
2342
+ offset: r
2343
+ }, t);
2344
+ return G((Array.isArray(e.hotAlbums) ? e.hotAlbums : []).map(_).filter((e)=>null !== e).map(q));
2345
+ }
2346
+ if ("artists" === e.section) try {
2347
+ let r = yield eS("/api/discovery/simiArtist", {
2348
+ artistid: i
2349
+ }, t, {
2350
+ method: "POST"
2351
+ }), l = (Array.isArray(r.artists) ? r.artists : []).map(W).filter((e)=>null !== e && !!e.id && e.id !== i);
2352
+ return eR(G(l.map((e)=>z(e))), e);
2353
+ } catch (e) {
2354
+ return [];
2355
+ }
2356
+ if (0 === r) {
2357
+ let e = yield eS(`/api/v1/artist/${i}`, {}, t), r = (Array.isArray(e.hotSongs) ? e.hotSongs : []).map(V).filter((e)=>null !== e);
2358
+ if (r.length) {
2359
+ let e = G(r.map(H));
2360
+ return ec(e), e.slice(0, 30);
2361
+ }
2362
+ }
2363
+ let l = yield eS("/api/v1/artist/songs", {
2364
+ id: i,
2365
+ order: "hot",
2366
+ limit: 30,
2367
+ offset: r
2368
+ }, t, {
2369
+ method: "POST"
2370
+ }), n = G((Array.isArray(l.songs) ? l.songs : []).map(V).filter((e)=>null !== e).map(H));
2371
+ return ec(n), n;
2372
+ })();
2373
+ })(), loadLibrary = (e)=>ex(function*() {
2374
+ return eT(function*() {
2375
+ var t;
2376
+ let i = es(e), r = e.tab || "liked", l = eN(e), { uid: n } = yield eU(i);
2377
+ if ("cloud" === r) {
2378
+ let e = yield eO("/api/v1/cloud/get", {
2379
+ limit: 30,
2380
+ offset: l
2381
+ }, i), t = [];
2382
+ for (let i of Array.isArray(e.data) ? e.data : []){
2383
+ let e = V(i.simpleSong);
2384
+ if (e) {
2385
+ t.push(e);
2386
+ continue;
2387
+ }
2388
+ let r = i.songId ? String(i.songId) : "";
2389
+ P(r) && t.push({
2390
+ id: r,
2391
+ name: i.songName || r,
2392
+ artists: i.artist ? [
2393
+ {
2394
+ id: "",
2395
+ name: i.artist
2396
+ }
2397
+ ] : [],
2398
+ album: i.album ? {
2399
+ id: "",
2400
+ name: i.album
2401
+ } : void 0,
2402
+ duration: 0
2403
+ });
2404
+ }
2405
+ let r = G(t.map(H));
2406
+ return ec(r), r;
2407
+ }
2408
+ if ("recent_week" === r || "recent_all" === r) {
2409
+ let t = +("recent_week" === r), l = yield eS("/api/v1/play/record", {
2410
+ uid: n,
2411
+ type: t
2412
+ }, i, {
2413
+ method: "POST"
2414
+ }), a = 1 === t ? l.weekData : l.allData, o = G((Array.isArray(a) ? a : []).map((e)=>V(null == e ? void 0 : e.song)).filter((e)=>null !== e).map(H));
2415
+ return ec(o), eR(o, e);
2416
+ }
2417
+ let a = yield eS("/api/user/playlist", {
2418
+ uid: n,
2419
+ limit: 30,
2420
+ offset: "playlists" === r ? l : 0
2421
+ }, i), o = Array.isArray(a.playlist) ? a.playlist : [];
2422
+ if ("playlists" === r) return G(o.map(x).filter((e)=>null !== e).map(B));
2423
+ let s = null != (t = o.find((e)=>5 === Number(e.specialType))) ? t : o[0], u = (null == s ? void 0 : s.id) ? String(s.id) : "";
2424
+ if (!u) return [];
2425
+ let { tracks: d } = yield eE(u, i, 300), c = G(d.map(H));
2426
+ return ec(c), eR(c, e);
2427
+ })();
2428
+ })(), search = (e)=>ex(function*() {
2429
+ return eT(function*() {
2430
+ var t, i, r, l, n, a, o, s, u;
2431
+ let d = es(e), c = (e.keyword || "").trim();
2432
+ if (!c) return [];
2433
+ let p = e.kind || "all", m = eD(e.page), y = eN(e);
2434
+ if ("all" === p) {
2435
+ if (1 === m && 0 === y) {
2436
+ let [e, t, i, o] = yield Promise.allSettled([
2437
+ eS("/api/cloudsearch/pc", {
2438
+ s: c,
2439
+ type: f.songs,
2440
+ limit: 20,
2441
+ offset: 0,
2442
+ total: !0
2443
+ }, d, {
2444
+ method: "POST"
2445
+ }),
2446
+ eS("/api/cloudsearch/pc", {
2447
+ s: c,
2448
+ type: f.artists,
2449
+ limit: 4,
2450
+ offset: 0,
2451
+ total: !0
2452
+ }, d, {
2453
+ method: "POST"
2454
+ }),
2455
+ eS("/api/cloudsearch/pc", {
2456
+ s: c,
2457
+ type: f.albums,
2458
+ limit: 4,
2459
+ offset: 0,
2460
+ total: !0
2461
+ }, d, {
2462
+ method: "POST"
2463
+ }),
2464
+ eS("/api/cloudsearch/pc", {
2465
+ s: c,
2466
+ type: f.playlists,
2467
+ limit: 4,
2468
+ offset: 0,
2469
+ total: !0
2470
+ }, d, {
2471
+ method: "POST"
2472
+ })
2473
+ ]), s = [];
2474
+ if ("fulfilled" === t.status) for (let e of (Array.isArray(null == (r = t.value.result) ? void 0 : r.artists) ? t.value.result.artists : []).map(W).filter((e)=>null !== e && !!e.id))s.push(z(e));
2475
+ if ("fulfilled" === i.status) for (let e of (Array.isArray(null == (l = i.value.result) ? void 0 : l.albums) ? i.value.result.albums : []).map(_).filter((e)=>null !== e))s.push(q(e));
2476
+ if ("fulfilled" === e.status) for (let t of (Array.isArray(null == (n = e.value.result) ? void 0 : n.songs) ? e.value.result.songs : []).map(V).filter((e)=>null !== e))s.push(H(t));
2477
+ if ("fulfilled" === o.status) for (let e of (Array.isArray(null == (a = o.value.result) ? void 0 : a.playlists) ? o.value.result.playlists : []).map(x).filter((e)=>null !== e))s.push(B(e));
2478
+ if (!s.length && "rejected" === e.status) throw e.reason;
2479
+ let u = G(s);
2480
+ return ec(u), u;
2481
+ }
2482
+ let e = Math.max(20, (m - 1) * 20), t = yield eS("/api/cloudsearch/pc", {
2483
+ s: c,
2484
+ type: f.songs,
2485
+ limit: 20,
2486
+ offset: e,
2487
+ total: !0
2488
+ }, d, {
2489
+ method: "POST"
2490
+ }), o = G((Array.isArray(null == (i = t.result) ? void 0 : i.songs) ? t.result.songs : []).map(V).filter((e)=>null !== e).map(H));
2491
+ return ec(o), o;
2492
+ }
2493
+ let g = f[p], h = yield eS("/api/cloudsearch/pc", {
2494
+ s: c,
2495
+ type: g,
2496
+ limit: 30,
2497
+ offset: y,
2498
+ total: !0
2499
+ }, d, {
2500
+ method: "POST"
2501
+ });
2502
+ if ("songs" === p) {
2503
+ let e = G((Array.isArray(null == (o = h.result) ? void 0 : o.songs) ? h.result.songs : []).map(V).filter((e)=>null !== e).map(H));
2504
+ return ec(e), e;
2505
+ }
2506
+ return "albums" === p ? G((Array.isArray(null == (s = h.result) ? void 0 : s.albums) ? h.result.albums : []).map(_).filter((e)=>null !== e).map(q)) : "artists" === p ? G((Array.isArray(null == (u = h.result) ? void 0 : u.artists) ? h.result.artists : []).map(W).filter((e)=>null !== e && !!e.id).map((e)=>z(e))) : G((Array.isArray(null == (t = h.result) ? void 0 : t.playlists) ? h.result.playlists : []).map(x).filter((e)=>null !== e).map(B));
2507
+ })();
2508
+ })(), loadDetail = (e)=>ex(function*() {
2509
+ return eT(function*() {
2510
+ var t, i, r;
2511
+ let l = function(e) {
2512
+ let t = (e || "").trim();
2513
+ if (!t) return null;
2514
+ if (t.startsWith(y)) {
2515
+ let e = t.slice(y.length).trim();
2516
+ return P(e) ? {
2517
+ kind: "song",
2518
+ id: e
2519
+ } : null;
2520
+ }
2521
+ if (t.startsWith(g)) {
2522
+ let e = t.slice(g.length).trim();
2523
+ return P(e) ? {
2524
+ kind: "album",
2525
+ id: e
2526
+ } : null;
2527
+ }
2528
+ if (t.startsWith(h)) {
2529
+ let e = t.slice(h.length).trim();
2530
+ return P(e) ? {
2531
+ kind: "playlist",
2532
+ id: e
2533
+ } : null;
2534
+ }
2535
+ let i = /music\.163\.com\/(?:#\/)?(song|album|playlist)\?[^#]*\bid=(\d{1,20})\b/i.exec(t);
2536
+ return (null == i ? void 0 : i[1]) && i[2] ? {
2537
+ kind: i[1].toLowerCase(),
2538
+ id: i[2]
2539
+ } : null;
2540
+ }(e);
2541
+ if (!l) throw Error(`${Widget.i18n("无法识别的详情链接")}: ${e}`);
2542
+ let n = eo();
2543
+ return "song" === l.kind ? (t = l.id, eT(function*() {
2544
+ var e, i, r, l;
2545
+ let o, u = (o = ei(ee)) && "object" == typeof o && null != (i = o[t]) ? i : null, [d, p] = yield Promise.all([
2546
+ ef(function*() {
2547
+ var e, i, r;
2548
+ let l = function(e, t, i, r = Date.now()) {
2549
+ let l = ei(Q);
2550
+ if (!l || "object" != typeof l) return null;
2551
+ let n = l[`${e}:${t}:${i ? "1" : "0"}`];
2552
+ return !n || "string" != typeof n.url || "number" != typeof n.cachedAt || r - n.cachedAt > 900000 ? null : n;
2553
+ }(t, n.quality, n.allowTrial);
2554
+ if (l) return {
2555
+ url: l.url,
2556
+ format: l.format,
2557
+ level: l.level,
2558
+ bitrate: l.bitrate,
2559
+ isTrial: l.isTrial,
2560
+ headers: {
2561
+ "User-Agent": s,
2562
+ Referer: `${a}/`
2563
+ }
2564
+ };
2565
+ let o = "lossless" === n.quality || "hires" === n.quality ? "flac" : "mp3", u = [];
2566
+ try {
2567
+ let e = yield ew(()=>eO("/api/song/enhance/player/url/v1", {
2568
+ ids: `[${t}]`,
2569
+ level: n.quality,
2570
+ encodeType: o
2571
+ }, n), 3);
2572
+ u = Array.isArray(e.data) ? e.data : [];
2573
+ } catch (i) {
2574
+ if (!eC(i)) throw i;
2575
+ let e = yield ew(()=>eO("/api/song/enhance/player/url", {
2576
+ ids: `[${t}]`,
2577
+ br: c[n.quality] || 320000
2578
+ }, n), 2);
2579
+ u = Array.isArray(e.data) ? e.data : [];
2580
+ }
2581
+ let d = null != (r = (i = u).find((e)=>String(e.id) === t)) ? r : i[0], p = A(null != (e = null == d ? void 0 : d.url) ? e : void 0), f = (null == d ? void 0 : d.freeTrialInfo) !== null && (null == d ? void 0 : d.freeTrialInfo) !== void 0;
2582
+ if (!d || !p || void 0 !== d.code && 200 !== d.code) throw Error(Widget.i18n("当前歌曲暂无可用播放源,可能需要登录网易云黑胶 VIP 账号或受地区版权限制"));
2583
+ if (f && !n.allowTrial) throw Error(Widget.i18n("当前歌曲仅返回 30 秒 VIP 试听片段;请配置黑胶 VIP Cookie,或在模块设置中开启「允许播放 30 秒试听」"));
2584
+ let m = (d.type || ("lossless" === d.level || "hires" === d.level ? "flac" : "mp3")).toLowerCase(), y = ev.has(m) ? m : "mp3", g = "string" == typeof d.level && d.level ? d.level : n.quality, h = "number" == typeof d.br && Number.isFinite(d.br) ? d.br : 0;
2585
+ return !function(e, t, i, r, l = Date.now()) {
2586
+ var n, a;
2587
+ let o = ei(Q), s = o && "object" == typeof o ? J({}, o) : {}, u = `${e}:${t}:${i ? "1" : "0"}`;
2588
+ delete s[u], s[u] = (n = J({}, r), a = a = {
2589
+ cachedAt: l
2590
+ }, Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(a)) : (function(e) {
2591
+ var t = Object.keys(e);
2592
+ if (Object.getOwnPropertySymbols) {
2593
+ var i = Object.getOwnPropertySymbols(e);
2594
+ t.push.apply(t, i);
2595
+ }
2596
+ return t;
2597
+ })(Object(a)).forEach(function(e) {
2598
+ Object.defineProperty(n, e, Object.getOwnPropertyDescriptor(a, e));
2599
+ }), n);
2600
+ let d = Object.keys(s);
2601
+ if (d.length > 50) for (let e of d.slice(0, d.length - 50))delete s[e];
2602
+ er(Q, s);
2603
+ }(t, n.quality, n.allowTrial, {
2604
+ url: p,
2605
+ format: y,
2606
+ level: g,
2607
+ bitrate: h,
2608
+ isTrial: f
2609
+ }), {
2610
+ url: p,
2611
+ format: y,
2612
+ level: g,
2613
+ bitrate: h,
2614
+ isTrial: f,
2615
+ headers: {
2616
+ "User-Agent": s,
2617
+ Referer: `${a}/`
2618
+ }
2619
+ };
2620
+ })(),
2621
+ u ? Promise.resolve(null) : eI([
2622
+ t
2623
+ ], n).then((e)=>{
2624
+ var t;
2625
+ return null != (t = e[0]) ? t : null;
2626
+ }).catch(()=>null)
2627
+ ]);
2628
+ if (!u && p) {
2629
+ let e = H(p);
2630
+ ec([
2631
+ e
2632
+ ]), u = {
2633
+ id: t,
2634
+ title: e.title,
2635
+ subtitle: e.subtitle,
2636
+ posterPath: e.posterPath,
2637
+ coverUrl: e.coverUrl,
2638
+ duration: e.duration,
2639
+ durationText: e.durationText,
2640
+ peoples: e.peoples
2641
+ };
2642
+ }
2643
+ let f = (null == u ? void 0 : u.duration) || 0, m = f > 0 ? E(f) : null == u ? void 0 : u.durationText, g = (null == u ? void 0 : u.posterPath) || (null == u ? void 0 : u.coverUrl), h = (r = n.playerType, l = d.format, "system" === r || "app" === r ? r : "flac" === l.toLowerCase() ? "app" : void 0), v = [
2644
+ (null == u ? void 0 : u.subtitle) || "",
2645
+ d.isTrial ? Widget.i18n("试听") : ""
2646
+ ].filter(Boolean);
2647
+ return e$(ej(e$({
2648
+ id: t,
2649
+ type: "url",
2650
+ mediaType: "song",
2651
+ link: `${y}${t}`,
2652
+ title: (null == u ? void 0 : u.title) || t
2653
+ }, v.length ? {
2654
+ subtitle: v.join(" · ")
2655
+ } : {}, g ? {
2656
+ posterPath: g,
2657
+ coverUrl: g
2658
+ } : {}, f > 0 ? e$({
2659
+ duration: f
2660
+ }, m ? {
2661
+ durationText: m
2662
+ } : {}) : {}, (null == u || null == (e = u.peoples) ? void 0 : e.length) ? {
2663
+ peoples: u.peoples
2664
+ } : {}), {
2665
+ videoUrl: d.url,
2666
+ customHeaders: d.headers
2667
+ }), h ? {
2668
+ playerType: h
2669
+ } : {});
2670
+ })()) : "album" === l.kind ? (i = l.id, eT(function*() {
2671
+ let e = yield eS(`/api/v1/album/${i}`, {}, n), t = _(e.album);
2672
+ if (!t) throw Error(Widget.i18n("未找到该专辑"));
2673
+ let r = (Array.isArray(e.songs) ? e.songs : []).map(V).filter((e)=>null !== e).map((e)=>ej(e$({}, e), {
2674
+ artists: e.artists.length ? e.artists : t.artists,
2675
+ album: {
2676
+ id: t.id,
2677
+ name: t.name,
2678
+ imageUrl: t.imageUrl
2679
+ },
2680
+ imageUrl: e.imageUrl || t.imageUrl
2681
+ })).map(H);
2682
+ ec(r);
2683
+ let l = t.artists.map((e)=>e.name).filter(Boolean).join(" / "), a = F(t.artists), o = C(t.imageUrl);
2684
+ return ej(e$({
2685
+ id: t.id,
2686
+ type: "url",
2687
+ mediaType: "album",
2688
+ link: `ncm:album:${t.id}`,
2689
+ title: t.name
2690
+ }, l ? {
2691
+ subtitle: l
2692
+ } : {}, o ? {
2693
+ posterPath: o,
2694
+ coverUrl: o
2695
+ } : {}, t.released ? {
2696
+ releaseDate: t.released
2697
+ } : {}, t.description ? {
2698
+ description: t.description
2699
+ } : {}, a ? {
2700
+ peoples: a
2701
+ } : {}), {
2702
+ tracks: r
2703
+ });
2704
+ })()) : (r = l.id, eT(function*() {
2705
+ var e;
2706
+ let { playlist: t, tracks: i } = yield eE(r, n, 300), l = i.map(H);
2707
+ return ec(l), ej(e$({
2708
+ id: t.id,
2709
+ type: "url",
2710
+ mediaType: "playlist",
2711
+ link: (e = t.id, `${h}${e}`),
2712
+ title: t.name
2713
+ }, t.owner ? {
2714
+ subtitle: t.owner
2715
+ } : {}, t.imageUrl ? {
2716
+ posterPath: t.imageUrl,
2717
+ coverUrl: t.imageUrl
2718
+ } : {}, t.description ? {
2719
+ description: t.description
2720
+ } : {}), {
2721
+ tracks: l
2722
+ });
2723
+ })());
2724
+ })();
2725
+ })();