@ikenxuan/amagi 4.4.11 → 4.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/default/cjs/index.cjs +98 -93
- package/dist/default/esm/index.mjs +98 -94
- package/dist/default/index.d.ts +66 -42
- package/dist/exports/log4js.cjs +22 -0
- package/dist/exports/log4js.d.ts +2 -0
- package/dist/exports/log4js.js +2 -0
- package/package.json +7 -2
|
@@ -236,7 +236,7 @@ var bilibili = {
|
|
|
236
236
|
* @param cookie 有效的用户 Cookie
|
|
237
237
|
* @returns 接口返回的原始数据
|
|
238
238
|
*/
|
|
239
|
-
async
|
|
239
|
+
getVideoInfo: async (options, cookie) => {
|
|
240
240
|
const { typeMode, ...restOptions } = options;
|
|
241
241
|
const data2 = await BilibiliData({ ...restOptions, methodType: "\u5355\u4E2A\u89C6\u9891\u4F5C\u54C1\u6570\u636E" }, cookie);
|
|
242
242
|
return data2;
|
|
@@ -247,7 +247,7 @@ var bilibili = {
|
|
|
247
247
|
* @param cookie 有效的用户 Cookie
|
|
248
248
|
* @returns 接口返回的原始数据
|
|
249
249
|
*/
|
|
250
|
-
async
|
|
250
|
+
getVideoStream: async (options, cookie) => {
|
|
251
251
|
const { typeMode, ...restOptions } = options;
|
|
252
252
|
const data2 = await BilibiliData({ ...restOptions, methodType: "\u5355\u4E2A\u89C6\u9891\u4E0B\u8F7D\u4FE1\u606F\u6570\u636E" }, cookie);
|
|
253
253
|
return data2;
|
|
@@ -258,7 +258,7 @@ var bilibili = {
|
|
|
258
258
|
* @param cookie 有效的用户 Cookie
|
|
259
259
|
* @returns 接口返回的原始数据
|
|
260
260
|
*/
|
|
261
|
-
async
|
|
261
|
+
getComments: async (options, cookie) => {
|
|
262
262
|
const { typeMode, ...restOptions } = options;
|
|
263
263
|
const data2 = await BilibiliData({ ...restOptions, methodType: "\u8BC4\u8BBA\u6570\u636E" }, cookie);
|
|
264
264
|
return data2;
|
|
@@ -269,7 +269,7 @@ var bilibili = {
|
|
|
269
269
|
* @param cookie 有效的用户 Cookie
|
|
270
270
|
* @returns 接口返回的原始数据
|
|
271
271
|
*/
|
|
272
|
-
async
|
|
272
|
+
getUserProfile: async (options, cookie) => {
|
|
273
273
|
const { typeMode, ...restOptions } = options;
|
|
274
274
|
const data2 = await BilibiliData({ ...restOptions, methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" }, cookie);
|
|
275
275
|
return data2;
|
|
@@ -280,7 +280,7 @@ var bilibili = {
|
|
|
280
280
|
* @param cookie 有效的用户 Cookie
|
|
281
281
|
* @returns 接口返回的原始数据
|
|
282
282
|
*/
|
|
283
|
-
async
|
|
283
|
+
getUserDynamic: async (options, cookie) => {
|
|
284
284
|
const { typeMode, ...restOptions } = options;
|
|
285
285
|
const data2 = await BilibiliData({ ...restOptions, methodType: "\u7528\u6237\u4E3B\u9875\u52A8\u6001\u5217\u8868\u6570\u636E" }, cookie);
|
|
286
286
|
return data2;
|
|
@@ -291,7 +291,7 @@ var bilibili = {
|
|
|
291
291
|
* @param cookie 有效的用户 Cookie
|
|
292
292
|
* @returns 接口返回的原始数据
|
|
293
293
|
*/
|
|
294
|
-
async
|
|
294
|
+
getEmojiList: async (options, cookie) => {
|
|
295
295
|
const { typeMode, ...restOptions } = options;
|
|
296
296
|
const data2 = await BilibiliData({ ...restOptions, methodType: "Emoji\u6570\u636E" }, cookie);
|
|
297
297
|
return data2;
|
|
@@ -302,7 +302,7 @@ var bilibili = {
|
|
|
302
302
|
* @param cookie 有效的用户 Cookie
|
|
303
303
|
* @returns 接口返回的原始数据
|
|
304
304
|
*/
|
|
305
|
-
async
|
|
305
|
+
getBangumiInfo: async (options, cookie) => {
|
|
306
306
|
const { typeMode, ...restOptions } = options;
|
|
307
307
|
const data2 = await BilibiliData({ ...restOptions, methodType: "\u756A\u5267\u57FA\u672C\u4FE1\u606F\u6570\u636E" }, cookie);
|
|
308
308
|
return data2;
|
|
@@ -313,7 +313,7 @@ var bilibili = {
|
|
|
313
313
|
* @param cookie 有效的用户 Cookie
|
|
314
314
|
* @returns 接口返回的原始数据
|
|
315
315
|
*/
|
|
316
|
-
async
|
|
316
|
+
getBangumiStream: async (options, cookie) => {
|
|
317
317
|
const { typeMode, ...restOptions } = options;
|
|
318
318
|
const data2 = await BilibiliData({ ...restOptions, methodType: "\u756A\u5267\u4E0B\u8F7D\u4FE1\u606F\u6570\u636E" }, cookie);
|
|
319
319
|
return data2;
|
|
@@ -324,7 +324,7 @@ var bilibili = {
|
|
|
324
324
|
* @param cookie 有效的用户 Cookie
|
|
325
325
|
* @returns 接口返回的原始数据
|
|
326
326
|
*/
|
|
327
|
-
async
|
|
327
|
+
getDynamicInfo: async (options, cookie) => {
|
|
328
328
|
const { typeMode, ...restOptions } = options;
|
|
329
329
|
const data2 = await BilibiliData({ ...restOptions, methodType: "\u52A8\u6001\u8BE6\u60C5\u6570\u636E" }, cookie);
|
|
330
330
|
return data2;
|
|
@@ -335,7 +335,7 @@ var bilibili = {
|
|
|
335
335
|
* @param cookie 有效的用户 Cookie
|
|
336
336
|
* @returns 接口返回的原始数据
|
|
337
337
|
*/
|
|
338
|
-
async
|
|
338
|
+
getDynamicCard: async (options, cookie) => {
|
|
339
339
|
const { typeMode, ...restOptions } = options;
|
|
340
340
|
const data2 = await BilibiliData({ ...restOptions, methodType: "\u52A8\u6001\u5361\u7247\u6570\u636E" }, cookie);
|
|
341
341
|
return data2;
|
|
@@ -346,7 +346,7 @@ var bilibili = {
|
|
|
346
346
|
* @param cookie 有效的用户 Cookie
|
|
347
347
|
* @returns 接口返回的原始数据
|
|
348
348
|
*/
|
|
349
|
-
async
|
|
349
|
+
getLiveRoomDetail: async (options, cookie) => {
|
|
350
350
|
const { typeMode, ...restOptions } = options;
|
|
351
351
|
const data2 = await BilibiliData({ ...restOptions, methodType: "\u76F4\u64AD\u95F4\u4FE1\u606F" }, cookie);
|
|
352
352
|
return data2;
|
|
@@ -357,7 +357,7 @@ var bilibili = {
|
|
|
357
357
|
* @param cookie 有效的用户 Cookie
|
|
358
358
|
* @returns 接口返回的原始数据
|
|
359
359
|
*/
|
|
360
|
-
async
|
|
360
|
+
getLiveRoomInitInfo: async (options, cookie) => {
|
|
361
361
|
const { typeMode, ...restOptions } = options;
|
|
362
362
|
const data2 = await BilibiliData({ ...restOptions, methodType: "\u76F4\u64AD\u95F4\u521D\u59CB\u5316\u4FE1\u606F" }, cookie);
|
|
363
363
|
return data2;
|
|
@@ -368,7 +368,7 @@ var bilibili = {
|
|
|
368
368
|
* @param cookie 有效的用户 Cookie
|
|
369
369
|
* @returns 接口返回的原始数据
|
|
370
370
|
*/
|
|
371
|
-
async
|
|
371
|
+
getLoginBasicInfo: async (options, cookie) => {
|
|
372
372
|
const { typeMode, ...restOptions } = options;
|
|
373
373
|
const data2 = await BilibiliData({ ...restOptions, methodType: "\u767B\u5F55\u57FA\u672C\u4FE1\u606F" }, cookie);
|
|
374
374
|
return data2;
|
|
@@ -379,7 +379,7 @@ var bilibili = {
|
|
|
379
379
|
* @param cookie 有效的用户 Cookie
|
|
380
380
|
* @returns 接口返回的原始数据
|
|
381
381
|
*/
|
|
382
|
-
async
|
|
382
|
+
getLoginQrcode: async (options, cookie) => {
|
|
383
383
|
const { typeMode, ...restOptions } = options;
|
|
384
384
|
const data2 = await BilibiliData({ ...restOptions, methodType: "\u7533\u8BF7\u4E8C\u7EF4\u7801" }, cookie);
|
|
385
385
|
return data2;
|
|
@@ -390,7 +390,7 @@ var bilibili = {
|
|
|
390
390
|
* @param cookie 有效的用户 Cookie
|
|
391
391
|
* @returns 接口返回的原始数据
|
|
392
392
|
*/
|
|
393
|
-
async
|
|
393
|
+
checkQrcodeStatus: async (options, cookie) => {
|
|
394
394
|
const { typeMode, ...restOptions } = options;
|
|
395
395
|
const data2 = await BilibiliData({ ...restOptions, methodType: "\u4E8C\u7EF4\u7801\u72B6\u6001" }, cookie);
|
|
396
396
|
return data2;
|
|
@@ -401,7 +401,7 @@ var bilibili = {
|
|
|
401
401
|
* @param cookie 有效的用户 Cookie
|
|
402
402
|
* @returns 接口返回的原始数据
|
|
403
403
|
*/
|
|
404
|
-
async
|
|
404
|
+
getUserTotalPlayCount: async (options, cookie) => {
|
|
405
405
|
const { typeMode, ...restOptions } = options;
|
|
406
406
|
const data2 = await BilibiliData({ ...restOptions, methodType: "\u83B7\u53D6UP\u4E3B\u603B\u64AD\u653E\u91CF" }, cookie);
|
|
407
407
|
return data2;
|
|
@@ -412,7 +412,7 @@ var bilibili = {
|
|
|
412
412
|
* @param cookie 有效的用户 Cookie (此接口通常不需要)
|
|
413
413
|
* @returns 接口返回的原始数据
|
|
414
414
|
*/
|
|
415
|
-
async
|
|
415
|
+
convertAvToBv: async (options, cookie) => {
|
|
416
416
|
const { typeMode, ...restOptions } = options;
|
|
417
417
|
const data2 = await BilibiliData({ ...restOptions, methodType: "AV\u8F6CBV" }, cookie);
|
|
418
418
|
return data2;
|
|
@@ -423,7 +423,7 @@ var bilibili = {
|
|
|
423
423
|
* @param cookie 有效的用户 Cookie (此接口通常不需要)
|
|
424
424
|
* @returns 接口返回的原始数据
|
|
425
425
|
*/
|
|
426
|
-
async
|
|
426
|
+
convertBvToAv: async (options, cookie) => {
|
|
427
427
|
const { typeMode, ...restOptions } = options;
|
|
428
428
|
const data2 = await BilibiliData({ ...restOptions, methodType: "BV\u8F6CAV" }, cookie);
|
|
429
429
|
return data2;
|
|
@@ -598,17 +598,17 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
598
598
|
case "\u5355\u4E2A\u89C6\u9891\u4F5C\u54C1\u6570\u636E": {
|
|
599
599
|
BilibiliValidateData(data2, ["bvid"]);
|
|
600
600
|
const INFODATA = await GlobalGetData({
|
|
601
|
-
url:
|
|
601
|
+
url: bilibiliApiUrls.\u89C6\u9891\u8BE6\u7EC6\u4FE1\u606F({ bvid: data2.bvid }),
|
|
602
602
|
...data2
|
|
603
603
|
});
|
|
604
604
|
return INFODATA;
|
|
605
605
|
}
|
|
606
606
|
case "\u5355\u4E2A\u89C6\u9891\u4E0B\u8F7D\u4FE1\u606F\u6570\u636E": {
|
|
607
607
|
BilibiliValidateData(data2, ["avid", "cid"]);
|
|
608
|
-
const BASEURL =
|
|
608
|
+
const BASEURL = bilibiliApiUrls.\u89C6\u9891\u6D41\u4FE1\u606F({ avid: data2.avid, cid: data2.cid });
|
|
609
609
|
const SIGN = await qtparam(BASEURL, headers2.cookie);
|
|
610
610
|
const DATA = await GlobalGetData({
|
|
611
|
-
url:
|
|
611
|
+
url: bilibiliApiUrls.\u89C6\u9891\u6D41\u4FE1\u606F({ avid: data2.avid, cid: data2.cid }) + SIGN.QUERY,
|
|
612
612
|
headers: headers2,
|
|
613
613
|
...data2
|
|
614
614
|
});
|
|
@@ -632,13 +632,13 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
632
632
|
} else {
|
|
633
633
|
requestCount = Math.min(20, Number(number) - fetchedComments.length);
|
|
634
634
|
}
|
|
635
|
-
const url =
|
|
635
|
+
const url = bilibiliApiUrls.\u8BC4\u8BBA\u533A\u660E\u7EC6({
|
|
636
636
|
type,
|
|
637
637
|
oid,
|
|
638
638
|
number: requestCount,
|
|
639
639
|
pn
|
|
640
640
|
});
|
|
641
|
-
const checkStatusUrl =
|
|
641
|
+
const checkStatusUrl = bilibiliApiUrls.\u8BC4\u8BBA\u533A\u72B6\u6001({ oid, type });
|
|
642
642
|
const checkStatusRes = await GlobalGetData({
|
|
643
643
|
url: checkStatusUrl,
|
|
644
644
|
headers: headers2,
|
|
@@ -687,7 +687,7 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
687
687
|
}
|
|
688
688
|
case "Emoji\u6570\u636E": {
|
|
689
689
|
return await GlobalGetData({
|
|
690
|
-
url:
|
|
690
|
+
url: bilibiliApiUrls.\u8868\u60C5\u5217\u8868(),
|
|
691
691
|
...data2
|
|
692
692
|
});
|
|
693
693
|
}
|
|
@@ -700,7 +700,7 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
700
700
|
const idType = id ? id.startsWith("ep") ? "ep_id" : "season_id" : "ep_id";
|
|
701
701
|
const newId = idType === "ep_id" ? id.replace("ep", "") : id.replace("ss", "");
|
|
702
702
|
const INFO = await GlobalGetData({
|
|
703
|
-
url:
|
|
703
|
+
url: bilibiliApiUrls.\u756A\u5267\u660E\u7EC6({ [idType]: newId }),
|
|
704
704
|
headers: headers2,
|
|
705
705
|
...data2
|
|
706
706
|
});
|
|
@@ -708,10 +708,10 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
708
708
|
}
|
|
709
709
|
case "\u756A\u5267\u4E0B\u8F7D\u4FE1\u606F\u6570\u636E": {
|
|
710
710
|
BilibiliValidateData(data2, ["cid", "ep_id"]);
|
|
711
|
-
const BASEURL =
|
|
711
|
+
const BASEURL = bilibiliApiUrls.\u756A\u5267\u89C6\u9891\u6D41\u4FE1\u606F({ cid: data2.cid, ep_id: data2.ep_id.replace("ep", "") });
|
|
712
712
|
const SIGN = await qtparam(BASEURL, headers2.cookie);
|
|
713
713
|
const DATA = await GlobalGetData({
|
|
714
|
-
url:
|
|
714
|
+
url: bilibiliApiUrls.\u756A\u5267\u89C6\u9891\u6D41\u4FE1\u606F({ cid: data2.cid, ep_id: data2.ep_id.replace("ep", "") }) + SIGN.QUERY,
|
|
715
715
|
headers: headers2,
|
|
716
716
|
...data2
|
|
717
717
|
});
|
|
@@ -722,7 +722,7 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
722
722
|
delete headers2.referer;
|
|
723
723
|
const { host_mid } = data2;
|
|
724
724
|
const result = await GlobalGetData({
|
|
725
|
-
url:
|
|
725
|
+
url: bilibiliApiUrls.\u7528\u6237\u7A7A\u95F4\u52A8\u6001({ host_mid }),
|
|
726
726
|
headers: headers2,
|
|
727
727
|
...data2
|
|
728
728
|
});
|
|
@@ -732,7 +732,7 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
732
732
|
BilibiliValidateData(data2, ["dynamic_id"]);
|
|
733
733
|
delete headers2.referer;
|
|
734
734
|
const dynamicINFO = await GlobalGetData({
|
|
735
|
-
url:
|
|
735
|
+
url: bilibiliApiUrls.\u52A8\u6001\u8BE6\u60C5({ dynamic_id: data2.dynamic_id }),
|
|
736
736
|
headers: headers2,
|
|
737
737
|
...data2
|
|
738
738
|
});
|
|
@@ -743,7 +743,7 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
743
743
|
delete headers2.referer;
|
|
744
744
|
const { dynamic_id } = data2;
|
|
745
745
|
const dynamicINFO_CARD = await GlobalGetData({
|
|
746
|
-
url:
|
|
746
|
+
url: bilibiliApiUrls.\u52A8\u6001\u5361\u7247\u4FE1\u606F({ dynamic_id }),
|
|
747
747
|
headers: headers2,
|
|
748
748
|
...data2
|
|
749
749
|
});
|
|
@@ -753,7 +753,7 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
753
753
|
BilibiliValidateData(data2, ["host_mid"]);
|
|
754
754
|
const { host_mid } = data2;
|
|
755
755
|
const result = await GlobalGetData({
|
|
756
|
-
url:
|
|
756
|
+
url: bilibiliApiUrls.\u7528\u6237\u540D\u7247\u4FE1\u606F({ host_mid }),
|
|
757
757
|
headers: headers2,
|
|
758
758
|
...data2
|
|
759
759
|
});
|
|
@@ -762,7 +762,7 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
762
762
|
case "\u76F4\u64AD\u95F4\u4FE1\u606F": {
|
|
763
763
|
BilibiliValidateData(data2, ["room_id"]);
|
|
764
764
|
const result = await GlobalGetData({
|
|
765
|
-
url:
|
|
765
|
+
url: bilibiliApiUrls.\u76F4\u64AD\u95F4\u4FE1\u606F({ room_id: data2.room_id }),
|
|
766
766
|
headers: headers2,
|
|
767
767
|
...data2
|
|
768
768
|
});
|
|
@@ -771,7 +771,7 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
771
771
|
case "\u76F4\u64AD\u95F4\u521D\u59CB\u5316\u4FE1\u606F": {
|
|
772
772
|
BilibiliValidateData(data2, ["room_id"]);
|
|
773
773
|
const result = await GlobalGetData({
|
|
774
|
-
url:
|
|
774
|
+
url: bilibiliApiUrls.\u76F4\u64AD\u95F4\u521D\u59CB\u5316\u4FE1\u606F({ room_id: data2.room_id }),
|
|
775
775
|
headers: headers2,
|
|
776
776
|
...data2
|
|
777
777
|
});
|
|
@@ -779,7 +779,7 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
779
779
|
}
|
|
780
780
|
case "\u7533\u8BF7\u4E8C\u7EF4\u7801": {
|
|
781
781
|
const result = await GlobalGetData({
|
|
782
|
-
url:
|
|
782
|
+
url: bilibiliApiUrls.\u7533\u8BF7\u4E8C\u7EF4\u7801(),
|
|
783
783
|
headers: headers2,
|
|
784
784
|
...data2
|
|
785
785
|
});
|
|
@@ -788,7 +788,7 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
788
788
|
case "\u4E8C\u7EF4\u7801\u72B6\u6001": {
|
|
789
789
|
BilibiliValidateData(data2, ["qrcode_key"]);
|
|
790
790
|
const result = await new Networks({
|
|
791
|
-
url:
|
|
791
|
+
url: bilibiliApiUrls.\u4E8C\u7EF4\u7801\u72B6\u6001({ qrcode_key: data2.qrcode_key }),
|
|
792
792
|
headers: headers2,
|
|
793
793
|
...data2
|
|
794
794
|
}).getHeadersAndData();
|
|
@@ -796,7 +796,7 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
796
796
|
}
|
|
797
797
|
case "\u767B\u5F55\u57FA\u672C\u4FE1\u606F": {
|
|
798
798
|
const result = await GlobalGetData({
|
|
799
|
-
url:
|
|
799
|
+
url: bilibiliApiUrls.\u767B\u5F55\u57FA\u672C\u4FE1\u606F(),
|
|
800
800
|
headers: headers2,
|
|
801
801
|
...data2
|
|
802
802
|
});
|
|
@@ -805,7 +805,7 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
805
805
|
case "\u83B7\u53D6UP\u4E3B\u603B\u64AD\u653E\u91CF": {
|
|
806
806
|
BilibiliValidateData(data2, ["host_mid"]);
|
|
807
807
|
const result = await GlobalGetData({
|
|
808
|
-
url:
|
|
808
|
+
url: bilibiliApiUrls.\u83B7\u53D6UP\u4E3B\u603B\u64AD\u653E\u91CF({ host_mid: data2.host_mid }),
|
|
809
809
|
headers: headers2,
|
|
810
810
|
...data2
|
|
811
811
|
});
|
|
@@ -834,7 +834,7 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
834
834
|
};
|
|
835
835
|
}
|
|
836
836
|
default:
|
|
837
|
-
logger.warn(`\u672A\u77E5\
|
|
837
|
+
logger.warn(`\u672A\u77E5\u7684B\u7AD9\u6570\u636E\u63A5\u53E3\uFF1A\u300C${logger.red(data2.methodType)}\u300D`);
|
|
838
838
|
return null;
|
|
839
839
|
}
|
|
840
840
|
};
|
|
@@ -1383,7 +1383,7 @@ var douyin = {
|
|
|
1383
1383
|
* @param cookie 有效的用户 Cookie
|
|
1384
1384
|
* @returns 接口返回的原始数据
|
|
1385
1385
|
*/
|
|
1386
|
-
async
|
|
1386
|
+
getWorkInfo: async (options, cookie) => {
|
|
1387
1387
|
const { typeMode, ...restOptions } = options;
|
|
1388
1388
|
const data2 = await DouyinData({ ...restOptions, methodType: "\u805A\u5408\u89E3\u6790" }, cookie);
|
|
1389
1389
|
return data2;
|
|
@@ -1394,7 +1394,7 @@ var douyin = {
|
|
|
1394
1394
|
* @param cookie 有效的用户 Cookie
|
|
1395
1395
|
* @returns 接口返回的原始数据
|
|
1396
1396
|
*/
|
|
1397
|
-
async
|
|
1397
|
+
getVideoWorkInfo: async (options, cookie) => {
|
|
1398
1398
|
const { typeMode, ...restOptions } = options;
|
|
1399
1399
|
const data2 = await DouyinData({ ...restOptions, methodType: "\u89C6\u9891\u4F5C\u54C1\u6570\u636E" }, cookie);
|
|
1400
1400
|
return data2;
|
|
@@ -1405,7 +1405,7 @@ var douyin = {
|
|
|
1405
1405
|
* @param cookie 有效的用户 Cookie
|
|
1406
1406
|
* @returns 接口返回的原始数据
|
|
1407
1407
|
*/
|
|
1408
|
-
async
|
|
1408
|
+
getImageAlbumWorkInfo: async (options, cookie) => {
|
|
1409
1409
|
const { typeMode, ...restOptions } = options;
|
|
1410
1410
|
const data2 = await DouyinData({ ...restOptions, methodType: "\u56FE\u96C6\u4F5C\u54C1\u6570\u636E" }, cookie);
|
|
1411
1411
|
return data2;
|
|
@@ -1416,7 +1416,7 @@ var douyin = {
|
|
|
1416
1416
|
* @param cookie 有效的用户 Cookie
|
|
1417
1417
|
* @returns 接口返回的原始数据
|
|
1418
1418
|
*/
|
|
1419
|
-
async
|
|
1419
|
+
getSlidesWorkInfo: async (options, cookie) => {
|
|
1420
1420
|
const { typeMode, ...restOptions } = options;
|
|
1421
1421
|
const data2 = await DouyinData({ ...restOptions, methodType: "\u5408\u8F91\u4F5C\u54C1\u6570\u636E" }, cookie);
|
|
1422
1422
|
return data2;
|
|
@@ -1427,7 +1427,7 @@ var douyin = {
|
|
|
1427
1427
|
* @param cookie 有效的用户 Cookie
|
|
1428
1428
|
* @returns 接口返回的原始数据
|
|
1429
1429
|
*/
|
|
1430
|
-
async
|
|
1430
|
+
getComments: async (options, cookie) => {
|
|
1431
1431
|
const { typeMode, ...restOptions } = options;
|
|
1432
1432
|
const data2 = await DouyinData({ ...restOptions, methodType: "\u8BC4\u8BBA\u6570\u636E" }, cookie);
|
|
1433
1433
|
return data2;
|
|
@@ -1438,7 +1438,7 @@ var douyin = {
|
|
|
1438
1438
|
* @param cookie 有效的用户 Cookie
|
|
1439
1439
|
* @returns 接口返回的原始数据
|
|
1440
1440
|
*/
|
|
1441
|
-
async
|
|
1441
|
+
getCommentReplies: async (options, cookie) => {
|
|
1442
1442
|
const { typeMode, ...restOptions } = options;
|
|
1443
1443
|
const data2 = await DouyinData({ ...restOptions, methodType: "\u6307\u5B9A\u8BC4\u8BBA\u56DE\u590D\u6570\u636E" }, cookie);
|
|
1444
1444
|
return data2;
|
|
@@ -1449,7 +1449,7 @@ var douyin = {
|
|
|
1449
1449
|
* @param cookie 有效的用户 Cookie
|
|
1450
1450
|
* @returns 接口返回的原始数据
|
|
1451
1451
|
*/
|
|
1452
|
-
async
|
|
1452
|
+
getUserProfile: async (options, cookie) => {
|
|
1453
1453
|
const { typeMode, ...restOptions } = options;
|
|
1454
1454
|
const data2 = await DouyinData({ ...restOptions, methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" }, cookie);
|
|
1455
1455
|
return data2;
|
|
@@ -1460,7 +1460,7 @@ var douyin = {
|
|
|
1460
1460
|
* @param cookie 可选的用户 Cookie
|
|
1461
1461
|
* @returns 接口返回的原始数据
|
|
1462
1462
|
*/
|
|
1463
|
-
async
|
|
1463
|
+
getEmojiList: async (options, cookie) => {
|
|
1464
1464
|
const { typeMode, ...restOptions } = options;
|
|
1465
1465
|
const data2 = await DouyinData({ ...restOptions, methodType: "Emoji\u6570\u636E" }, cookie);
|
|
1466
1466
|
return data2;
|
|
@@ -1471,7 +1471,7 @@ var douyin = {
|
|
|
1471
1471
|
* @param cookie 有效的用户 Cookie
|
|
1472
1472
|
* @returns 接口返回的原始数据
|
|
1473
1473
|
*/
|
|
1474
|
-
async
|
|
1474
|
+
getEmojiProList: async (options, cookie) => {
|
|
1475
1475
|
const { typeMode, ...restOptions } = options;
|
|
1476
1476
|
const data2 = await DouyinData({ ...restOptions, methodType: "\u52A8\u6001\u8868\u60C5\u6570\u636E" }, cookie);
|
|
1477
1477
|
return data2;
|
|
@@ -1482,7 +1482,7 @@ var douyin = {
|
|
|
1482
1482
|
* @param cookie 有效的用户 Cookie
|
|
1483
1483
|
* @returns 接口返回的原始数据
|
|
1484
1484
|
*/
|
|
1485
|
-
async
|
|
1485
|
+
getUserVideos: async (options, cookie) => {
|
|
1486
1486
|
const { typeMode, ...restOptions } = options;
|
|
1487
1487
|
const data2 = await DouyinData({ ...restOptions, methodType: "\u7528\u6237\u4E3B\u9875\u89C6\u9891\u5217\u8868\u6570\u636E" }, cookie);
|
|
1488
1488
|
return data2;
|
|
@@ -1493,7 +1493,7 @@ var douyin = {
|
|
|
1493
1493
|
* @param cookie 有效的用户 Cookie
|
|
1494
1494
|
* @returns 接口返回的原始数据
|
|
1495
1495
|
*/
|
|
1496
|
-
async
|
|
1496
|
+
getMusicInfo: async (options, cookie) => {
|
|
1497
1497
|
const { typeMode, ...restOptions } = options;
|
|
1498
1498
|
const data2 = await DouyinData({ ...restOptions, methodType: "\u97F3\u4E50\u6570\u636E" }, cookie);
|
|
1499
1499
|
return data2;
|
|
@@ -1504,7 +1504,7 @@ var douyin = {
|
|
|
1504
1504
|
* @param cookie 有效的用户 Cookie
|
|
1505
1505
|
* @returns 接口返回的原始数据
|
|
1506
1506
|
*/
|
|
1507
|
-
async
|
|
1507
|
+
getSuggestWords: async (options, cookie) => {
|
|
1508
1508
|
const { typeMode, ...restOptions } = options;
|
|
1509
1509
|
const data2 = await DouyinData({ ...restOptions, methodType: "\u70ED\u70B9\u8BCD\u6570\u636E" }, cookie);
|
|
1510
1510
|
return data2;
|
|
@@ -1515,7 +1515,7 @@ var douyin = {
|
|
|
1515
1515
|
* @param cookie 有效的用户 Cookie
|
|
1516
1516
|
* @returns 接口返回的原始数据
|
|
1517
1517
|
*/
|
|
1518
|
-
async
|
|
1518
|
+
search: async (options, cookie) => {
|
|
1519
1519
|
const { typeMode, ...restOptions } = options;
|
|
1520
1520
|
const data2 = await DouyinData({ ...restOptions, methodType: "\u641C\u7D22\u6570\u636E" }, cookie);
|
|
1521
1521
|
return data2;
|
|
@@ -1526,7 +1526,7 @@ var douyin = {
|
|
|
1526
1526
|
* @param cookie 有效的用户 Cookie
|
|
1527
1527
|
* @returns 接口返回的原始数据
|
|
1528
1528
|
*/
|
|
1529
|
-
async
|
|
1529
|
+
getLiveRoomInfo: async (options, cookie) => {
|
|
1530
1530
|
const { typeMode, ...restOptions } = options;
|
|
1531
1531
|
const data2 = await DouyinData({ ...restOptions, methodType: "\u76F4\u64AD\u95F4\u4FE1\u606F\u6570\u636E" }, cookie);
|
|
1532
1532
|
return data2;
|
|
@@ -1537,7 +1537,7 @@ var douyin = {
|
|
|
1537
1537
|
* @param cookie 有效的用户 Cookie
|
|
1538
1538
|
* @returns 接口返回的原始数据 (any)
|
|
1539
1539
|
*/
|
|
1540
|
-
async
|
|
1540
|
+
getLoginQrcode: async (options, cookie) => {
|
|
1541
1541
|
const { typeMode, ...restOptions } = options;
|
|
1542
1542
|
const data2 = await DouyinData({ ...restOptions, methodType: "\u7533\u8BF7\u4E8C\u7EF4\u7801\u6570\u636E" }, cookie);
|
|
1543
1543
|
return data2;
|
|
@@ -1665,7 +1665,7 @@ var DouyinData = async (data2, cookie) => {
|
|
|
1665
1665
|
case "\u56FE\u96C6\u4F5C\u54C1\u6570\u636E":
|
|
1666
1666
|
case "\u5408\u8F91\u4F5C\u54C1\u6570\u636E": {
|
|
1667
1667
|
DouyinValidateData(data2, ["aweme_id"]);
|
|
1668
|
-
const url =
|
|
1668
|
+
const url = douyinApiUrls.\u89C6\u9891\u6216\u56FE\u96C6({ aweme_id: data2.aweme_id });
|
|
1669
1669
|
const VideoData = await GlobalGetData2({
|
|
1670
1670
|
url: `${url}&a_bogus=${douyinSign.AB(url)}`,
|
|
1671
1671
|
headers: headers2,
|
|
@@ -1675,13 +1675,13 @@ var DouyinData = async (data2, cookie) => {
|
|
|
1675
1675
|
}
|
|
1676
1676
|
case "\u8BC4\u8BBA\u6570\u636E": {
|
|
1677
1677
|
DouyinValidateData(data2, ["aweme_id"]);
|
|
1678
|
-
const urlGenerator = (params) =>
|
|
1678
|
+
const urlGenerator = (params) => douyinApiUrls.\u8BC4\u8BBA(params);
|
|
1679
1679
|
const response = await fetchPaginatedData(urlGenerator, data2, 50, headers2);
|
|
1680
1680
|
return response;
|
|
1681
1681
|
}
|
|
1682
1682
|
case "\u6307\u5B9A\u8BC4\u8BBA\u56DE\u590D\u6570\u636E": {
|
|
1683
1683
|
DouyinValidateData(data2, ["aweme_id", "comment_id"]);
|
|
1684
|
-
const urlGenerator = (params) =>
|
|
1684
|
+
const urlGenerator = (params) => douyinApiUrls.\u4E8C\u7EA7\u8BC4\u8BBA(params);
|
|
1685
1685
|
const response = await fetchPaginatedData(
|
|
1686
1686
|
urlGenerator,
|
|
1687
1687
|
data2,
|
|
@@ -1695,7 +1695,7 @@ var DouyinData = async (data2, cookie) => {
|
|
|
1695
1695
|
}
|
|
1696
1696
|
case "\u7528\u6237\u4E3B\u9875\u6570\u636E": {
|
|
1697
1697
|
DouyinValidateData(data2, ["sec_uid"]);
|
|
1698
|
-
const url =
|
|
1698
|
+
const url = douyinApiUrls.\u7528\u6237\u4E3B\u9875\u4FE1\u606F({ sec_uid: data2.sec_uid });
|
|
1699
1699
|
const UserInfoData = await GlobalGetData2({
|
|
1700
1700
|
url: `${url}&a_bogus=${douyinSign.AB(url)}`,
|
|
1701
1701
|
headers: {
|
|
@@ -1707,7 +1707,7 @@ var DouyinData = async (data2, cookie) => {
|
|
|
1707
1707
|
return UserInfoData;
|
|
1708
1708
|
}
|
|
1709
1709
|
case "Emoji\u6570\u636E": {
|
|
1710
|
-
const url =
|
|
1710
|
+
const url = douyinApiUrls.\u8868\u60C5();
|
|
1711
1711
|
const EmojiData = await GlobalGetData2({
|
|
1712
1712
|
url,
|
|
1713
1713
|
headers: headers2,
|
|
@@ -1717,7 +1717,7 @@ var DouyinData = async (data2, cookie) => {
|
|
|
1717
1717
|
}
|
|
1718
1718
|
case "\u7528\u6237\u4E3B\u9875\u89C6\u9891\u5217\u8868\u6570\u636E": {
|
|
1719
1719
|
DouyinValidateData(data2, ["sec_uid"]);
|
|
1720
|
-
const url =
|
|
1720
|
+
const url = douyinApiUrls.\u7528\u6237\u4E3B\u9875\u89C6\u9891({ sec_uid: data2.sec_uid });
|
|
1721
1721
|
const UserVideoListData = await GlobalGetData2({
|
|
1722
1722
|
url: `${url}&a_bogus=${douyinSign.AB(url)}`,
|
|
1723
1723
|
headers: {
|
|
@@ -1730,7 +1730,7 @@ var DouyinData = async (data2, cookie) => {
|
|
|
1730
1730
|
}
|
|
1731
1731
|
case "\u70ED\u70B9\u8BCD\u6570\u636E": {
|
|
1732
1732
|
DouyinValidateData(data2, ["query"]);
|
|
1733
|
-
const url =
|
|
1733
|
+
const url = douyinApiUrls.\u70ED\u70B9\u8BCD({ query: data2.query, number: data2.number ?? 10 });
|
|
1734
1734
|
const SuggestWordsData = await GlobalGetData2({
|
|
1735
1735
|
url: `${url}&a_bogus=${douyinSign.AB(url)}`,
|
|
1736
1736
|
headers: {
|
|
@@ -1749,7 +1749,7 @@ var DouyinData = async (data2, cookie) => {
|
|
|
1749
1749
|
let tmpresp = {};
|
|
1750
1750
|
while (fetchedSearchList.length < Number(data2.number ?? 10)) {
|
|
1751
1751
|
const requestCount = Math.min(Number(data2.number ?? 50) - fetchedSearchList.length, maxPageSize);
|
|
1752
|
-
const url =
|
|
1752
|
+
const url = douyinApiUrls.\u641C\u7D22({
|
|
1753
1753
|
query: data2.query,
|
|
1754
1754
|
number: requestCount,
|
|
1755
1755
|
search_id: search_id === "" ? void 0 : search_id
|
|
@@ -1780,7 +1780,7 @@ var DouyinData = async (data2, cookie) => {
|
|
|
1780
1780
|
return finalResponse;
|
|
1781
1781
|
}
|
|
1782
1782
|
case "\u52A8\u6001\u8868\u60C5\u6570\u636E": {
|
|
1783
|
-
const url =
|
|
1783
|
+
const url = douyinApiUrls.\u4E92\u52A8\u8868\u60C5();
|
|
1784
1784
|
const ExpressionPlusData = await GlobalGetData2({
|
|
1785
1785
|
url: `${url}&a_bogus=${douyinSign.AB(url)}`,
|
|
1786
1786
|
headers: headers2,
|
|
@@ -1790,7 +1790,7 @@ var DouyinData = async (data2, cookie) => {
|
|
|
1790
1790
|
}
|
|
1791
1791
|
case "\u97F3\u4E50\u6570\u636E": {
|
|
1792
1792
|
DouyinValidateData(data2, ["music_id"]);
|
|
1793
|
-
const url =
|
|
1793
|
+
const url = douyinApiUrls.\u80CC\u666F\u97F3\u4E50({ music_id: data2.music_id });
|
|
1794
1794
|
const MusicData = await GlobalGetData2({
|
|
1795
1795
|
url: `${url}&a_bogus=${douyinSign.AB(url)}`,
|
|
1796
1796
|
headers: headers2,
|
|
@@ -1800,7 +1800,7 @@ var DouyinData = async (data2, cookie) => {
|
|
|
1800
1800
|
}
|
|
1801
1801
|
case "\u76F4\u64AD\u95F4\u4FE1\u606F\u6570\u636E": {
|
|
1802
1802
|
DouyinValidateData(data2, ["sec_uid"]);
|
|
1803
|
-
let url =
|
|
1803
|
+
let url = douyinApiUrls.\u7528\u6237\u4E3B\u9875\u4FE1\u606F({ sec_uid: data2.sec_uid });
|
|
1804
1804
|
const UserInfoData = await GlobalGetData2({
|
|
1805
1805
|
url: `${url}&a_bogus=${douyinSign.AB(url)}`,
|
|
1806
1806
|
headers: {
|
|
@@ -1819,7 +1819,7 @@ var DouyinData = async (data2, cookie) => {
|
|
|
1819
1819
|
};
|
|
1820
1820
|
}
|
|
1821
1821
|
const room_data = JSON.parse(UserInfoData.user.room_data);
|
|
1822
|
-
url =
|
|
1822
|
+
url = douyinApiUrls.\u76F4\u64AD\u95F4\u4FE1\u606F({ room_id: UserInfoData.user.room_id_str, web_rid: room_data.owner.web_rid });
|
|
1823
1823
|
const LiveRoomData = await GlobalGetData2({
|
|
1824
1824
|
url: `${url}&a_bogus=${douyinSign.AB(url)}`,
|
|
1825
1825
|
headers: {
|
|
@@ -1832,7 +1832,7 @@ var DouyinData = async (data2, cookie) => {
|
|
|
1832
1832
|
}
|
|
1833
1833
|
case "\u7533\u8BF7\u4E8C\u7EF4\u7801\u6570\u636E": {
|
|
1834
1834
|
DouyinValidateData(data2, ["verify_fp"]);
|
|
1835
|
-
const url =
|
|
1835
|
+
const url = douyinApiUrls.\u7533\u8BF7\u4E8C\u7EF4\u7801({ verify_fp: data2.verify_fp });
|
|
1836
1836
|
const LoginQrcodeStatusData = await GlobalGetData2({
|
|
1837
1837
|
url: `${url}&a_bogus=${douyinSign.AB(url)}`,
|
|
1838
1838
|
headers: headers2,
|
|
@@ -1845,7 +1845,7 @@ var DouyinData = async (data2, cookie) => {
|
|
|
1845
1845
|
return null;
|
|
1846
1846
|
}
|
|
1847
1847
|
};
|
|
1848
|
-
async
|
|
1848
|
+
var fetchPaginatedData = async (apiUrlGenerator, params, maxPageSize, headers2) => {
|
|
1849
1849
|
let cursor = params.cursor ?? 0;
|
|
1850
1850
|
let fetchedData = [];
|
|
1851
1851
|
let tmpresp = {};
|
|
@@ -1874,14 +1874,14 @@ async function fetchPaginatedData(apiUrlGenerator, params, maxPageSize, headers2
|
|
|
1874
1874
|
cursor: params.number === 0 ? 0 : fetchedData.length
|
|
1875
1875
|
};
|
|
1876
1876
|
return finalResponse;
|
|
1877
|
-
}
|
|
1877
|
+
};
|
|
1878
1878
|
async function GlobalGetData2(options) {
|
|
1879
1879
|
const ResponseData = await new Networks(options).getData();
|
|
1880
1880
|
if (ResponseData === "" || !ResponseData) {
|
|
1881
1881
|
logger.warn(`\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u63A5\u53E3\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A
|
|
1882
1882
|
\u4F60\u7684\u6296\u97F3ck\u53EF\u80FD\u5DF2\u7ECF\u5931\u6548\uFF01
|
|
1883
1883
|
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
1884
|
-
\u8BF7\u6C42URL\uFF1A options.url`);
|
|
1884
|
+
\u8BF7\u6C42URL\uFF1A ${options.url}`);
|
|
1885
1885
|
return false;
|
|
1886
1886
|
}
|
|
1887
1887
|
return ResponseData;
|
|
@@ -1970,7 +1970,7 @@ var kuaishou = {
|
|
|
1970
1970
|
* @param cookie 可选的用户 Cookie
|
|
1971
1971
|
* @returns 接口返回的原始数据
|
|
1972
1972
|
*/
|
|
1973
|
-
async
|
|
1973
|
+
getWorkInfo: async (options, cookie) => {
|
|
1974
1974
|
const data2 = await KuaishouData({ ...options, methodType: "\u5355\u4E2A\u89C6\u9891\u4F5C\u54C1\u6570\u636E" }, cookie);
|
|
1975
1975
|
return data2;
|
|
1976
1976
|
},
|
|
@@ -1980,7 +1980,7 @@ var kuaishou = {
|
|
|
1980
1980
|
* @param cookie 可选的用户 Cookie
|
|
1981
1981
|
* @returns 接口返回的原始数据
|
|
1982
1982
|
*/
|
|
1983
|
-
async
|
|
1983
|
+
getComments: async (options, cookie) => {
|
|
1984
1984
|
const data2 = await KuaishouData({ ...options, methodType: "\u8BC4\u8BBA\u6570\u636E" }, cookie);
|
|
1985
1985
|
return data2;
|
|
1986
1986
|
},
|
|
@@ -1990,7 +1990,7 @@ var kuaishou = {
|
|
|
1990
1990
|
* @param cookie 可选的用户 Cookie
|
|
1991
1991
|
* @returns 接口返回的原始数据
|
|
1992
1992
|
*/
|
|
1993
|
-
async
|
|
1993
|
+
getEmojiList: async (options, cookie) => {
|
|
1994
1994
|
const data2 = await KuaishouData({ ...options, methodType: "Emoji\u6570\u636E" }, cookie);
|
|
1995
1995
|
return data2;
|
|
1996
1996
|
}
|
|
@@ -2020,7 +2020,7 @@ var KuaishouData = async (data2, cookie) => {
|
|
|
2020
2020
|
switch (data2.methodType) {
|
|
2021
2021
|
case "\u5355\u4E2A\u89C6\u9891\u4F5C\u54C1\u6570\u636E": {
|
|
2022
2022
|
KusiahouValidateData(data2, ["photoId"]);
|
|
2023
|
-
const body =
|
|
2023
|
+
const body = kuaishouApiUrls.\u5355\u4E2A\u4F5C\u54C1\u4FE1\u606F({ photoId: data2.photoId });
|
|
2024
2024
|
const VideoData = await GlobalGetData3({
|
|
2025
2025
|
url: body.url,
|
|
2026
2026
|
method: "POST",
|
|
@@ -2032,7 +2032,7 @@ var KuaishouData = async (data2, cookie) => {
|
|
|
2032
2032
|
}
|
|
2033
2033
|
case "\u8BC4\u8BBA\u6570\u636E": {
|
|
2034
2034
|
KusiahouValidateData(data2, ["photoId"]);
|
|
2035
|
-
const body =
|
|
2035
|
+
const body = kuaishouApiUrls.\u4F5C\u54C1\u8BC4\u8BBA\u4FE1\u606F({ photoId: data2.photoId });
|
|
2036
2036
|
const VideoData = await GlobalGetData3({
|
|
2037
2037
|
url: body.url,
|
|
2038
2038
|
method: "POST",
|
|
@@ -2043,7 +2043,7 @@ var KuaishouData = async (data2, cookie) => {
|
|
|
2043
2043
|
return VideoData;
|
|
2044
2044
|
}
|
|
2045
2045
|
case "Emoji\u6570\u636E": {
|
|
2046
|
-
const body =
|
|
2046
|
+
const body = kuaishouApiUrls.\u8868\u60C5();
|
|
2047
2047
|
const EmojiData = await GlobalGetData3({
|
|
2048
2048
|
url: body.url,
|
|
2049
2049
|
method: "POST",
|
|
@@ -2371,17 +2371,17 @@ var KusiahouValidateData = (data2, fields, atLeastOne = false) => {
|
|
|
2371
2371
|
}
|
|
2372
2372
|
};
|
|
2373
2373
|
var amagiClient = class {
|
|
2374
|
-
douyin;
|
|
2375
|
-
bilibili;
|
|
2376
|
-
kuaishou;
|
|
2374
|
+
#douyin;
|
|
2375
|
+
#bilibili;
|
|
2376
|
+
#kuaishou;
|
|
2377
2377
|
/**
|
|
2378
2378
|
*
|
|
2379
2379
|
* @param cookie - 包含抖音ck、B站ck、快手ck的对象
|
|
2380
2380
|
*/
|
|
2381
2381
|
constructor(options) {
|
|
2382
|
-
this
|
|
2383
|
-
this
|
|
2384
|
-
this
|
|
2382
|
+
this.#douyin = (options == null ? void 0 : options.douyin) ?? "";
|
|
2383
|
+
this.#bilibili = (options == null ? void 0 : options.bilibili) ?? "";
|
|
2384
|
+
this.#kuaishou = (options == null ? void 0 : options.kuaishou) ?? "";
|
|
2385
2385
|
}
|
|
2386
2386
|
/**
|
|
2387
2387
|
* 启动本地 HTTP 服务
|
|
@@ -2389,7 +2389,7 @@ var amagiClient = class {
|
|
|
2389
2389
|
* @defaultValue `port` 4567
|
|
2390
2390
|
* @returns Express 应用实例
|
|
2391
2391
|
*/
|
|
2392
|
-
startClient(port = 4567) {
|
|
2392
|
+
startClient = (port = 4567) => {
|
|
2393
2393
|
const app = express__default.default();
|
|
2394
2394
|
app.get("/", (_req, res) => {
|
|
2395
2395
|
res.redirect(301, "https://amagi.apifox.cn");
|
|
@@ -2398,14 +2398,14 @@ var amagiClient = class {
|
|
|
2398
2398
|
res.redirect(301, "https://amagi.apifox.cn");
|
|
2399
2399
|
});
|
|
2400
2400
|
app.use(logMiddleware(["/api/douyin", "/api/bilibili", "/api/kuaishou"]));
|
|
2401
|
-
app.use("/api/douyin", registerDouyinRoutes(this
|
|
2402
|
-
app.use("/api/bilibili", registerBilibiliRoutes(this
|
|
2403
|
-
app.use("/api/kuaishou", registerKuaishouRoutes(this
|
|
2401
|
+
app.use("/api/douyin", registerDouyinRoutes(this.#douyin));
|
|
2402
|
+
app.use("/api/bilibili", registerBilibiliRoutes(this.#bilibili));
|
|
2403
|
+
app.use("/api/kuaishou", registerKuaishouRoutes(this.#kuaishou));
|
|
2404
2404
|
app.listen(port, "::", () => {
|
|
2405
2405
|
logger.mark(`Amagi server listening on ${logger.green(`http://localhost:${port}`)} ${logger.yellow("API docs: https://amagi.apifox.cn ")}`);
|
|
2406
2406
|
});
|
|
2407
2407
|
return app;
|
|
2408
|
-
}
|
|
2408
|
+
};
|
|
2409
2409
|
/**
|
|
2410
2410
|
* 快捷获取抖音数据
|
|
2411
2411
|
* @param type - 请求数据类型
|
|
@@ -2417,7 +2417,7 @@ var amagiClient = class {
|
|
|
2417
2417
|
methodType,
|
|
2418
2418
|
...options
|
|
2419
2419
|
};
|
|
2420
|
-
return await getDouyinData(methodType, this
|
|
2420
|
+
return await getDouyinData(methodType, this.#douyin, fullOptions);
|
|
2421
2421
|
};
|
|
2422
2422
|
/**
|
|
2423
2423
|
* 快捷获取B站数据
|
|
@@ -2430,7 +2430,7 @@ var amagiClient = class {
|
|
|
2430
2430
|
methodType,
|
|
2431
2431
|
...options
|
|
2432
2432
|
};
|
|
2433
|
-
return await getBilibiliData(methodType, this
|
|
2433
|
+
return await getBilibiliData(methodType, this.#bilibili, fullOptions);
|
|
2434
2434
|
};
|
|
2435
2435
|
/**
|
|
2436
2436
|
* 快捷获取快手数据
|
|
@@ -2443,15 +2443,18 @@ var amagiClient = class {
|
|
|
2443
2443
|
methodType,
|
|
2444
2444
|
...options
|
|
2445
2445
|
};
|
|
2446
|
-
return await getKuaishouData(methodType, this
|
|
2446
|
+
return await getKuaishouData(methodType, this.#kuaishou, fullOptions);
|
|
2447
2447
|
};
|
|
2448
2448
|
};
|
|
2449
2449
|
|
|
2450
2450
|
// src/index.ts
|
|
2451
|
-
|
|
2451
|
+
function createAmagiClient(options = {}) {
|
|
2452
|
+
if (!(this instanceof createAmagiClient)) {
|
|
2453
|
+
return new createAmagiClient(options);
|
|
2454
|
+
}
|
|
2452
2455
|
return new amagiClient(options);
|
|
2453
|
-
}
|
|
2454
|
-
var
|
|
2456
|
+
}
|
|
2457
|
+
var CreateApp = Object.assign(
|
|
2455
2458
|
createAmagiClient,
|
|
2456
2459
|
{
|
|
2457
2460
|
/** 抖音相关功能模块 (工具集) */
|
|
@@ -2462,9 +2465,11 @@ var amagi = Object.assign(
|
|
|
2462
2465
|
kuaishou: kuaishouUtils
|
|
2463
2466
|
}
|
|
2464
2467
|
);
|
|
2465
|
-
var Client =
|
|
2468
|
+
var Client = CreateApp;
|
|
2469
|
+
var amagi = Client;
|
|
2466
2470
|
|
|
2467
2471
|
exports.BilibiliValidateData = BilibiliValidateData;
|
|
2472
|
+
exports.CreateApp = CreateApp;
|
|
2468
2473
|
exports.DouyinValidateData = DouyinValidateData;
|
|
2469
2474
|
exports.KuaishouAPI = KuaishouAPI;
|
|
2470
2475
|
exports.KusiahouValidateData = KusiahouValidateData;
|