@ikenxuan/amagi 4.4.14 → 4.4.16
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 +178 -144
- package/dist/default/esm/index.mjs +178 -144
- package/dist/default/index.d.ts +31 -76
- package/package.json +3 -1
|
@@ -226,7 +226,7 @@ var bilibili = {
|
|
|
226
226
|
*/
|
|
227
227
|
getVideoInfo: async (options, cookie) => {
|
|
228
228
|
const { typeMode, ...restOptions } = options;
|
|
229
|
-
const data2 = await
|
|
229
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "\u5355\u4E2A\u89C6\u9891\u4F5C\u54C1\u6570\u636E" }, cookie);
|
|
230
230
|
return data2;
|
|
231
231
|
},
|
|
232
232
|
/**
|
|
@@ -237,7 +237,7 @@ var bilibili = {
|
|
|
237
237
|
*/
|
|
238
238
|
getVideoStream: async (options, cookie) => {
|
|
239
239
|
const { typeMode, ...restOptions } = options;
|
|
240
|
-
const data2 = await
|
|
240
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "\u5355\u4E2A\u89C6\u9891\u4E0B\u8F7D\u4FE1\u606F\u6570\u636E" }, cookie);
|
|
241
241
|
return data2;
|
|
242
242
|
},
|
|
243
243
|
/**
|
|
@@ -248,7 +248,7 @@ var bilibili = {
|
|
|
248
248
|
*/
|
|
249
249
|
getComments: async (options, cookie) => {
|
|
250
250
|
const { typeMode, ...restOptions } = options;
|
|
251
|
-
const data2 = await
|
|
251
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "\u8BC4\u8BBA\u6570\u636E" }, cookie);
|
|
252
252
|
return data2;
|
|
253
253
|
},
|
|
254
254
|
/**
|
|
@@ -259,7 +259,7 @@ var bilibili = {
|
|
|
259
259
|
*/
|
|
260
260
|
getUserProfile: async (options, cookie) => {
|
|
261
261
|
const { typeMode, ...restOptions } = options;
|
|
262
|
-
const data2 = await
|
|
262
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" }, cookie);
|
|
263
263
|
return data2;
|
|
264
264
|
},
|
|
265
265
|
/**
|
|
@@ -270,7 +270,7 @@ var bilibili = {
|
|
|
270
270
|
*/
|
|
271
271
|
getUserDynamic: async (options, cookie) => {
|
|
272
272
|
const { typeMode, ...restOptions } = options;
|
|
273
|
-
const data2 = await
|
|
273
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "\u7528\u6237\u4E3B\u9875\u52A8\u6001\u5217\u8868\u6570\u636E" }, cookie);
|
|
274
274
|
return data2;
|
|
275
275
|
},
|
|
276
276
|
/**
|
|
@@ -281,7 +281,7 @@ var bilibili = {
|
|
|
281
281
|
*/
|
|
282
282
|
getEmojiList: async (options, cookie) => {
|
|
283
283
|
const { typeMode, ...restOptions } = options;
|
|
284
|
-
const data2 = await
|
|
284
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "Emoji\u6570\u636E" }, cookie);
|
|
285
285
|
return data2;
|
|
286
286
|
},
|
|
287
287
|
/**
|
|
@@ -292,7 +292,7 @@ var bilibili = {
|
|
|
292
292
|
*/
|
|
293
293
|
getBangumiInfo: async (options, cookie) => {
|
|
294
294
|
const { typeMode, ...restOptions } = options;
|
|
295
|
-
const data2 = await
|
|
295
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "\u756A\u5267\u57FA\u672C\u4FE1\u606F\u6570\u636E" }, cookie);
|
|
296
296
|
return data2;
|
|
297
297
|
},
|
|
298
298
|
/**
|
|
@@ -303,7 +303,7 @@ var bilibili = {
|
|
|
303
303
|
*/
|
|
304
304
|
getBangumiStream: async (options, cookie) => {
|
|
305
305
|
const { typeMode, ...restOptions } = options;
|
|
306
|
-
const data2 = await
|
|
306
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "\u756A\u5267\u4E0B\u8F7D\u4FE1\u606F\u6570\u636E" }, cookie);
|
|
307
307
|
return data2;
|
|
308
308
|
},
|
|
309
309
|
/**
|
|
@@ -314,7 +314,7 @@ var bilibili = {
|
|
|
314
314
|
*/
|
|
315
315
|
getDynamicInfo: async (options, cookie) => {
|
|
316
316
|
const { typeMode, ...restOptions } = options;
|
|
317
|
-
const data2 = await
|
|
317
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "\u52A8\u6001\u8BE6\u60C5\u6570\u636E" }, cookie);
|
|
318
318
|
return data2;
|
|
319
319
|
},
|
|
320
320
|
/**
|
|
@@ -325,7 +325,7 @@ var bilibili = {
|
|
|
325
325
|
*/
|
|
326
326
|
getDynamicCard: async (options, cookie) => {
|
|
327
327
|
const { typeMode, ...restOptions } = options;
|
|
328
|
-
const data2 = await
|
|
328
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "\u52A8\u6001\u5361\u7247\u6570\u636E" }, cookie);
|
|
329
329
|
return data2;
|
|
330
330
|
},
|
|
331
331
|
/**
|
|
@@ -336,7 +336,7 @@ var bilibili = {
|
|
|
336
336
|
*/
|
|
337
337
|
getLiveRoomDetail: async (options, cookie) => {
|
|
338
338
|
const { typeMode, ...restOptions } = options;
|
|
339
|
-
const data2 = await
|
|
339
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "\u76F4\u64AD\u95F4\u4FE1\u606F" }, cookie);
|
|
340
340
|
return data2;
|
|
341
341
|
},
|
|
342
342
|
/**
|
|
@@ -347,7 +347,7 @@ var bilibili = {
|
|
|
347
347
|
*/
|
|
348
348
|
getLiveRoomInitInfo: async (options, cookie) => {
|
|
349
349
|
const { typeMode, ...restOptions } = options;
|
|
350
|
-
const data2 = await
|
|
350
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "\u76F4\u64AD\u95F4\u521D\u59CB\u5316\u4FE1\u606F" }, cookie);
|
|
351
351
|
return data2;
|
|
352
352
|
},
|
|
353
353
|
/**
|
|
@@ -358,7 +358,7 @@ var bilibili = {
|
|
|
358
358
|
*/
|
|
359
359
|
getLoginBasicInfo: async (options, cookie) => {
|
|
360
360
|
const { typeMode, ...restOptions } = options;
|
|
361
|
-
const data2 = await
|
|
361
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "\u767B\u5F55\u57FA\u672C\u4FE1\u606F" }, cookie);
|
|
362
362
|
return data2;
|
|
363
363
|
},
|
|
364
364
|
/**
|
|
@@ -369,7 +369,7 @@ var bilibili = {
|
|
|
369
369
|
*/
|
|
370
370
|
getLoginQrcode: async (options, cookie) => {
|
|
371
371
|
const { typeMode, ...restOptions } = options;
|
|
372
|
-
const data2 = await
|
|
372
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "\u7533\u8BF7\u4E8C\u7EF4\u7801" }, cookie);
|
|
373
373
|
return data2;
|
|
374
374
|
},
|
|
375
375
|
/**
|
|
@@ -380,7 +380,7 @@ var bilibili = {
|
|
|
380
380
|
*/
|
|
381
381
|
checkQrcodeStatus: async (options, cookie) => {
|
|
382
382
|
const { typeMode, ...restOptions } = options;
|
|
383
|
-
const data2 = await
|
|
383
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "\u4E8C\u7EF4\u7801\u72B6\u6001" }, cookie);
|
|
384
384
|
return data2;
|
|
385
385
|
},
|
|
386
386
|
/**
|
|
@@ -391,7 +391,7 @@ var bilibili = {
|
|
|
391
391
|
*/
|
|
392
392
|
getUserTotalPlayCount: async (options, cookie) => {
|
|
393
393
|
const { typeMode, ...restOptions } = options;
|
|
394
|
-
const data2 = await
|
|
394
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "\u83B7\u53D6UP\u4E3B\u603B\u64AD\u653E\u91CF" }, cookie);
|
|
395
395
|
return data2;
|
|
396
396
|
},
|
|
397
397
|
/**
|
|
@@ -402,7 +402,7 @@ var bilibili = {
|
|
|
402
402
|
*/
|
|
403
403
|
convertAvToBv: async (options, cookie) => {
|
|
404
404
|
const { typeMode, ...restOptions } = options;
|
|
405
|
-
const data2 = await
|
|
405
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "AV\u8F6CBV" }, cookie);
|
|
406
406
|
return data2;
|
|
407
407
|
},
|
|
408
408
|
/**
|
|
@@ -413,40 +413,40 @@ var bilibili = {
|
|
|
413
413
|
*/
|
|
414
414
|
convertBvToAv: async (options, cookie) => {
|
|
415
415
|
const { typeMode, ...restOptions } = options;
|
|
416
|
-
const data2 = await
|
|
416
|
+
const data2 = await fetchBilibili({ ...restOptions, methodType: "BV\u8F6CAV" }, cookie);
|
|
417
417
|
return data2;
|
|
418
418
|
}
|
|
419
419
|
};
|
|
420
420
|
var registerBilibiliRoutes = (cookie) => {
|
|
421
421
|
const router = express.Router();
|
|
422
422
|
router.get("/new_login_qrcode", async (req, res) => {
|
|
423
|
-
const data2 = await
|
|
423
|
+
const data2 = await fetchBilibili({
|
|
424
424
|
methodType: "\u7533\u8BF7\u4E8C\u7EF4\u7801"
|
|
425
425
|
}, req.headers.cookie || cookie);
|
|
426
426
|
res.json(data2);
|
|
427
427
|
});
|
|
428
428
|
router.get("/check_qrcode", async (req, res) => {
|
|
429
|
-
const data2 = await
|
|
429
|
+
const data2 = await fetchBilibili({
|
|
430
430
|
methodType: "\u4E8C\u7EF4\u7801\u72B6\u6001",
|
|
431
431
|
qrcode_key: req.query.qrcode_key
|
|
432
432
|
}, req.headers.cookie || cookie);
|
|
433
433
|
res.json(data2);
|
|
434
434
|
});
|
|
435
435
|
router.get("/login_basic_info", async (req, res) => {
|
|
436
|
-
const data2 = await
|
|
436
|
+
const data2 = await fetchBilibili({
|
|
437
437
|
methodType: "\u767B\u5F55\u57FA\u672C\u4FE1\u606F"
|
|
438
438
|
}, req.headers.cookie || cookie);
|
|
439
439
|
res.json(data2);
|
|
440
440
|
});
|
|
441
441
|
router.get("/fetch_one_video", async (req, res) => {
|
|
442
|
-
const data2 = await
|
|
442
|
+
const data2 = await fetchBilibili({
|
|
443
443
|
methodType: "\u5355\u4E2A\u89C6\u9891\u4F5C\u54C1\u6570\u636E",
|
|
444
444
|
bvid: req.query.bvid
|
|
445
445
|
}, req.headers.cookie || cookie);
|
|
446
446
|
res.json(data2);
|
|
447
447
|
});
|
|
448
448
|
router.get("/fetch_video_playurl", async (req, res) => {
|
|
449
|
-
const data2 = await
|
|
449
|
+
const data2 = await fetchBilibili({
|
|
450
450
|
methodType: "\u5355\u4E2A\u89C6\u9891\u4E0B\u8F7D\u4FE1\u606F\u6570\u636E",
|
|
451
451
|
avid: parseInt(req.query.avid),
|
|
452
452
|
cid: parseInt(req.query.cid)
|
|
@@ -454,7 +454,7 @@ var registerBilibiliRoutes = (cookie) => {
|
|
|
454
454
|
res.json(data2);
|
|
455
455
|
});
|
|
456
456
|
router.get("/fetch_work_comments", async (req, res) => {
|
|
457
|
-
const data2 = await
|
|
457
|
+
const data2 = await fetchBilibili({
|
|
458
458
|
methodType: "\u8BC4\u8BBA\u6570\u636E",
|
|
459
459
|
oid: Number(req.query.oid),
|
|
460
460
|
number: Number(req.query.number),
|
|
@@ -463,20 +463,20 @@ var registerBilibiliRoutes = (cookie) => {
|
|
|
463
463
|
res.json(data2);
|
|
464
464
|
});
|
|
465
465
|
router.get("/fetch_work_comments", async (req, res) => {
|
|
466
|
-
const data2 = await
|
|
466
|
+
const data2 = await fetchBilibili({
|
|
467
467
|
methodType: "Emoji\u6570\u636E"
|
|
468
468
|
}, req.headers.cookie || cookie);
|
|
469
469
|
res.json(data2);
|
|
470
470
|
});
|
|
471
471
|
router.get("/fetch_bangumi_video_info", async (req, res) => {
|
|
472
|
-
const data2 = await
|
|
472
|
+
const data2 = await fetchBilibili({
|
|
473
473
|
methodType: "\u756A\u5267\u57FA\u672C\u4FE1\u606F\u6570\u636E",
|
|
474
474
|
ep_id: req.query.ep_id
|
|
475
475
|
}, req.headers.cookie || cookie);
|
|
476
476
|
res.json(data2);
|
|
477
477
|
});
|
|
478
478
|
router.get("/fetch_bangumi_video_playurl", async (req, res) => {
|
|
479
|
-
const data2 = await
|
|
479
|
+
const data2 = await fetchBilibili({
|
|
480
480
|
methodType: "\u756A\u5267\u4E0B\u8F7D\u4FE1\u606F\u6570\u636E",
|
|
481
481
|
cid: parseInt(req.query.cid),
|
|
482
482
|
ep_id: req.query.ep_id
|
|
@@ -484,63 +484,63 @@ var registerBilibiliRoutes = (cookie) => {
|
|
|
484
484
|
res.json(data2);
|
|
485
485
|
});
|
|
486
486
|
router.get("/fetch_user_dynamic", async (req, res) => {
|
|
487
|
-
const data2 = await
|
|
487
|
+
const data2 = await fetchBilibili({
|
|
488
488
|
methodType: "\u7528\u6237\u4E3B\u9875\u52A8\u6001\u5217\u8868\u6570\u636E",
|
|
489
489
|
host_mid: parseInt(req.query.host_mid)
|
|
490
490
|
}, req.headers.cookie || cookie);
|
|
491
491
|
res.json(data2);
|
|
492
492
|
});
|
|
493
493
|
router.get("/fetch_dynamic_info", async (req, res) => {
|
|
494
|
-
const data2 = await
|
|
494
|
+
const data2 = await fetchBilibili({
|
|
495
495
|
methodType: "\u52A8\u6001\u8BE6\u60C5\u6570\u636E",
|
|
496
496
|
dynamic_id: req.query.dynamic_id
|
|
497
497
|
}, req.headers.cookie || cookie);
|
|
498
498
|
res.json(data2);
|
|
499
499
|
});
|
|
500
500
|
router.get("/fetch_dynamic_card", async (req, res) => {
|
|
501
|
-
const data2 = await
|
|
501
|
+
const data2 = await fetchBilibili({
|
|
502
502
|
methodType: "\u52A8\u6001\u5361\u7247\u6570\u636E",
|
|
503
503
|
dynamic_id: req.query.dynamic_id
|
|
504
504
|
}, req.headers.cookie || cookie);
|
|
505
505
|
res.json(data2);
|
|
506
506
|
});
|
|
507
507
|
router.get("/fetch_user_profile", async (req, res) => {
|
|
508
|
-
const data2 = await
|
|
508
|
+
const data2 = await fetchBilibili({
|
|
509
509
|
methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E",
|
|
510
510
|
host_mid: parseInt(req.query.host_mid)
|
|
511
511
|
}, req.headers.cookie || cookie);
|
|
512
512
|
res.json(data2);
|
|
513
513
|
});
|
|
514
514
|
router.get("/fetch_live_room_detail", async (req, res) => {
|
|
515
|
-
const data2 = await
|
|
515
|
+
const data2 = await fetchBilibili({
|
|
516
516
|
methodType: "\u76F4\u64AD\u95F4\u4FE1\u606F",
|
|
517
517
|
room_id: req.query.room_id
|
|
518
518
|
}, req.headers.cookie || cookie);
|
|
519
519
|
res.json(data2);
|
|
520
520
|
});
|
|
521
521
|
router.get("/fetch_liveroom_def", async (req, res) => {
|
|
522
|
-
const data2 = await
|
|
522
|
+
const data2 = await fetchBilibili({
|
|
523
523
|
methodType: "\u76F4\u64AD\u95F4\u521D\u59CB\u5316\u4FE1\u606F",
|
|
524
524
|
room_id: req.query.room_id
|
|
525
525
|
}, req.headers.cookie || cookie);
|
|
526
526
|
res.json(data2);
|
|
527
527
|
});
|
|
528
528
|
router.get("/bv_to_av", async (req, res) => {
|
|
529
|
-
const data2 = await
|
|
529
|
+
const data2 = await fetchBilibili({
|
|
530
530
|
methodType: "BV\u8F6CAV",
|
|
531
531
|
bvid: req.query.bvid
|
|
532
532
|
}, req.headers.cookie || cookie);
|
|
533
533
|
res.json(data2);
|
|
534
534
|
});
|
|
535
535
|
router.get("/av_to_bv", async (req, res) => {
|
|
536
|
-
const data2 = await
|
|
536
|
+
const data2 = await fetchBilibili({
|
|
537
537
|
methodType: "AV\u8F6CBV",
|
|
538
538
|
avid: parseInt(req.query.avid)
|
|
539
539
|
}, req.headers.cookie || cookie);
|
|
540
540
|
res.json(data2);
|
|
541
541
|
});
|
|
542
542
|
router.get("/fetch_user_full_view", async (req, res) => {
|
|
543
|
-
const data2 = await
|
|
543
|
+
const data2 = await fetchBilibili({
|
|
544
544
|
methodType: "\u83B7\u53D6UP\u4E3B\u603B\u64AD\u653E\u91CF",
|
|
545
545
|
host_mid: parseInt(req.query.host_mid)
|
|
546
546
|
}, req.headers.cookie || cookie);
|
|
@@ -577,7 +577,7 @@ var defheaders = {
|
|
|
577
577
|
"upgrade-insecure-requests": "1",
|
|
578
578
|
referer: "https://www.bilibili.com/"
|
|
579
579
|
};
|
|
580
|
-
var
|
|
580
|
+
var fetchBilibili = async (data2, cookie) => {
|
|
581
581
|
const headers2 = {
|
|
582
582
|
...defheaders,
|
|
583
583
|
cookie: cookie ? cookie.replace(/\s+/g, "") : ""
|
|
@@ -613,55 +613,51 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
613
613
|
let stabilizedCount = 0;
|
|
614
614
|
let requestCount = 0;
|
|
615
615
|
let tmpresp;
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
requestCount = Math.min(20, Number(number) - fetchedComments.length);
|
|
622
|
-
}
|
|
623
|
-
const url = bilibiliApiUrls.\u8BC4\u8BBA\u533A\u660E\u7EC6({
|
|
624
|
-
type,
|
|
625
|
-
oid,
|
|
626
|
-
number: requestCount,
|
|
627
|
-
pn
|
|
628
|
-
});
|
|
629
|
-
const checkStatusUrl = bilibiliApiUrls.\u8BC4\u8BBA\u533A\u72B6\u6001({ oid, type });
|
|
630
|
-
const checkStatusRes = await GlobalGetData({
|
|
631
|
-
url: checkStatusUrl,
|
|
632
|
-
headers: headers2,
|
|
633
|
-
...data2
|
|
634
|
-
});
|
|
635
|
-
if (checkStatusRes.data === null) {
|
|
636
|
-
logger.error("\u8BC4\u8BBA\u533A\u672A\u5F00\u653E");
|
|
637
|
-
return {
|
|
638
|
-
code: 404,
|
|
639
|
-
message: "\u8BC4\u8BBA\u533A\u672A\u5F00\u653E",
|
|
640
|
-
data: null
|
|
641
|
-
};
|
|
642
|
-
}
|
|
643
|
-
const response = await GlobalGetData({
|
|
644
|
-
url,
|
|
645
|
-
headers: headers2,
|
|
646
|
-
...data2
|
|
647
|
-
});
|
|
648
|
-
tmpresp = response;
|
|
649
|
-
const currentCount = response.data.replies ? response.data.replies.length : 0;
|
|
650
|
-
fetchedComments.push(...response.data.replies || []);
|
|
651
|
-
if (currentCount === lastFetchedCount) {
|
|
652
|
-
stabilizedCount++;
|
|
653
|
-
} else {
|
|
654
|
-
stabilizedCount = 0;
|
|
655
|
-
}
|
|
656
|
-
lastFetchedCount = currentCount;
|
|
657
|
-
if (stabilizedCount >= commentGrowthStabilized || requestCount >= maxRequestCount) {
|
|
658
|
-
break;
|
|
659
|
-
}
|
|
660
|
-
pn++;
|
|
661
|
-
requestCount++;
|
|
616
|
+
while (fetchedComments.length < Number(number ?? 20) && requestCount < maxRequestCount) {
|
|
617
|
+
if (number === 0 || number === void 0) {
|
|
618
|
+
requestCount = 0;
|
|
619
|
+
} else {
|
|
620
|
+
requestCount = Math.min(20, Number(number) - fetchedComments.length);
|
|
662
621
|
}
|
|
663
|
-
|
|
664
|
-
|
|
622
|
+
const url = bilibiliApiUrls.\u8BC4\u8BBA\u533A\u660E\u7EC6({
|
|
623
|
+
type,
|
|
624
|
+
oid,
|
|
625
|
+
number: requestCount,
|
|
626
|
+
pn
|
|
627
|
+
});
|
|
628
|
+
const checkStatusUrl = bilibiliApiUrls.\u8BC4\u8BBA\u533A\u72B6\u6001({ oid, type });
|
|
629
|
+
const checkStatusRes = await GlobalGetData({
|
|
630
|
+
url: checkStatusUrl,
|
|
631
|
+
headers: headers2,
|
|
632
|
+
...data2
|
|
633
|
+
});
|
|
634
|
+
if (checkStatusRes.data === null) {
|
|
635
|
+
logger.error("\u8BC4\u8BBA\u533A\u672A\u5F00\u653E");
|
|
636
|
+
return {
|
|
637
|
+
code: 404,
|
|
638
|
+
message: "\u8BC4\u8BBA\u533A\u672A\u5F00\u653E",
|
|
639
|
+
data: null
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
const response = await GlobalGetData({
|
|
643
|
+
url,
|
|
644
|
+
headers: headers2,
|
|
645
|
+
...data2
|
|
646
|
+
});
|
|
647
|
+
tmpresp = response;
|
|
648
|
+
const currentCount = response.data.replies ? response.data.replies.length : 0;
|
|
649
|
+
fetchedComments.push(...response.data.replies || []);
|
|
650
|
+
if (currentCount === lastFetchedCount) {
|
|
651
|
+
stabilizedCount++;
|
|
652
|
+
} else {
|
|
653
|
+
stabilizedCount = 0;
|
|
654
|
+
}
|
|
655
|
+
lastFetchedCount = currentCount;
|
|
656
|
+
if (stabilizedCount >= commentGrowthStabilized || requestCount >= maxRequestCount) {
|
|
657
|
+
break;
|
|
658
|
+
}
|
|
659
|
+
pn++;
|
|
660
|
+
requestCount++;
|
|
665
661
|
}
|
|
666
662
|
const finalResponse = {
|
|
667
663
|
...tmpresp,
|
|
@@ -827,32 +823,41 @@ var BilibiliData = async (data2, cookie) => {
|
|
|
827
823
|
}
|
|
828
824
|
};
|
|
829
825
|
var GlobalGetData = async (options) => {
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
826
|
+
try {
|
|
827
|
+
const result = await new Networks(options).getData();
|
|
828
|
+
if (result && result.code === 0) {
|
|
829
|
+
return result;
|
|
830
|
+
} else if (result.code === 12061) {
|
|
831
|
+
const warningMessage = `\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01
|
|
835
832
|
\u8BF7\u6C42\u63A5\u53E3\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
836
833
|
\u8BF7\u6C42URL\uFF1A${options.url}
|
|
837
834
|
\u9519\u8BEF\u4EE3\u7801\uFF1A${result.code}\uFF0C
|
|
838
835
|
\u542B\u4E49\uFF1A${result.message}`;
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
836
|
+
logger.warn(warningMessage);
|
|
837
|
+
throw {
|
|
838
|
+
...result,
|
|
839
|
+
warning: warningMessage
|
|
840
|
+
};
|
|
841
|
+
} else {
|
|
842
|
+
const errorMessage = errorMap[result.code] || result.message || "\u672A\u77E5\u9519\u8BEF";
|
|
843
|
+
const warningMessage = `\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01
|
|
847
844
|
\u8BF7\u6C42\u63A5\u53E3\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
848
845
|
\u8BF7\u6C42URL\uFF1A${options.url}
|
|
849
846
|
\u9519\u8BEF\u4EE3\u7801\uFF1A${result.code}\uFF0C
|
|
850
847
|
\u542B\u4E49\uFF1A${errorMessage}`;
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
848
|
+
logger.warn(warningMessage);
|
|
849
|
+
throw {
|
|
850
|
+
...result,
|
|
851
|
+
warning: warningMessage
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
} catch (error) {
|
|
855
|
+
if (error && typeof error === "object") {
|
|
856
|
+
return {
|
|
857
|
+
...error,
|
|
858
|
+
warning: error.warning || "\u672A\u77E5\u9519\u8BEF"
|
|
859
|
+
};
|
|
860
|
+
}
|
|
856
861
|
}
|
|
857
862
|
};
|
|
858
863
|
var errorMap = {
|
|
@@ -1643,7 +1648,7 @@ var douyinUtils = {
|
|
|
1643
1648
|
var defheaders2 = {
|
|
1644
1649
|
accept: "*/*",
|
|
1645
1650
|
priority: "u=0, i",
|
|
1646
|
-
"content-type": "application/json",
|
|
1651
|
+
"content-type": "application/json; charset=utf-8",
|
|
1647
1652
|
"accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
|
|
1648
1653
|
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36",
|
|
1649
1654
|
referer: "https://www.douyin.com/",
|
|
@@ -1872,22 +1877,46 @@ var fetchPaginatedData = async (apiUrlGenerator, params, maxPageSize, headers2)
|
|
|
1872
1877
|
return finalResponse;
|
|
1873
1878
|
};
|
|
1874
1879
|
async function GlobalGetData2(options) {
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
\
|
|
1880
|
-
\
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1880
|
+
try {
|
|
1881
|
+
const result = await new Networks(options).getData();
|
|
1882
|
+
if (result === "" || !result) {
|
|
1883
|
+
const warningMessage = `
|
|
1884
|
+
\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u63A5\u53E3\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A
|
|
1885
|
+
\u4F60\u7684\u6296\u97F3ck\u53EF\u80FD\u5DF2\u7ECF\u5931\u6548\uFF01
|
|
1886
|
+
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
1887
|
+
\u8BF7\u6C42URL\uFF1A ${options.url}
|
|
1888
|
+
`;
|
|
1889
|
+
logger.warn(warningMessage);
|
|
1890
|
+
throw {
|
|
1891
|
+
...result,
|
|
1892
|
+
code: result.status_code,
|
|
1893
|
+
warning: warningMessage
|
|
1894
|
+
};
|
|
1895
|
+
}
|
|
1896
|
+
if (result.filter_detail && result.filter_detail.filter_reason) {
|
|
1897
|
+
const filterReason = result.filter_detail.filter_reason;
|
|
1898
|
+
const warningMessage = `
|
|
1899
|
+
\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u539F\u56E0\uFF1A${filterReason}
|
|
1900
|
+
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
1901
|
+
\u8BF7\u6C42URL\uFF1A ${options.url}
|
|
1902
|
+
`;
|
|
1903
|
+
logger.warn(warningMessage);
|
|
1904
|
+
throw {
|
|
1905
|
+
...result,
|
|
1906
|
+
code: result.status_code || 0,
|
|
1907
|
+
warning: warningMessage
|
|
1908
|
+
};
|
|
1909
|
+
}
|
|
1910
|
+
return result;
|
|
1911
|
+
} catch (error) {
|
|
1912
|
+
if (error && typeof error === "object") {
|
|
1913
|
+
return {
|
|
1914
|
+
...error,
|
|
1915
|
+
code: error.status_code || 500,
|
|
1916
|
+
warning: error.warning || "\u672A\u77E5\u9519\u8BEF"
|
|
1917
|
+
};
|
|
1918
|
+
}
|
|
1889
1919
|
}
|
|
1890
|
-
return ResponseData;
|
|
1891
1920
|
}
|
|
1892
1921
|
|
|
1893
1922
|
// src/platform/kuaishou/API.ts
|
|
@@ -2062,23 +2091,32 @@ var KuaishouData = async (data2, cookie) => {
|
|
|
2062
2091
|
}
|
|
2063
2092
|
};
|
|
2064
2093
|
async function GlobalGetData3(options) {
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2094
|
+
try {
|
|
2095
|
+
const result = await new Networks(options).getData();
|
|
2096
|
+
if (result === "" || !result || result.result === 2) {
|
|
2097
|
+
const warningMessage = `\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u63A5\u53E3\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A
|
|
2068
2098
|
\u4F60\u7684\u5FEB\u624Bck\u53EF\u80FD\u5DF2\u7ECF\u5931\u6548\uFF01
|
|
2069
|
-
\u8BF7\u6C42\u7C7B\u578B\uFF1A${options.methodType}
|
|
2099
|
+
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
2070
2100
|
\u8BF7\u6C42URL\uFF1A${options.url}
|
|
2071
2101
|
\u8BF7\u6C42\u53C2\u6570\uFF1A${JSON.stringify(options.body, null, 2)}`;
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2102
|
+
logger.warn(warningMessage);
|
|
2103
|
+
throw {
|
|
2104
|
+
...result,
|
|
2105
|
+
code: result.result,
|
|
2106
|
+
warning: warningMessage
|
|
2107
|
+
};
|
|
2108
|
+
}
|
|
2109
|
+
return result;
|
|
2110
|
+
} catch (error) {
|
|
2111
|
+
if (error && typeof error === "object") {
|
|
2112
|
+
return {
|
|
2113
|
+
...error,
|
|
2114
|
+
code: error.result || 500,
|
|
2115
|
+
message: error.error_msg,
|
|
2116
|
+
warning: error.warning || "\u672A\u77E5\u9519\u8BEF"
|
|
2117
|
+
};
|
|
2118
|
+
}
|
|
2080
2119
|
}
|
|
2081
|
-
return ResponseData;
|
|
2082
2120
|
}
|
|
2083
2121
|
|
|
2084
2122
|
// src/model/DataFetchers.ts
|
|
@@ -2105,7 +2143,7 @@ async function getBilibiliData(methodType, arg2, arg3) {
|
|
|
2105
2143
|
options = arg2;
|
|
2106
2144
|
cookie = arg3;
|
|
2107
2145
|
}
|
|
2108
|
-
const data2 = await
|
|
2146
|
+
const data2 = await fetchBilibili({ ...options, methodType }, cookie);
|
|
2109
2147
|
return data2;
|
|
2110
2148
|
}
|
|
2111
2149
|
async function getKuaishouData(methodType, arg2, arg3) {
|
|
@@ -2464,17 +2502,13 @@ function createAmagiClient(options = {}) {
|
|
|
2464
2502
|
}
|
|
2465
2503
|
return new amagiClient(options);
|
|
2466
2504
|
}
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
/** 快手相关功能模块 (工具集) */
|
|
2475
|
-
kuaishou: kuaishouUtils
|
|
2476
|
-
}
|
|
2477
|
-
);
|
|
2505
|
+
createAmagiClient.douyin = douyinUtils;
|
|
2506
|
+
createAmagiClient.bilibili = bilibiliUtils;
|
|
2507
|
+
createAmagiClient.kuaishou = kuaishouUtils;
|
|
2508
|
+
createAmagiClient.getDouyinData = () => douyinUtils.getDouyinData;
|
|
2509
|
+
createAmagiClient.getBilibiliData = () => bilibiliUtils.getBilibiliData;
|
|
2510
|
+
createAmagiClient.getKuaishouData = () => kuaishouUtils.getKuaishouData;
|
|
2511
|
+
var CreateApp = createAmagiClient;
|
|
2478
2512
|
var Client = CreateApp;
|
|
2479
2513
|
var amagi = Client;
|
|
2480
2514
|
|