@khang07/zing-mp3-api 1.3.4 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +388 -442
- package/dist/cjs/index.cjs +70 -62
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/utils/refined.cjs +11 -1
- package/dist/cjs/utils/refined.cjs.map +1 -1
- package/dist/esm/index.js +70 -62
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/refined.js +11 -1
- package/dist/esm/utils/refined.js.map +1 -1
- package/dist/types/index.d.ts +5 -5
- package/dist/types/types/raw.d.ts +4 -1
- package/dist/types/types/response.d.ts +6 -3
- package/package.json +3 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -20,6 +20,7 @@ const isURL = (value) => {
|
|
|
20
20
|
return false;
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
+
const ensureCookies = async (instance) => await instance.get('/');
|
|
23
24
|
class Client {
|
|
24
25
|
static BASE_URL = 'https://zingmp3.vn/';
|
|
25
26
|
static VERSION_URL_V1 = '1.6.34';
|
|
@@ -49,11 +50,18 @@ class Client {
|
|
|
49
50
|
maxHighWaterMark;
|
|
50
51
|
userAgent;
|
|
51
52
|
jar;
|
|
52
|
-
constructor(options
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
constructor(options) {
|
|
54
|
+
const mergedOptions = {
|
|
55
|
+
maxLoad: 1024 * 1024,
|
|
56
|
+
maxHighWaterMark: 16 * 1024,
|
|
57
|
+
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
|
|
58
|
+
jar: new cookies.Cookies(),
|
|
59
|
+
...options
|
|
60
|
+
};
|
|
61
|
+
this.maxLoad = mergedOptions.maxLoad;
|
|
62
|
+
this.maxHighWaterMark = mergedOptions.maxHighWaterMark;
|
|
63
|
+
this.userAgent = mergedOptions.userAgent;
|
|
64
|
+
this.jar = mergedOptions.jar;
|
|
57
65
|
this.instance = axios.create({
|
|
58
66
|
baseURL: Client.BASE_URL,
|
|
59
67
|
params: {
|
|
@@ -61,14 +69,12 @@ class Client {
|
|
|
61
69
|
apiKey: Client.API_KEY_V1,
|
|
62
70
|
ctime: this.ctime
|
|
63
71
|
},
|
|
64
|
-
maxRate: this.maxLoad
|
|
65
|
-
headers: {
|
|
66
|
-
'User-Agent': this.userAgent
|
|
67
|
-
}
|
|
72
|
+
maxRate: this.maxLoad
|
|
68
73
|
});
|
|
69
74
|
this.instance.interceptors.request.use(async (options) => {
|
|
70
75
|
const base = options.baseURL ?? '';
|
|
71
76
|
const url = new node_url.URL(options.url ?? '/', base).toString();
|
|
77
|
+
options.headers.set('User-Agent', this.userAgent);
|
|
72
78
|
const additionalHeaders = this.jar.applyToHeaders(url);
|
|
73
79
|
for (const [key, value] of Object.entries(additionalHeaders))
|
|
74
80
|
options.headers.set(key, value);
|
|
@@ -82,9 +88,19 @@ class Client {
|
|
|
82
88
|
return response.data;
|
|
83
89
|
});
|
|
84
90
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
setOptions(options) {
|
|
92
|
+
const mergedOptions = {
|
|
93
|
+
maxLoad: this.maxLoad,
|
|
94
|
+
maxHighWaterMark: this.maxHighWaterMark,
|
|
95
|
+
userAgent: this.userAgent,
|
|
96
|
+
jar: this.jar,
|
|
97
|
+
...options
|
|
98
|
+
};
|
|
99
|
+
this.maxLoad = mergedOptions.maxLoad;
|
|
100
|
+
this.maxHighWaterMark = mergedOptions.maxHighWaterMark;
|
|
101
|
+
this.userAgent = mergedOptions.userAgent;
|
|
102
|
+
this.jar = mergedOptions.jar;
|
|
103
|
+
this.instance.defaults.maxRate = mergedOptions.maxLoad;
|
|
88
104
|
}
|
|
89
105
|
async video(videoID) {
|
|
90
106
|
const value = videoID instanceof node_url.URL ? videoID.toString() : videoID;
|
|
@@ -92,7 +108,7 @@ class Client {
|
|
|
92
108
|
throw new lapse.Lapse('ID must be a non-empty string', 'ERROR_INVALID_ID');
|
|
93
109
|
try {
|
|
94
110
|
videoID = isURL(value) ? Client.getIDFromURL(value) : value;
|
|
95
|
-
void await this.
|
|
111
|
+
void await ensureCookies(this.instance);
|
|
96
112
|
const response = await this.instance.get(Client.API_VIDEO_PATH, {
|
|
97
113
|
params: {
|
|
98
114
|
id: videoID,
|
|
@@ -100,11 +116,13 @@ class Client {
|
|
|
100
116
|
}
|
|
101
117
|
});
|
|
102
118
|
if (response.err !== 0)
|
|
103
|
-
throw new lapse.Lapse('Video could not be found', 'ERROR_VIDEO_NOT_FOUND', response.err
|
|
119
|
+
throw new lapse.Lapse('Video could not be found', 'ERROR_VIDEO_NOT_FOUND', response.err);
|
|
104
120
|
const videoURL = response.data?.streaming?.hls?.['720p'] || response.data?.streaming?.hls?.['360p'];
|
|
105
121
|
if (!videoURL || !videoURL.length)
|
|
106
122
|
throw new lapse.Lapse('Streaming URL not found', 'ERROR_STREAM_URL_NOT_FOUND');
|
|
107
|
-
const source = m3u8stream(videoURL
|
|
123
|
+
const source = m3u8stream(videoURL, {
|
|
124
|
+
highWaterMark: this.maxHighWaterMark
|
|
125
|
+
});
|
|
108
126
|
source.once('error', (error) => {
|
|
109
127
|
const lapse$1 = new lapse.Lapse('Stream download failed', 'ERROR_STREAM_DOWNLOAD', void 0, error);
|
|
110
128
|
source.destroy(lapse$1);
|
|
@@ -112,9 +130,8 @@ class Client {
|
|
|
112
130
|
return source;
|
|
113
131
|
}
|
|
114
132
|
catch (error) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
throw new lapse.Lapse('Failed to fetch video stream', 'ERROR_VIDEO_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
133
|
+
const lapse$1 = error instanceof lapse.Lapse ? error : new lapse.Lapse('Failed to fetch video stream', 'ERROR_VIDEO_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
134
|
+
throw lapse$1;
|
|
118
135
|
}
|
|
119
136
|
}
|
|
120
137
|
videoSync(videoID) {
|
|
@@ -163,7 +180,7 @@ class Client {
|
|
|
163
180
|
throw new lapse.Lapse('ID must be a non-empty string', 'ERROR_INVALID_ID');
|
|
164
181
|
try {
|
|
165
182
|
musicID = isURL(value) ? Client.getIDFromURL(value) : value;
|
|
166
|
-
void await this.
|
|
183
|
+
void await ensureCookies(this.instance);
|
|
167
184
|
const response = await this.instance.get(Client.API_MUSIC_PATH, {
|
|
168
185
|
params: {
|
|
169
186
|
id: musicID,
|
|
@@ -174,7 +191,7 @@ class Client {
|
|
|
174
191
|
if (response.err === -1150) {
|
|
175
192
|
const retry = async (step, before) => {
|
|
176
193
|
if (step > 3)
|
|
177
|
-
throw new lapse.Lapse('Music requested by VIP, PRI', 'ERROR_MUSIC_VIP_ONLY', before ? before.err : void 0
|
|
194
|
+
throw new lapse.Lapse('Music requested by VIP, PRI', 'ERROR_MUSIC_VIP_ONLY', before ? before.err : void 0);
|
|
178
195
|
const retryData = await this.instance.get(Client.EXTRA_API_MUSIC_PATH, {
|
|
179
196
|
params: {
|
|
180
197
|
id: musicID,
|
|
@@ -200,9 +217,8 @@ class Client {
|
|
|
200
217
|
return source;
|
|
201
218
|
}
|
|
202
219
|
catch (error) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
throw new lapse.Lapse('Failed to fetch music stream', 'ERROR_MUSIC_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
220
|
+
const lapse$1 = error instanceof lapse.Lapse ? error : new lapse.Lapse('Failed to fetch music stream', 'ERROR_MUSIC_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
221
|
+
throw lapse$1;
|
|
206
222
|
}
|
|
207
223
|
}
|
|
208
224
|
musicSync(musicID) {
|
|
@@ -249,7 +265,7 @@ class Client {
|
|
|
249
265
|
throw new lapse.Lapse('ID must be a non-empty string', 'ERROR_INVALID_ID');
|
|
250
266
|
try {
|
|
251
267
|
playlistID = isURL(value) ? Client.getIDFromURL(value) : value;
|
|
252
|
-
void await this.
|
|
268
|
+
void await ensureCookies(this.instance);
|
|
253
269
|
const response = await this.instance.get(Client.API_PLAYLIST_PATH, {
|
|
254
270
|
params: {
|
|
255
271
|
id: playlistID,
|
|
@@ -261,9 +277,8 @@ class Client {
|
|
|
261
277
|
return refined.createPlayList(response.data);
|
|
262
278
|
}
|
|
263
279
|
catch (error) {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
throw new lapse.Lapse('Failed to fetch playlist', 'ERROR_PLAYLIST_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
280
|
+
const lapse$1 = error instanceof lapse.Lapse ? error : new lapse.Lapse('Failed to fetch playlist', 'ERROR_PLAYLIST_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
281
|
+
throw lapse$1;
|
|
267
282
|
}
|
|
268
283
|
}
|
|
269
284
|
async artist(aliasID) {
|
|
@@ -272,7 +287,7 @@ class Client {
|
|
|
272
287
|
throw new lapse.Lapse('ID must be a non-empty string', 'ERROR_INVALID_ID');
|
|
273
288
|
try {
|
|
274
289
|
aliasID = isURL(value) ? Client.getIDFromURL(value) : value;
|
|
275
|
-
void await this.
|
|
290
|
+
void await ensureCookies(this.instance);
|
|
276
291
|
const response = await this.instance.get(Client.API_ARTIST_PATH, {
|
|
277
292
|
params: {
|
|
278
293
|
alias: aliasID,
|
|
@@ -280,15 +295,14 @@ class Client {
|
|
|
280
295
|
}
|
|
281
296
|
});
|
|
282
297
|
if (response.err === -108)
|
|
283
|
-
throw new lapse.Lapse('Artist not found', 'ERROR_ARTIST_NOT_FOUND', response.err
|
|
298
|
+
throw new lapse.Lapse('Artist not found', 'ERROR_ARTIST_NOT_FOUND', response.err);
|
|
284
299
|
if (response.err !== 0)
|
|
285
|
-
throw new lapse.Lapse('Could not fetch artist', 'ERROR_ARTIST_FETCH', response.err
|
|
300
|
+
throw new lapse.Lapse('Could not fetch artist', 'ERROR_ARTIST_FETCH', response.err);
|
|
286
301
|
return refined.createArtist(response.data);
|
|
287
302
|
}
|
|
288
303
|
catch (error) {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
throw new lapse.Lapse('Failed to fetch artist', 'ERROR_ARTIST_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
304
|
+
const lapse$1 = error instanceof lapse.Lapse ? error : new lapse.Lapse('Failed to fetch artist', 'ERROR_ARTIST_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
305
|
+
throw lapse$1;
|
|
292
306
|
}
|
|
293
307
|
}
|
|
294
308
|
async mediaDetails(mediaID) {
|
|
@@ -297,7 +311,7 @@ class Client {
|
|
|
297
311
|
throw new lapse.Lapse('ID must be a non-empty string', 'ERROR_INVALID_ID');
|
|
298
312
|
try {
|
|
299
313
|
mediaID = isURL(value) ? Client.getIDFromURL(value) : value;
|
|
300
|
-
void await this.
|
|
314
|
+
void await ensureCookies(this.instance);
|
|
301
315
|
const response = await this.instance.get(Client.API_MEDIA_DETAILS_PATH, {
|
|
302
316
|
params: {
|
|
303
317
|
id: mediaID,
|
|
@@ -305,22 +319,21 @@ class Client {
|
|
|
305
319
|
}
|
|
306
320
|
});
|
|
307
321
|
if (response.err === -1023)
|
|
308
|
-
throw new lapse.Lapse('Media not found', 'ERROR_MEDIA_NOT_FOUND', response.err
|
|
322
|
+
throw new lapse.Lapse('Media not found', 'ERROR_MEDIA_NOT_FOUND', response.err);
|
|
309
323
|
if (response.err !== 0)
|
|
310
|
-
throw new lapse.Lapse('Could not fetch media', 'ERROR_MEDIA_FETCH', response.err
|
|
324
|
+
throw new lapse.Lapse('Could not fetch media', 'ERROR_MEDIA_FETCH', response.err);
|
|
311
325
|
return refined.createMedia(response.data);
|
|
312
326
|
}
|
|
313
327
|
catch (error) {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
throw new lapse.Lapse('Failed to fetch media', 'ERROR_MEDIA_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
328
|
+
const lapse$1 = error instanceof lapse.Lapse ? error : new lapse.Lapse('Failed to fetch media', 'ERROR_MEDIA_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
329
|
+
throw lapse$1;
|
|
317
330
|
}
|
|
318
331
|
}
|
|
319
332
|
async searchMusic(query) {
|
|
320
333
|
if (typeof query !== 'string' || !query.trim().length)
|
|
321
334
|
throw new lapse.Lapse('Query must be a non-empty string', 'ERROR_INVALID_QUERY');
|
|
322
335
|
try {
|
|
323
|
-
void await this.
|
|
336
|
+
void await ensureCookies(this.instance);
|
|
324
337
|
const response = await this.instance.get(Client.API_SEARCH_PATH, {
|
|
325
338
|
params: {
|
|
326
339
|
q: query,
|
|
@@ -331,20 +344,19 @@ class Client {
|
|
|
331
344
|
}
|
|
332
345
|
});
|
|
333
346
|
if (response.err !== 0)
|
|
334
|
-
throw new lapse.Lapse('Search could not be fetched', 'ERROR_SEARCH_FAILED', response.err
|
|
335
|
-
return response.data.items.map(refined.createSearchMedia);
|
|
347
|
+
throw new lapse.Lapse('Search could not be fetched', 'ERROR_SEARCH_FAILED', response.err);
|
|
348
|
+
return (response.data.items ?? []).map(refined.createSearchMedia);
|
|
336
349
|
}
|
|
337
350
|
catch (error) {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
throw new lapse.Lapse('Search could not be fetch', 'ERROR_SEARCH_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
351
|
+
const lapse$1 = error instanceof lapse.Lapse ? error : new lapse.Lapse('Search could not be fetch', 'ERROR_SEARCH_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
352
|
+
throw lapse$1;
|
|
341
353
|
}
|
|
342
354
|
}
|
|
343
355
|
async searchVideo(query) {
|
|
344
356
|
if (typeof query !== 'string' || !query.trim().length)
|
|
345
357
|
throw new lapse.Lapse('Query must be a non-empty string', 'ERROR_INVALID_QUERY');
|
|
346
358
|
try {
|
|
347
|
-
void await this.
|
|
359
|
+
void await ensureCookies(this.instance);
|
|
348
360
|
const response = await this.instance.get(Client.API_SEARCH_PATH, {
|
|
349
361
|
params: {
|
|
350
362
|
q: query,
|
|
@@ -355,20 +367,19 @@ class Client {
|
|
|
355
367
|
}
|
|
356
368
|
});
|
|
357
369
|
if (response.err !== 0)
|
|
358
|
-
throw new lapse.Lapse('Search could not be fetched', 'ERROR_SEARCH_FAILED', response.err
|
|
359
|
-
return response.data.items
|
|
370
|
+
throw new lapse.Lapse('Search could not be fetched', 'ERROR_SEARCH_FAILED', response.err);
|
|
371
|
+
return (response.data.items ?? []).map(refined.createSearchMedia);
|
|
360
372
|
}
|
|
361
373
|
catch (error) {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
throw new lapse.Lapse('Search could not be fetch', 'ERROR_SEARCH_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
374
|
+
const lapse$1 = error instanceof lapse.Lapse ? error : new lapse.Lapse('Search could not be fetch', 'ERROR_SEARCH_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
375
|
+
throw lapse$1;
|
|
365
376
|
}
|
|
366
377
|
}
|
|
367
378
|
async searchList(query) {
|
|
368
379
|
if (typeof query !== 'string' || !query.trim().length)
|
|
369
380
|
throw new lapse.Lapse('Query must be a non-empty string', 'ERROR_INVALID_QUERY');
|
|
370
381
|
try {
|
|
371
|
-
void await this.
|
|
382
|
+
void await ensureCookies(this.instance);
|
|
372
383
|
const response = await this.instance.get(Client.API_SEARCH_PATH, {
|
|
373
384
|
params: {
|
|
374
385
|
q: query,
|
|
@@ -379,20 +390,19 @@ class Client {
|
|
|
379
390
|
}
|
|
380
391
|
});
|
|
381
392
|
if (response.err !== 0)
|
|
382
|
-
throw new lapse.Lapse('Search could not be fetched', 'ERROR_SEARCH_FAILED', response.err
|
|
393
|
+
throw new lapse.Lapse('Search could not be fetched', 'ERROR_SEARCH_FAILED', response.err);
|
|
383
394
|
return response.data.items.map(refined.createSearchPlayList);
|
|
384
395
|
}
|
|
385
396
|
catch (error) {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
throw new lapse.Lapse('Search could not be fetch', 'ERROR_SEARCH_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
397
|
+
const lapse$1 = error instanceof lapse.Lapse ? error : new lapse.Lapse('Search could not be fetch', 'ERROR_SEARCH_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
398
|
+
throw lapse$1;
|
|
389
399
|
}
|
|
390
400
|
}
|
|
391
401
|
async searchArtist(query) {
|
|
392
402
|
if (typeof query !== 'string' || !query.trim().length)
|
|
393
403
|
throw new lapse.Lapse('Query must be a non-empty string', 'ERROR_INVALID_QUERY');
|
|
394
404
|
try {
|
|
395
|
-
void await this.
|
|
405
|
+
void await ensureCookies(this.instance);
|
|
396
406
|
const response = await this.instance.get(Client.API_SEARCH_PATH, {
|
|
397
407
|
params: {
|
|
398
408
|
q: query,
|
|
@@ -403,18 +413,16 @@ class Client {
|
|
|
403
413
|
}
|
|
404
414
|
});
|
|
405
415
|
if (response.err !== 0)
|
|
406
|
-
throw new lapse.Lapse('Search could not be fetched', 'ERROR_SEARCH_FAILED', response.err
|
|
416
|
+
throw new lapse.Lapse('Search could not be fetched', 'ERROR_SEARCH_FAILED', response.err);
|
|
407
417
|
return response.data.items.map(refined.createSearchArtist);
|
|
408
418
|
}
|
|
409
419
|
catch (error) {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
throw new lapse.Lapse('Search could not be fetch', 'ERROR_SEARCH_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
420
|
+
const lapse$1 = error instanceof lapse.Lapse ? error : new lapse.Lapse('Search could not be fetch', 'ERROR_SEARCH_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);
|
|
421
|
+
throw lapse$1;
|
|
413
422
|
}
|
|
414
423
|
}
|
|
415
424
|
}
|
|
416
425
|
const client = new Client();
|
|
417
|
-
client.searchMusic('skyfall');
|
|
418
426
|
|
|
419
427
|
exports.Client = Client;
|
|
420
428
|
exports.default = client;
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../esm/index.js"],"sourcesContent":["import axios from 'axios';\nimport m3u8stream from 'm3u8stream';\nimport { PassThrough } from 'node:stream';\nimport { URL } from 'node:url';\nimport { Cookies } from './utils/cookies.js';\nimport { createSignature } from './utils/encrypt.js';\nimport { Lapse } from './utils/lapse.js';\nimport { createArtist, createMedia, createSearchMedia, createPlayList, createSearchArtist, createSearchPlayList } from './utils/refined.js';\nconst isURL = (value) => {\n try {\n new URL(value);\n return true;\n }\n catch {\n return false;\n }\n};\nclass Client {\n static BASE_URL = 'https://zingmp3.vn/';\n static VERSION_URL_V1 = '1.6.34';\n static VERSION_URL_V2 = '1.13.13';\n static SECRET_KEY_V1 = '2aa2d1c561e809b267f3638c4a307aab';\n static SECRET_KEY_V2 = '10a01dcf33762d3a204cb96429918ff6';\n static API_KEY_V1 = '88265e23d4284f25963e6eedac8fbfa3';\n static API_KEY_V2 = '38e8643fb0dc04e8d65b99994d3dafff';\n static API_VIDEO_PATH = '/api/v2/page/get/video';\n static API_MUSIC_PATH = '/api/v2/song/get/streaming';\n static EXTRA_API_MUSIC_PATH = '/api/song/get-song-info';\n static API_SEARCH_PATH = '/api/v2/search';\n static API_PLAYLIST_PATH = '/api/v2/page/get/playlist';\n static API_MEDIA_DETAILS_PATH = '/api/v2/song/get/info';\n static API_ARTIST_PATH = '/api/v2/page/get/artist';\n static getIDFromURL(url) {\n if (typeof url !== 'string' || !url.trim().length)\n throw new Lapse('URL must be a non-empty string', 'ERROR_INVALID_URL');\n const match = url.match(/\\/([A-Z0-9]{8})\\.html(?:\\?|#|$)/i) || url.match(/^https?:\\/\\/zingmp3\\.vn\\/([^/?#]+)\\/?(?:[?#].*)?$/i);\n if (!match)\n throw new Lapse('Could not extract ID from URL', 'ERROR_INVALID_URL');\n return match[1];\n }\n ctime = Math.floor(Date.now() / 1000).toString();\n instance;\n maxLoad;\n maxHighWaterMark;\n userAgent;\n jar;\n constructor(options = {}) {\n this.maxLoad = options.maxLoad ?? 1024 * 1024;\n this.maxHighWaterMark = options.maxHighWaterMark ?? 16 * 1024;\n this.userAgent = options?.userAgent ?? 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3';\n this.jar = options.jar instanceof Cookies ? options.jar : new Cookies();\n this.instance = axios.create({\n baseURL: Client.BASE_URL,\n params: {\n version: Client.VERSION_URL_V1,\n apiKey: Client.API_KEY_V1,\n ctime: this.ctime\n },\n maxRate: this.maxLoad,\n headers: {\n 'User-Agent': this.userAgent\n }\n });\n this.instance.interceptors.request.use(async (options) => {\n const base = options.baseURL ?? '';\n const url = new URL(options.url ?? '/', base).toString();\n const additionalHeaders = this.jar.applyToHeaders(url);\n for (const [key, value] of Object.entries(additionalHeaders))\n options.headers.set(key, value);\n return options;\n });\n this.instance.interceptors.response.use((response) => {\n const setCookie = response.headers['set-cookie'];\n const requestUrl = response.request?.res?.responseUrl ?? response.config.url;\n if (requestUrl && Array.isArray(setCookie))\n this.jar.setCookies(setCookie, requestUrl);\n return response.data;\n });\n }\n async ensureCookies() {\n if (this.jar.getCookies(Client.BASE_URL).length === 0)\n void await this.instance.get('/');\n }\n async video(videoID) {\n const value = videoID instanceof URL ? videoID.toString() : videoID;\n if (typeof value !== 'string' || !value.trim().length)\n throw new Lapse('ID must be a non-empty string', 'ERROR_INVALID_ID');\n try {\n videoID = isURL(value) ? Client.getIDFromURL(value) : value;\n void await this.ensureCookies();\n const response = await this.instance.get(Client.API_VIDEO_PATH, {\n params: {\n id: videoID,\n sig: createSignature(Client.API_VIDEO_PATH, 'ctime=' + this.ctime + 'id=' + videoID + 'version=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n if (response.err !== 0)\n throw new Lapse('Video could not be found', 'ERROR_VIDEO_NOT_FOUND', response.err, response);\n const videoURL = response.data?.streaming?.hls?.['720p'] || response.data?.streaming?.hls?.['360p'];\n if (!videoURL || !videoURL.length)\n throw new Lapse('Streaming URL not found', 'ERROR_STREAM_URL_NOT_FOUND');\n const source = m3u8stream(videoURL);\n source.once('error', (error) => {\n const lapse = new Lapse('Stream download failed', 'ERROR_STREAM_DOWNLOAD', void 0, error);\n source.destroy(lapse);\n });\n return source;\n }\n catch (error) {\n if (error instanceof Lapse)\n throw error;\n throw new Lapse('Failed to fetch video stream', 'ERROR_VIDEO_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n }\n }\n videoSync(videoID) {\n const video = new PassThrough({ highWaterMark: this.maxHighWaterMark });\n let copySource;\n let closed = false;\n let sourceDestroyed = false;\n const destroy = () => {\n if (!copySource || sourceDestroyed)\n return;\n sourceDestroyed = true;\n if (!copySource)\n return;\n copySource.unpipe(video);\n if (!copySource.destroyed)\n copySource.destroy();\n };\n const closer = () => {\n closed = true;\n destroy();\n };\n video.once('close', closer);\n video.once('error', closer);\n void this.video(videoID)\n .then((source) => {\n copySource = source;\n source.once('error', (error) => {\n const lapse = error instanceof Lapse ? error : new Lapse('Stream download failed', 'ERROR_STREAM_DOWNLOAD', void 0, error);\n video.destroy(lapse);\n });\n if (closed || video.destroyed) {\n destroy();\n return;\n }\n source.pipe(video);\n })\n .catch((error) => {\n const lapse = error instanceof Lapse ? error : new Lapse('Failed to fetch video stream', 'ERROR_VIDEO_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n video.destroy(lapse);\n });\n return video;\n }\n async music(musicID) {\n const value = musicID instanceof URL ? musicID.toString() : musicID;\n if (typeof value !== 'string' || !value.trim().length)\n throw new Lapse('ID must be a non-empty string', 'ERROR_INVALID_ID');\n try {\n musicID = isURL(value) ? Client.getIDFromURL(value) : value;\n void await this.ensureCookies();\n const response = await this.instance.get(Client.API_MUSIC_PATH, {\n params: {\n id: musicID,\n sig: createSignature(Client.API_MUSIC_PATH, 'ctime=' + this.ctime + 'id=' + musicID + 'version=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n let musicURL = response.data?.[320] && response.data[320] !== 'VIP' ? response.data[320] : response.data?.[128];\n if (response.err === -1150) {\n const retry = async (step, before) => {\n if (step > 3)\n throw new Lapse('Music requested by VIP, PRI', 'ERROR_MUSIC_VIP_ONLY', before ? before.err : void 0, before);\n const retryData = await this.instance.get(Client.EXTRA_API_MUSIC_PATH, {\n params: {\n id: musicID,\n api_key: Client.API_KEY_V2,\n sig: createSignature('/song/get-song-info', 'ctime=' + this.ctime + 'id=' + musicID, Client.SECRET_KEY_V2),\n version: void 0,\n apiKey: void 0\n }\n });\n if (retryData.err === 0)\n return retryData.data?.streaming?.default?.[128];\n return retry(step + 1, retryData);\n };\n musicURL = await retry(0);\n }\n if (!musicURL || !musicURL.length)\n throw new Lapse('Streaming URL not found', 'ERROR_STREAM_URL_NOT_FOUND');\n const source = await this.instance.get(musicURL, { responseType: 'stream' });\n source.once('error', (error) => {\n const lapse = new Lapse('Stream download failed', 'ERROR_STREAM_DOWNLOAD', void 0, error);\n source.destroy(lapse);\n });\n return source;\n }\n catch (error) {\n if (error instanceof Lapse)\n throw error;\n throw new Lapse('Failed to fetch music stream', 'ERROR_MUSIC_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n }\n }\n musicSync(musicID) {\n const music = new PassThrough({ highWaterMark: this.maxHighWaterMark });\n let copySource;\n let closed = false;\n let sourceDestroyed = false;\n const destroy = () => {\n if (!copySource || sourceDestroyed)\n return;\n sourceDestroyed = true;\n copySource.unpipe(music);\n if (!copySource.destroyed)\n copySource.destroy();\n };\n const closer = () => {\n closed = true;\n destroy();\n };\n music.once('close', closer);\n music.once('error', closer);\n void this.music(musicID)\n .then((source) => {\n copySource = source;\n source.once('error', (error) => {\n const lapse = error instanceof Lapse ? error : new Lapse('Stream download failed', 'ERROR_STREAM_DOWNLOAD', void 0, error);\n music.destroy(lapse);\n });\n if (closed || music.destroyed) {\n destroy();\n return;\n }\n source.pipe(music);\n })\n .catch((error) => {\n const lapse = error instanceof Lapse ? error : new Lapse('Failed to fetch music stream', 'ERROR_MUSIC_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n music.destroy(lapse);\n });\n return music;\n }\n async playlist(playlistID) {\n const value = playlistID instanceof URL ? playlistID.toString() : playlistID;\n if (typeof value !== 'string' || !value.trim().length)\n throw new Lapse('ID must be a non-empty string', 'ERROR_INVALID_ID');\n try {\n playlistID = isURL(value) ? Client.getIDFromURL(value) : value;\n void await this.ensureCookies();\n const response = await this.instance.get(Client.API_PLAYLIST_PATH, {\n params: {\n id: playlistID,\n sig: createSignature(Client.API_PLAYLIST_PATH, 'ctime=' + this.ctime + 'id=' + playlistID + 'version=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n if (response.err !== 0)\n throw new Lapse('Could not find playlist', 'ERROR_PLAYLIST_NOT_FOUND', response.err, response);\n return createPlayList(response.data);\n }\n catch (error) {\n if (error instanceof Lapse)\n throw error;\n throw new Lapse('Failed to fetch playlist', 'ERROR_PLAYLIST_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n }\n }\n async artist(aliasID) {\n const value = aliasID instanceof URL ? aliasID.toString() : aliasID;\n if (typeof value !== 'string' || !value.trim().length)\n throw new Lapse('ID must be a non-empty string', 'ERROR_INVALID_ID');\n try {\n aliasID = isURL(value) ? Client.getIDFromURL(value) : value;\n void await this.ensureCookies();\n const response = await this.instance.get(Client.API_ARTIST_PATH, {\n params: {\n alias: aliasID,\n sig: createSignature(Client.API_ARTIST_PATH, 'ctime=' + this.ctime + 'version=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n if (response.err === -108)\n throw new Lapse('Artist not found', 'ERROR_ARTIST_NOT_FOUND', response.err, response);\n if (response.err !== 0)\n throw new Lapse('Could not fetch artist', 'ERROR_ARTIST_FETCH', response.err, response);\n return createArtist(response.data);\n }\n catch (error) {\n if (error instanceof Lapse)\n throw error;\n throw new Lapse('Failed to fetch artist', 'ERROR_ARTIST_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n }\n }\n async mediaDetails(mediaID) {\n const value = mediaID instanceof URL ? mediaID.toString() : mediaID;\n if (typeof value !== 'string' || !value.trim().length)\n throw new Lapse('ID must be a non-empty string', 'ERROR_INVALID_ID');\n try {\n mediaID = isURL(value) ? Client.getIDFromURL(value) : value;\n void await this.ensureCookies();\n const response = await this.instance.get(Client.API_MEDIA_DETAILS_PATH, {\n params: {\n id: mediaID,\n sig: createSignature(Client.API_MEDIA_DETAILS_PATH, 'ctime=' + this.ctime + 'id=' + mediaID + 'version=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n if (response.err === -1023)\n throw new Lapse('Media not found', 'ERROR_MEDIA_NOT_FOUND', response.err, response);\n if (response.err !== 0)\n throw new Lapse('Could not fetch media', 'ERROR_MEDIA_FETCH', response.err, response);\n return createMedia(response.data);\n }\n catch (error) {\n if (error instanceof Lapse)\n throw error;\n throw new Lapse('Failed to fetch media', 'ERROR_MEDIA_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n }\n }\n async searchMusic(query) {\n if (typeof query !== 'string' || !query.trim().length)\n throw new Lapse('Query must be a non-empty string', 'ERROR_INVALID_QUERY');\n try {\n void await this.ensureCookies();\n const response = await this.instance.get(Client.API_SEARCH_PATH, {\n params: {\n q: query,\n type: 'song',\n page: 1,\n count: 20,\n sig: createSignature(Client.API_SEARCH_PATH, 'count=20ctime=' + this.ctime + 'page=1type=songversion=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n if (response.err !== 0)\n throw new Lapse('Search could not be fetched', 'ERROR_SEARCH_FAILED', response.err, response);\n return response.data.items.map(createSearchMedia);\n }\n catch (error) {\n if (error instanceof Lapse)\n throw error;\n throw new Lapse('Search could not be fetch', 'ERROR_SEARCH_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n }\n }\n async searchVideo(query) {\n if (typeof query !== 'string' || !query.trim().length)\n throw new Lapse('Query must be a non-empty string', 'ERROR_INVALID_QUERY');\n try {\n void await this.ensureCookies();\n const response = await this.instance.get(Client.API_SEARCH_PATH, {\n params: {\n q: query,\n type: 'video',\n page: 1,\n count: 20,\n sig: createSignature(Client.API_SEARCH_PATH, 'count=20ctime=' + this.ctime + 'page=1type=videoversion=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n if (response.err !== 0)\n throw new Lapse('Search could not be fetched', 'ERROR_SEARCH_FAILED', response.err, response);\n return response.data.items.filter(item => item.artists).map(createSearchMedia);\n }\n catch (error) {\n if (error instanceof Lapse)\n throw error;\n throw new Lapse('Search could not be fetch', 'ERROR_SEARCH_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n }\n }\n async searchList(query) {\n if (typeof query !== 'string' || !query.trim().length)\n throw new Lapse('Query must be a non-empty string', 'ERROR_INVALID_QUERY');\n try {\n void await this.ensureCookies();\n const response = await this.instance.get(Client.API_SEARCH_PATH, {\n params: {\n q: query,\n type: 'playlist',\n page: 1,\n count: 20,\n sig: createSignature(Client.API_SEARCH_PATH, 'count=20ctime=' + this.ctime + 'page=1type=playlistversion=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n if (response.err !== 0)\n throw new Lapse('Search could not be fetched', 'ERROR_SEARCH_FAILED', response.err, response);\n return response.data.items.map(createSearchPlayList);\n }\n catch (error) {\n if (error instanceof Lapse)\n throw error;\n throw new Lapse('Search could not be fetch', 'ERROR_SEARCH_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n }\n }\n async searchArtist(query) {\n if (typeof query !== 'string' || !query.trim().length)\n throw new Lapse('Query must be a non-empty string', 'ERROR_INVALID_QUERY');\n try {\n void await this.ensureCookies();\n const response = await this.instance.get(Client.API_SEARCH_PATH, {\n params: {\n q: query,\n type: 'artist',\n page: 1,\n count: 20,\n sig: createSignature(Client.API_SEARCH_PATH, 'count=20ctime=' + this.ctime + 'page=1type=artistversion=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n if (response.err !== 0)\n throw new Lapse('Search could not be fetched', 'ERROR_SEARCH_FAILED', response.err, response);\n return response.data.items.map(createSearchArtist);\n }\n catch (error) {\n if (error instanceof Lapse)\n throw error;\n throw new Lapse('Search could not be fetch', 'ERROR_SEARCH_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n }\n }\n}\nconst client = new Client();\nclient.searchMusic('skyfall');\nexport { client as default, Client };\n//# sourceMappingURL=index.js.map"],"names":["URL","Lapse","Cookies","createSignature","lapse","PassThrough","createPlayList","createArtist","createMedia","createSearchMedia","createSearchPlayList","createSearchArtist"],"mappings":";;;;;;;;;;;;;AAQA,MAAM,KAAK,GAAG,CAAC,KAAK,KAAK;AACzB,IAAI,IAAI;AACR,QAAQ,IAAIA,YAAG,CAAC,KAAK,CAAC;AACtB,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,MAAM;AACV,QAAQ,OAAO,KAAK;AACpB,IAAI;AACJ,CAAC;AACD,MAAM,MAAM,CAAC;AACb,IAAI,OAAO,QAAQ,GAAG,qBAAqB;AAC3C,IAAI,OAAO,cAAc,GAAG,QAAQ;AACpC,IAAI,OAAO,cAAc,GAAG,SAAS;AACrC,IAAI,OAAO,aAAa,GAAG,kCAAkC;AAC7D,IAAI,OAAO,aAAa,GAAG,kCAAkC;AAC7D,IAAI,OAAO,UAAU,GAAG,kCAAkC;AAC1D,IAAI,OAAO,UAAU,GAAG,kCAAkC;AAC1D,IAAI,OAAO,cAAc,GAAG,wBAAwB;AACpD,IAAI,OAAO,cAAc,GAAG,4BAA4B;AACxD,IAAI,OAAO,oBAAoB,GAAG,yBAAyB;AAC3D,IAAI,OAAO,eAAe,GAAG,gBAAgB;AAC7C,IAAI,OAAO,iBAAiB,GAAG,2BAA2B;AAC1D,IAAI,OA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,CAAC,MAAM,CAAC,eAAe,EAAE;AAC7E,gBAAgB,MAAM,EAAE;AACxB,oBAAoB,CAAC,EAAE,KAAK;AAC5B,oBAAoB,IAAI,EAAE,QAAQ;AAClC,oBAAoB,IAAI,EAAE,CAAC;AAC3B,oBAAoB,KAAK,EAAE,EAAE;AAC7B,oBAAoB,GAAG,EAAEE,uBAAe,CAAC,MAAM,CAAC,eAAe,EAAE,gBAAgB,GAAG,IAAI,CAAC,KAAK,GAAG,2BAA2B,GAAG,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,aAAa;AAC1K;AACA,aAAa,CAAC;AACd,YAAY,IAAI,QAAQ,CAAC,GAAG,KAAK,CAAC;AAClC,gBAAgB,MAAM,IAAIF,WAAK,CAAC,6BAA6B,EAAE,qBAAqB,EAAE,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;AAC7G,YAAY,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAACU,0BAAkB,CAAC;AAC9D,QAAQ;AACR,QAAQ,OAAO,KAAK,EAAE;AACtB,YAAY,IAAI,KAAK,YAAYV,WAAK;AACtC,gBAAgB,MAAM,KAAK;AAC3B,YAAY,MAAM,IAAIA,WAAK,CAAC,2BAA2B,EAAE,oBAAoB,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,EAAE,KAAK,CAAC;AAClJ,QAAQ;AACR,IAAI;AACJ;AACK,MAAC,MAAM,GAAG,IAAI,MAAM;AACzB,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../esm/index.js"],"sourcesContent":["import axios from 'axios';\nimport m3u8stream from 'm3u8stream';\nimport { PassThrough } from 'node:stream';\nimport { URL } from 'node:url';\nimport { Cookies } from './utils/cookies.js';\nimport { createSignature } from './utils/encrypt.js';\nimport { Lapse } from './utils/lapse.js';\nimport { createArtist, createMedia, createSearchMedia, createPlayList, createSearchArtist, createSearchPlayList } from './utils/refined.js';\nconst isURL = (value) => {\n try {\n new URL(value);\n return true;\n }\n catch {\n return false;\n }\n};\nconst ensureCookies = async (instance) => await instance.get('/');\nclass Client {\n static BASE_URL = 'https://zingmp3.vn/';\n static VERSION_URL_V1 = '1.6.34';\n static VERSION_URL_V2 = '1.13.13';\n static SECRET_KEY_V1 = '2aa2d1c561e809b267f3638c4a307aab';\n static SECRET_KEY_V2 = '10a01dcf33762d3a204cb96429918ff6';\n static API_KEY_V1 = '88265e23d4284f25963e6eedac8fbfa3';\n static API_KEY_V2 = '38e8643fb0dc04e8d65b99994d3dafff';\n static API_VIDEO_PATH = '/api/v2/page/get/video';\n static API_MUSIC_PATH = '/api/v2/song/get/streaming';\n static EXTRA_API_MUSIC_PATH = '/api/song/get-song-info';\n static API_SEARCH_PATH = '/api/v2/search';\n static API_PLAYLIST_PATH = '/api/v2/page/get/playlist';\n static API_MEDIA_DETAILS_PATH = '/api/v2/song/get/info';\n static API_ARTIST_PATH = '/api/v2/page/get/artist';\n static getIDFromURL(url) {\n if (typeof url !== 'string' || !url.trim().length)\n throw new Lapse('URL must be a non-empty string', 'ERROR_INVALID_URL');\n const match = url.match(/\\/([A-Z0-9]{8})\\.html(?:\\?|#|$)/i) || url.match(/^https?:\\/\\/zingmp3\\.vn\\/([^/?#]+)\\/?(?:[?#].*)?$/i);\n if (!match)\n throw new Lapse('Could not extract ID from URL', 'ERROR_INVALID_URL');\n return match[1];\n }\n ctime = Math.floor(Date.now() / 1000).toString();\n instance;\n maxLoad;\n maxHighWaterMark;\n userAgent;\n jar;\n constructor(options) {\n const mergedOptions = {\n maxLoad: 1024 * 1024,\n maxHighWaterMark: 16 * 1024,\n userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',\n jar: new Cookies(),\n ...options\n };\n this.maxLoad = mergedOptions.maxLoad;\n this.maxHighWaterMark = mergedOptions.maxHighWaterMark;\n this.userAgent = mergedOptions.userAgent;\n this.jar = mergedOptions.jar;\n this.instance = axios.create({\n baseURL: Client.BASE_URL,\n params: {\n version: Client.VERSION_URL_V1,\n apiKey: Client.API_KEY_V1,\n ctime: this.ctime\n },\n maxRate: this.maxLoad\n });\n this.instance.interceptors.request.use(async (options) => {\n const base = options.baseURL ?? '';\n const url = new URL(options.url ?? '/', base).toString();\n options.headers.set('User-Agent', this.userAgent);\n const additionalHeaders = this.jar.applyToHeaders(url);\n for (const [key, value] of Object.entries(additionalHeaders))\n options.headers.set(key, value);\n return options;\n });\n this.instance.interceptors.response.use((response) => {\n const setCookie = response.headers['set-cookie'];\n const requestUrl = response.request?.res?.responseUrl ?? response.config.url;\n if (requestUrl && Array.isArray(setCookie))\n this.jar.setCookies(setCookie, requestUrl);\n return response.data;\n });\n }\n setOptions(options) {\n const mergedOptions = {\n maxLoad: this.maxLoad,\n maxHighWaterMark: this.maxHighWaterMark,\n userAgent: this.userAgent,\n jar: this.jar,\n ...options\n };\n this.maxLoad = mergedOptions.maxLoad;\n this.maxHighWaterMark = mergedOptions.maxHighWaterMark;\n this.userAgent = mergedOptions.userAgent;\n this.jar = mergedOptions.jar;\n this.instance.defaults.maxRate = mergedOptions.maxLoad;\n }\n async video(videoID) {\n const value = videoID instanceof URL ? videoID.toString() : videoID;\n if (typeof value !== 'string' || !value.trim().length)\n throw new Lapse('ID must be a non-empty string', 'ERROR_INVALID_ID');\n try {\n videoID = isURL(value) ? Client.getIDFromURL(value) : value;\n void await ensureCookies(this.instance);\n const response = await this.instance.get(Client.API_VIDEO_PATH, {\n params: {\n id: videoID,\n sig: createSignature(Client.API_VIDEO_PATH, 'ctime=' + this.ctime + 'id=' + videoID + 'version=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n if (response.err !== 0)\n throw new Lapse('Video could not be found', 'ERROR_VIDEO_NOT_FOUND', response.err);\n const videoURL = response.data?.streaming?.hls?.['720p'] || response.data?.streaming?.hls?.['360p'];\n if (!videoURL || !videoURL.length)\n throw new Lapse('Streaming URL not found', 'ERROR_STREAM_URL_NOT_FOUND');\n const source = m3u8stream(videoURL, {\n highWaterMark: this.maxHighWaterMark\n });\n source.once('error', (error) => {\n const lapse = new Lapse('Stream download failed', 'ERROR_STREAM_DOWNLOAD', void 0, error);\n source.destroy(lapse);\n });\n return source;\n }\n catch (error) {\n const lapse = error instanceof Lapse ? error : new Lapse('Failed to fetch video stream', 'ERROR_VIDEO_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n throw lapse;\n }\n }\n videoSync(videoID) {\n const video = new PassThrough({ highWaterMark: this.maxHighWaterMark });\n let copySource;\n let closed = false;\n let sourceDestroyed = false;\n const destroy = () => {\n if (!copySource || sourceDestroyed)\n return;\n sourceDestroyed = true;\n if (!copySource)\n return;\n copySource.unpipe(video);\n if (!copySource.destroyed)\n copySource.destroy();\n };\n const closer = () => {\n closed = true;\n destroy();\n };\n video.once('close', closer);\n video.once('error', closer);\n void this.video(videoID)\n .then((source) => {\n copySource = source;\n source.once('error', (error) => {\n const lapse = error instanceof Lapse ? error : new Lapse('Stream download failed', 'ERROR_STREAM_DOWNLOAD', void 0, error);\n video.destroy(lapse);\n });\n if (closed || video.destroyed) {\n destroy();\n return;\n }\n source.pipe(video);\n })\n .catch((error) => {\n const lapse = error instanceof Lapse ? error : new Lapse('Failed to fetch video stream', 'ERROR_VIDEO_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n video.destroy(lapse);\n });\n return video;\n }\n async music(musicID) {\n const value = musicID instanceof URL ? musicID.toString() : musicID;\n if (typeof value !== 'string' || !value.trim().length)\n throw new Lapse('ID must be a non-empty string', 'ERROR_INVALID_ID');\n try {\n musicID = isURL(value) ? Client.getIDFromURL(value) : value;\n void await ensureCookies(this.instance);\n const response = await this.instance.get(Client.API_MUSIC_PATH, {\n params: {\n id: musicID,\n sig: createSignature(Client.API_MUSIC_PATH, 'ctime=' + this.ctime + 'id=' + musicID + 'version=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n let musicURL = response.data?.[320] && response.data[320] !== 'VIP' ? response.data[320] : response.data?.[128];\n if (response.err === -1150) {\n const retry = async (step, before) => {\n if (step > 3)\n throw new Lapse('Music requested by VIP, PRI', 'ERROR_MUSIC_VIP_ONLY', before ? before.err : void 0);\n const retryData = await this.instance.get(Client.EXTRA_API_MUSIC_PATH, {\n params: {\n id: musicID,\n api_key: Client.API_KEY_V2,\n sig: createSignature('/song/get-song-info', 'ctime=' + this.ctime + 'id=' + musicID, Client.SECRET_KEY_V2),\n version: void 0,\n apiKey: void 0\n }\n });\n if (retryData.err === 0)\n return retryData.data?.streaming?.default?.[128];\n return retry(step + 1, retryData);\n };\n musicURL = await retry(0);\n }\n if (!musicURL || !musicURL.length)\n throw new Lapse('Streaming URL not found', 'ERROR_STREAM_URL_NOT_FOUND');\n const source = await this.instance.get(musicURL, { responseType: 'stream' });\n source.once('error', (error) => {\n const lapse = new Lapse('Stream download failed', 'ERROR_STREAM_DOWNLOAD', void 0, error);\n source.destroy(lapse);\n });\n return source;\n }\n catch (error) {\n const lapse = error instanceof Lapse ? error : new Lapse('Failed to fetch music stream', 'ERROR_MUSIC_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n throw lapse;\n }\n }\n musicSync(musicID) {\n const music = new PassThrough({ highWaterMark: this.maxHighWaterMark });\n let copySource;\n let closed = false;\n let sourceDestroyed = false;\n const destroy = () => {\n if (!copySource || sourceDestroyed)\n return;\n sourceDestroyed = true;\n copySource.unpipe(music);\n if (!copySource.destroyed)\n copySource.destroy();\n };\n const closer = () => {\n closed = true;\n destroy();\n };\n music.once('close', closer);\n music.once('error', closer);\n void this.music(musicID)\n .then((source) => {\n copySource = source;\n source.once('error', (error) => {\n const lapse = error instanceof Lapse ? error : new Lapse('Stream download failed', 'ERROR_STREAM_DOWNLOAD', void 0, error);\n music.destroy(lapse);\n });\n if (closed || music.destroyed) {\n destroy();\n return;\n }\n source.pipe(music);\n })\n .catch((error) => {\n const lapse = error instanceof Lapse ? error : new Lapse('Failed to fetch music stream', 'ERROR_MUSIC_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n music.destroy(lapse);\n });\n return music;\n }\n async playlist(playlistID) {\n const value = playlistID instanceof URL ? playlistID.toString() : playlistID;\n if (typeof value !== 'string' || !value.trim().length)\n throw new Lapse('ID must be a non-empty string', 'ERROR_INVALID_ID');\n try {\n playlistID = isURL(value) ? Client.getIDFromURL(value) : value;\n void await ensureCookies(this.instance);\n const response = await this.instance.get(Client.API_PLAYLIST_PATH, {\n params: {\n id: playlistID,\n sig: createSignature(Client.API_PLAYLIST_PATH, 'ctime=' + this.ctime + 'id=' + playlistID + 'version=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n if (response.err !== 0)\n throw new Lapse('Could not find playlist', 'ERROR_PLAYLIST_NOT_FOUND', response.err, response);\n return createPlayList(response.data);\n }\n catch (error) {\n const lapse = error instanceof Lapse ? error : new Lapse('Failed to fetch playlist', 'ERROR_PLAYLIST_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n throw lapse;\n }\n }\n async artist(aliasID) {\n const value = aliasID instanceof URL ? aliasID.toString() : aliasID;\n if (typeof value !== 'string' || !value.trim().length)\n throw new Lapse('ID must be a non-empty string', 'ERROR_INVALID_ID');\n try {\n aliasID = isURL(value) ? Client.getIDFromURL(value) : value;\n void await ensureCookies(this.instance);\n const response = await this.instance.get(Client.API_ARTIST_PATH, {\n params: {\n alias: aliasID,\n sig: createSignature(Client.API_ARTIST_PATH, 'ctime=' + this.ctime + 'version=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n if (response.err === -108)\n throw new Lapse('Artist not found', 'ERROR_ARTIST_NOT_FOUND', response.err);\n if (response.err !== 0)\n throw new Lapse('Could not fetch artist', 'ERROR_ARTIST_FETCH', response.err);\n return createArtist(response.data);\n }\n catch (error) {\n const lapse = error instanceof Lapse ? error : new Lapse('Failed to fetch artist', 'ERROR_ARTIST_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n throw lapse;\n }\n }\n async mediaDetails(mediaID) {\n const value = mediaID instanceof URL ? mediaID.toString() : mediaID;\n if (typeof value !== 'string' || !value.trim().length)\n throw new Lapse('ID must be a non-empty string', 'ERROR_INVALID_ID');\n try {\n mediaID = isURL(value) ? Client.getIDFromURL(value) : value;\n void await ensureCookies(this.instance);\n const response = await this.instance.get(Client.API_MEDIA_DETAILS_PATH, {\n params: {\n id: mediaID,\n sig: createSignature(Client.API_MEDIA_DETAILS_PATH, 'ctime=' + this.ctime + 'id=' + mediaID + 'version=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n if (response.err === -1023)\n throw new Lapse('Media not found', 'ERROR_MEDIA_NOT_FOUND', response.err);\n if (response.err !== 0)\n throw new Lapse('Could not fetch media', 'ERROR_MEDIA_FETCH', response.err);\n return createMedia(response.data);\n }\n catch (error) {\n const lapse = error instanceof Lapse ? error : new Lapse('Failed to fetch media', 'ERROR_MEDIA_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n throw lapse;\n }\n }\n async searchMusic(query) {\n if (typeof query !== 'string' || !query.trim().length)\n throw new Lapse('Query must be a non-empty string', 'ERROR_INVALID_QUERY');\n try {\n void await ensureCookies(this.instance);\n const response = await this.instance.get(Client.API_SEARCH_PATH, {\n params: {\n q: query,\n type: 'song',\n page: 1,\n count: 20,\n sig: createSignature(Client.API_SEARCH_PATH, 'count=20ctime=' + this.ctime + 'page=1type=songversion=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n if (response.err !== 0)\n throw new Lapse('Search could not be fetched', 'ERROR_SEARCH_FAILED', response.err);\n return (response.data.items ?? []).map(createSearchMedia);\n }\n catch (error) {\n const lapse = error instanceof Lapse ? error : new Lapse('Search could not be fetch', 'ERROR_SEARCH_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n throw lapse;\n }\n }\n async searchVideo(query) {\n if (typeof query !== 'string' || !query.trim().length)\n throw new Lapse('Query must be a non-empty string', 'ERROR_INVALID_QUERY');\n try {\n void await ensureCookies(this.instance);\n const response = await this.instance.get(Client.API_SEARCH_PATH, {\n params: {\n q: query,\n type: 'video',\n page: 1,\n count: 20,\n sig: createSignature(Client.API_SEARCH_PATH, 'count=20ctime=' + this.ctime + 'page=1type=videoversion=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n if (response.err !== 0)\n throw new Lapse('Search could not be fetched', 'ERROR_SEARCH_FAILED', response.err);\n return (response.data.items ?? []).map(createSearchMedia);\n }\n catch (error) {\n const lapse = error instanceof Lapse ? error : new Lapse('Search could not be fetch', 'ERROR_SEARCH_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n throw lapse;\n }\n }\n async searchList(query) {\n if (typeof query !== 'string' || !query.trim().length)\n throw new Lapse('Query must be a non-empty string', 'ERROR_INVALID_QUERY');\n try {\n void await ensureCookies(this.instance);\n const response = await this.instance.get(Client.API_SEARCH_PATH, {\n params: {\n q: query,\n type: 'playlist',\n page: 1,\n count: 20,\n sig: createSignature(Client.API_SEARCH_PATH, 'count=20ctime=' + this.ctime + 'page=1type=playlistversion=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n if (response.err !== 0)\n throw new Lapse('Search could not be fetched', 'ERROR_SEARCH_FAILED', response.err);\n return response.data.items.map(createSearchPlayList);\n }\n catch (error) {\n const lapse = error instanceof Lapse ? error : new Lapse('Search could not be fetch', 'ERROR_SEARCH_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n throw lapse;\n }\n }\n async searchArtist(query) {\n if (typeof query !== 'string' || !query.trim().length)\n throw new Lapse('Query must be a non-empty string', 'ERROR_INVALID_QUERY');\n try {\n void await ensureCookies(this.instance);\n const response = await this.instance.get(Client.API_SEARCH_PATH, {\n params: {\n q: query,\n type: 'artist',\n page: 1,\n count: 20,\n sig: createSignature(Client.API_SEARCH_PATH, 'count=20ctime=' + this.ctime + 'page=1type=artistversion=' + Client.VERSION_URL_V1, Client.SECRET_KEY_V1)\n }\n });\n if (response.err !== 0)\n throw new Lapse('Search could not be fetched', 'ERROR_SEARCH_FAILED', response.err);\n return response.data.items.map(createSearchArtist);\n }\n catch (error) {\n const lapse = error instanceof Lapse ? error : new Lapse('Search could not be fetch', 'ERROR_SEARCH_FETCH', axios.isAxiosError(error) ? error.response?.status : void 0, error);\n throw lapse;\n }\n }\n}\nconst client = new Client();\nexport { client as default, Client };\n//# sourceMappingURL=index.js.map"],"names":["URL","Lapse","Cookies","createSignature","lapse","PassThrough","createPlayList","createArtist","createMedia","createSearchMedia","createSearchPlayList","createSearchArtist"],"mappings":";;;;;;;;;;;;;AAQA,MAAM,KAAK,GAAG,CAAC,KAAK,KAAK;AACzB,IAAI,IAAI;AACR,QAAQ,IAAIA,YAAG,CAAC,KAAK,CAAC;AACtB,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,MAAM;AACV,QAAQ,OAAO,KAAK;AACpB,IAAI;AACJ,CAAC;AACD,MAAM,aAAa,GAAG,OAAO,QAAQ,KAAK,MAAM,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;AACjE,MAAM,MAAM,CAAC;AACb,IAAI,OAAO,QAAQ,GAAG,qBAAqB;AAC3C,IAAI,OAAO,cAAc,GAAG,QAAQ;AACpC,IAAI,OAAO,cAAc,GAAG,SAAS;AACrC,IAAI,OAAO,aAAa,GAAG,kCAAkC;AAC7D,IAAI,OAAO,aAAa,GAAG,kCAAkC;AAC7D,IAAI,OAAO,UAAU,GAAG,kCAAkC;AAC1D,IAAI,OAAO,UAAU,GAAG,kCAAkC;AAC1D,IAAI,OAAO,cAAc,GAAG,wBAAwB;AACpD,IAAI,OAAO,cAAc,GAAG,4BAA4B;AACxD,IAAI,OAAO,oBAAoB,GAAG,yBAAyB;AAC3D,IAAI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AAK,CAAC,GAAG,CAACU,0BAAkB,CAAC;AAC9D,QAAQ;AACR,QAAQ,OAAO,KAAK,EAAE;AACtB,YAAY,MAAMP,OAAK,GAAG,KAAK,YAAYH,WAAK,GAAG,KAAK,GAAG,IAAIA,WAAK,CAAC,2BAA2B,EAAE,oBAAoB,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,EAAE,KAAK,CAAC;AAC3L,YAAY,MAAMG,OAAK;AACvB,QAAQ;AACR,IAAI;AACJ;AACK,MAAC,MAAM,GAAG,IAAI,MAAM;;;;;"}
|
|
@@ -79,12 +79,22 @@ function createSearchMedia(data) {
|
|
|
79
79
|
alias: data.alias,
|
|
80
80
|
isOffical: data.isOffical,
|
|
81
81
|
username: data.username,
|
|
82
|
-
artists: data.artists.map(createArtistRef),
|
|
82
|
+
artists: data.artists ? data.artists.map(createArtistRef) : [],
|
|
83
83
|
isWorldWide: data.isWorldWide,
|
|
84
84
|
thumbnail: {
|
|
85
85
|
w94: data.thumbnail,
|
|
86
86
|
w240: data.thumbnailM
|
|
87
87
|
},
|
|
88
|
+
album: data.album ? {
|
|
89
|
+
id: data.album.encodeId,
|
|
90
|
+
name: data.album.title,
|
|
91
|
+
isOffical: data.album.isoffical,
|
|
92
|
+
releaseDate: data.album.releaseDate,
|
|
93
|
+
releasedAt: data.album.releasedAt,
|
|
94
|
+
thumbnail: {
|
|
95
|
+
w165: data.album.thumbnail
|
|
96
|
+
}
|
|
97
|
+
} : void 0,
|
|
88
98
|
duration: data.duration,
|
|
89
99
|
hasLyric: !!data.hasLyric
|
|
90
100
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refined.cjs","sources":["../../esm/utils/refined.js"],"sourcesContent":["function createArtistRef(data) {\n return {\n alias: data.alias,\n name: data.name,\n thumbnail: {\n w240: data.thumbnail,\n w600: data.thumbnailM\n },\n ...(typeof data.totalFollow === 'number' ? {\n followCount: data.totalFollow\n } : {})\n };\n}\nfunction createSearchArtist(data) {\n return {\n alias: data.alias,\n name: data.name,\n thumbnail: {\n w240: data.thumbnail,\n w600: data.thumbnailM\n },\n followCount: data.totalFollow\n };\n}\nfunction createArtist(data) {\n return {\n alias: data.alias,\n birthday: data.birthday,\n realname: data.realname,\n thumbnail: {\n w240: data.thumbnail,\n w600: data.thumbnailM\n },\n followCount: data.totalFollow,\n name: data.name,\n national: data.national,\n biography: data.biography\n };\n}\nfunction createAlbum(data) {\n return {\n id: data.encodeId,\n name: data.title,\n isOffical: data.isoffical,\n releaseDate: data.releaseDate,\n releasedAt: data.releasedAt,\n artists: data.artists.map(createArtistRef),\n thumbnail: {\n w165: data.thumbnail\n }\n };\n}\nfunction createMedia(data) {\n return {\n id: data.encodeId,\n name: data.title,\n alias: data.alias,\n isOffical: data.isOffical,\n username: data.username,\n artists: data.artists.map(createArtistRef),\n isWorldWide: data.isWorldWide,\n thumbnail: {\n w94: data.thumbnail,\n w240: data.thumbnailM\n },\n duration: data.duration,\n isPrivate: data.isPrivate,\n releaseDate: data.releaseDate,\n album: createAlbum(data.album),\n hasLyric: !!data.hasLyric\n };\n}\nfunction createSearchMedia(data) {\n return {\n id: data.encodeId,\n name: data.title,\n alias: data.alias,\n isOffical: data.isOffical,\n username: data.username,\n artists: data.artists.map(createArtistRef),\n isWorldWide: data.isWorldWide,\n thumbnail: {\n w94: data.thumbnail,\n w240: data.thumbnailM\n },\n duration: data.duration,\n hasLyric: !!data.hasLyric\n };\n}\nfunction createPlayList(data) {\n return {\n id: data.encodeId,\n name: data.title,\n thumbnail: {\n w165: data.thumbnail,\n w320: data.thumbnailM\n },\n isOffical: data.isoffical,\n releaseDate: data.releaseDate,\n releasedAt: data.releasedAt,\n artists: data.artists.map(createArtistRef),\n isPrivate: data.isPrivate,\n isSingle: data.isSingle,\n description: data.description,\n alias: data.aliasTitle,\n updatedAt: data.contentLastUpdate,\n likeCount: data.like,\n listenCount: data.listen,\n mediaCount: data.song.total,\n duration: data.song.totalDuration,\n media: data.song.items.map(createMedia)\n };\n}\nfunction createSearchPlayList(data) {\n return {\n id: data.encodeId,\n name: data.title,\n thumbnail: {\n w165: data.thumbnail,\n w320: data.thumbnailM\n },\n isOffical: data.isoffical,\n releaseDate: data.releaseDate,\n releasedAt: data.releasedAt,\n artists: data.artists.map(createArtistRef),\n isPrivate: data.isPrivate,\n isSingle: data.isSingle,\n alias: data.aliasTitle\n };\n}\nexport { createArtist, createMedia, createPlayList, createSearchMedia, createSearchPlayList, createSearchArtist };\n//# sourceMappingURL=refined.js.map"],"names":[],"mappings":";;AAAA,SAAS,eAAe,CAAC,IAAI,EAAE;AAC/B,IAAI,OAAO;AACX,QAAQ,KAAK,EAAE,IAAI,CAAC,KAAK;AACzB,QAAQ,IAAI,EAAE,IAAI,CAAC,IAAI;AACvB,QAAQ,SAAS,EAAE;AACnB,YAAY,IAAI,EAAE,IAAI,CAAC,SAAS;AAChC,YAAY,IAAI,EAAE,IAAI,CAAC;AACvB,SAAS;AACT,QAAQ,IAAI,OAAO,IAAI,CAAC,WAAW,KAAK,QAAQ,GAAG;AACnD,YAAY,WAAW,EAAE,IAAI,CAAC;AAC9B,SAAS,GAAG,EAAE;AACd,KAAK;AACL;AACA,SAAS,kBAAkB,CAAC,IAAI,EAAE;AAClC,IAAI,OAAO;AACX,QAAQ,KAAK,EAAE,IAAI,CAAC,KAAK;AACzB,QAAQ,IAAI,EAAE,IAAI,CAAC,IAAI;AACvB,QAAQ,SAAS,EAAE;AACnB,YAAY,IAAI,EAAE,IAAI,CAAC,SAAS;AAChC,YAAY,IAAI,EAAE,IAAI,CAAC;AACvB,SAAS;AACT,QAAQ,WAAW,EAAE,IAAI,CAAC;AAC1B,KAAK;AACL;AACA,SAAS,YAAY,CAAC,IAAI,EAAE;AAC5B,IAAI,OAAO;AACX,QAAQ,KAAK,EAAE,IAAI,CAAC,KAAK;AACzB,QAAQ,QAAQ,EAAE,IAAI,CAAC,Q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AC,SAAS;AAC/B,YAAY,IAAI,EAAE,IAAI,CAAC;AACvB,SAAS;AACT,QAAQ,QAAQ,EAAE,IAAI,CAAC,QAAQ;AAC/B,QAAQ,SAAS,EAAE,IAAI,CAAC,SAAS;AACjC,QAAQ,WAAW,EAAE,IAAI,CAAC,WAAW;AACrC,QAAQ,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC;AACtC,QAAQ,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC;AACzB,KAAK;AACL;AACA,SAAS,iBAAiB,CAAC,IAAI,EAAE;AACjC,IAAI,OAAO;AACX,QAAQ,EAAE,EAAE,IAAI,CAAC,QAAQ;AACzB,QAAQ,IAAI,EAAE,IAAI,CAAC,KAAK;AACxB,QAAQ,KAAK,EAAE,IAAI,CAAC,KAAK;AACzB,QAAQ,SAAS,EAAE,IAAI,CAAC,SAAS;AACjC,QAAQ,QAAQ,EAAE,IAAI,CAAC,QAAQ;AAC/B,QAAQ,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"refined.cjs","sources":["../../esm/utils/refined.js"],"sourcesContent":["function createArtistRef(data) {\n return {\n alias: data.alias,\n name: data.name,\n thumbnail: {\n w240: data.thumbnail,\n w600: data.thumbnailM\n },\n ...(typeof data.totalFollow === 'number' ? {\n followCount: data.totalFollow\n } : {})\n };\n}\nfunction createSearchArtist(data) {\n return {\n alias: data.alias,\n name: data.name,\n thumbnail: {\n w240: data.thumbnail,\n w600: data.thumbnailM\n },\n followCount: data.totalFollow\n };\n}\nfunction createArtist(data) {\n return {\n alias: data.alias,\n birthday: data.birthday,\n realname: data.realname,\n thumbnail: {\n w240: data.thumbnail,\n w600: data.thumbnailM\n },\n followCount: data.totalFollow,\n name: data.name,\n national: data.national,\n biography: data.biography\n };\n}\nfunction createAlbum(data) {\n return {\n id: data.encodeId,\n name: data.title,\n isOffical: data.isoffical,\n releaseDate: data.releaseDate,\n releasedAt: data.releasedAt,\n artists: data.artists.map(createArtistRef),\n thumbnail: {\n w165: data.thumbnail\n }\n };\n}\nfunction createMedia(data) {\n return {\n id: data.encodeId,\n name: data.title,\n alias: data.alias,\n isOffical: data.isOffical,\n username: data.username,\n artists: data.artists.map(createArtistRef),\n isWorldWide: data.isWorldWide,\n thumbnail: {\n w94: data.thumbnail,\n w240: data.thumbnailM\n },\n duration: data.duration,\n isPrivate: data.isPrivate,\n releaseDate: data.releaseDate,\n album: createAlbum(data.album),\n hasLyric: !!data.hasLyric\n };\n}\nfunction createSearchMedia(data) {\n return {\n id: data.encodeId,\n name: data.title,\n alias: data.alias,\n isOffical: data.isOffical,\n username: data.username,\n artists: data.artists ? data.artists.map(createArtistRef) : [],\n isWorldWide: data.isWorldWide,\n thumbnail: {\n w94: data.thumbnail,\n w240: data.thumbnailM\n },\n album: data.album ? {\n id: data.album.encodeId,\n name: data.album.title,\n isOffical: data.album.isoffical,\n releaseDate: data.album.releaseDate,\n releasedAt: data.album.releasedAt,\n thumbnail: {\n w165: data.album.thumbnail\n }\n } : void 0,\n duration: data.duration,\n hasLyric: !!data.hasLyric\n };\n}\nfunction createPlayList(data) {\n return {\n id: data.encodeId,\n name: data.title,\n thumbnail: {\n w165: data.thumbnail,\n w320: data.thumbnailM\n },\n isOffical: data.isoffical,\n releaseDate: data.releaseDate,\n releasedAt: data.releasedAt,\n artists: data.artists.map(createArtistRef),\n isPrivate: data.isPrivate,\n isSingle: data.isSingle,\n description: data.description,\n alias: data.aliasTitle,\n updatedAt: data.contentLastUpdate,\n likeCount: data.like,\n listenCount: data.listen,\n mediaCount: data.song.total,\n duration: data.song.totalDuration,\n media: data.song.items.map(createMedia)\n };\n}\nfunction createSearchPlayList(data) {\n return {\n id: data.encodeId,\n name: data.title,\n thumbnail: {\n w165: data.thumbnail,\n w320: data.thumbnailM\n },\n isOffical: data.isoffical,\n releaseDate: data.releaseDate,\n releasedAt: data.releasedAt,\n artists: data.artists.map(createArtistRef),\n isPrivate: data.isPrivate,\n isSingle: data.isSingle,\n alias: data.aliasTitle\n };\n}\nexport { createArtist, createMedia, createPlayList, createSearchMedia, createSearchPlayList, createSearchArtist };\n//# sourceMappingURL=refined.js.map"],"names":[],"mappings":";;AAAA,SAAS,eAAe,CAAC,IAAI,EAAE;AAC/B,IAAI,OAAO;AACX,QAAQ,KAAK,EAAE,IAAI,CAAC,KAAK;AACzB,QAAQ,IAAI,EAAE,IAAI,CAAC,IAAI;AACvB,QAAQ,SAAS,EAAE;AACnB,YAAY,IAAI,EAAE,IAAI,CAAC,SAAS;AAChC,YAAY,IAAI,EAAE,IAAI,CAAC;AACvB,SAAS;AACT,QAAQ,IAAI,OAAO,IAAI,CAAC,WAAW,KAAK,QAAQ,GAAG;AACnD,YAAY,WAAW,EAAE,IAAI,CAAC;AAC9B,SAAS,GAAG,EAAE;AACd,KAAK;AACL;AACA,SAAS,kBAAkB,CAAC,IAAI,EAAE;AAClC,IAAI,OAAO;AACX,QAAQ,KAAK,EAAE,IAAI,CAAC,KAAK;AACzB,QAAQ,IAAI,EAAE,IAAI,CAAC,IAAI;AACvB,QAAQ,SAAS,EAAE;AACnB,YAAY,IAAI,EAAE,IAAI,CAAC,SAAS;AAChC,YAAY,IAAI,EAAE,IAAI,CAAC;AACvB,SAAS;AACT,QAAQ,WAAW,EAAE,IAAI,CAAC;AAC1B,KAAK;AACL;AACA,SAAS,YAAY,CAAC,IAAI,EAAE;AAC5B,IAAI,OAAO;AACX,QAAQ,KAAK,EAAE,IAAI,CAAC,KAAK;AACzB,QAAQ,QAAQ,EAAE,IAAI,CAAC,QAAQ;AAC/B,QAAQ,QAAQ,EAAE,IAAI,CAAC,QAAQ;AAC/B,QAAQ,SAAS,EAAE;AACnB,YAAY,IAAI,EAAE,IAAI,CAAC,SAAS;AAChC,YAAY,IAAI,EAAE,IAAI,CAAC;AACvB,SAAS;AACT,QAAQ,WAAW,EAAE,IAAI,CAAC,WAAW;AACrC,QAAQ,IAAI,EAAE,I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