karin-plugin-kkk 2.40.3 → 2.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/lib/build-metadata.json +5 -5
- package/lib/core_chunk/amagi.d.mts +182 -65
- package/lib/core_chunk/main.js +309 -66
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [2.41.0](https://github.com/ikenxuan/karin-plugin-kkk/compare/v2.40.3...v2.41.0) (2026-07-30)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ✨ 新功能
|
|
9
|
+
|
|
10
|
+
* **bilibili:** 添加匿名评论请求配置并更新相关请求逻辑 ([#341](https://github.com/ikenxuan/karin-plugin-kkk/issues/341)) ([f578413](https://github.com/ikenxuan/karin-plugin-kkk/commit/f5784133e8eb116c716e1d63c67f89cab44cec0e))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### 🐛 错误修复
|
|
14
|
+
|
|
15
|
+
* **bilibili:** 优化开播推送逻辑 ([b704c11](https://github.com/ikenxuan/karin-plugin-kkk/commit/b704c11b2683b6d78cee868676e01bd258e3945c))
|
|
16
|
+
|
|
5
17
|
## [2.40.3](https://github.com/ikenxuan/karin-plugin-kkk/compare/v2.40.2...v2.40.3) (2026-07-29)
|
|
6
18
|
|
|
7
19
|
|
package/lib/build-metadata.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
3
|
-
"buildTime": "2026-07-
|
|
4
|
-
"buildTimestamp":
|
|
2
|
+
"version": "2.41.0",
|
|
3
|
+
"buildTime": "2026-07-30T12:51:42.229Z",
|
|
4
|
+
"buildTimestamp": 1785415902229,
|
|
5
5
|
"name": "karin-plugin-kkk",
|
|
6
6
|
"description": "Karin 的「抖音」「B 站」视频解析/动态推送插件",
|
|
7
7
|
"homepage": "https://github.com/ikenxuan/karin-plugin-kkk",
|
|
8
|
-
"commitHash": "
|
|
9
|
-
"shortCommitHash": "
|
|
8
|
+
"commitHash": "96b43e4b61c746909eb8e00d0ad98e2fac8a6e08",
|
|
9
|
+
"shortCommitHash": "96b43e4b"
|
|
10
10
|
}
|
|
@@ -217,11 +217,11 @@ declare const bv2av: (bvid: string) => number;
|
|
|
217
217
|
//#region src/types/ReturnDataType/Bilibili/ProtobufDanmaku/ProtobufDanmaku_V0.d.ts
|
|
218
218
|
type BiliProtobufDanmaku_V0 = {
|
|
219
219
|
code: number;
|
|
220
|
-
data: DataData$
|
|
220
|
+
data: DataData$30;
|
|
221
221
|
message: string;
|
|
222
222
|
[property: string]: any;
|
|
223
223
|
};
|
|
224
|
-
type DataData$
|
|
224
|
+
type DataData$30 = {
|
|
225
225
|
elems: Elem[];
|
|
226
226
|
[property: string]: any;
|
|
227
227
|
};
|
|
@@ -338,7 +338,7 @@ interface BilibiliMethodOptionsMap {
|
|
|
338
338
|
};
|
|
339
339
|
/** 获取用户相关数据 */
|
|
340
340
|
UserParams: {
|
|
341
|
-
methodType: 'userCard' | 'userDynamicList' | 'uploaderTotalViews' | 'userSpaceInfo';
|
|
341
|
+
methodType: 'userCard' | 'userDynamicList' | 'userLiveStatus' | 'uploaderTotalViews' | 'userSpaceInfo';
|
|
342
342
|
/** UP主UID */
|
|
343
343
|
host_mid: number;
|
|
344
344
|
};
|
|
@@ -544,6 +544,7 @@ type BilibiliMethodOptMap = {
|
|
|
544
544
|
commentReplies: BilibiliMethodOptionsMap['CommentReplyParams'];
|
|
545
545
|
userCard: BilibiliMethodOptionsMap['UserParams'];
|
|
546
546
|
userDynamicList: BilibiliMethodOptionsMap['UserParams'];
|
|
547
|
+
userLiveStatus: BilibiliMethodOptionsMap['UserParams'];
|
|
547
548
|
userSpaceInfo: BilibiliMethodOptionsMap['UserParams'];
|
|
548
549
|
uploaderTotalViews: BilibiliMethodOptionsMap['UserParams'];
|
|
549
550
|
emojiList: BilibiliMethodOptionsMap['EmojiParams'];
|
|
@@ -665,24 +666,31 @@ declare const BilibiliValidationSchemas: {
|
|
|
665
666
|
number?: number;
|
|
666
667
|
}, unknown>>;
|
|
667
668
|
readonly userCard: zod.ZodType<{
|
|
668
|
-
methodType: "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo";
|
|
669
|
+
methodType: "userCard" | "userDynamicList" | "userLiveStatus" | "uploaderTotalViews" | "userSpaceInfo";
|
|
669
670
|
host_mid: number;
|
|
670
671
|
}, unknown, zod.core.$ZodTypeInternals<{
|
|
671
|
-
methodType: "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo";
|
|
672
|
+
methodType: "userCard" | "userDynamicList" | "userLiveStatus" | "uploaderTotalViews" | "userSpaceInfo";
|
|
672
673
|
host_mid: number;
|
|
673
674
|
}, unknown>>;
|
|
674
675
|
readonly userDynamicList: zod.ZodType<{
|
|
675
|
-
methodType: "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo";
|
|
676
|
+
methodType: "userCard" | "userDynamicList" | "userLiveStatus" | "uploaderTotalViews" | "userSpaceInfo";
|
|
677
|
+
host_mid: number;
|
|
678
|
+
}, unknown, zod.core.$ZodTypeInternals<{
|
|
679
|
+
methodType: "userCard" | "userDynamicList" | "userLiveStatus" | "uploaderTotalViews" | "userSpaceInfo";
|
|
680
|
+
host_mid: number;
|
|
681
|
+
}, unknown>>;
|
|
682
|
+
readonly userLiveStatus: zod.ZodType<{
|
|
683
|
+
methodType: "userCard" | "userDynamicList" | "userLiveStatus" | "uploaderTotalViews" | "userSpaceInfo";
|
|
676
684
|
host_mid: number;
|
|
677
685
|
}, unknown, zod.core.$ZodTypeInternals<{
|
|
678
|
-
methodType: "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo";
|
|
686
|
+
methodType: "userCard" | "userDynamicList" | "userLiveStatus" | "uploaderTotalViews" | "userSpaceInfo";
|
|
679
687
|
host_mid: number;
|
|
680
688
|
}, unknown>>;
|
|
681
689
|
readonly userSpaceInfo: zod.ZodType<{
|
|
682
|
-
methodType: "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo";
|
|
690
|
+
methodType: "userCard" | "userDynamicList" | "userLiveStatus" | "uploaderTotalViews" | "userSpaceInfo";
|
|
683
691
|
host_mid: number;
|
|
684
692
|
}, unknown, zod.core.$ZodTypeInternals<{
|
|
685
|
-
methodType: "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo";
|
|
693
|
+
methodType: "userCard" | "userDynamicList" | "userLiveStatus" | "uploaderTotalViews" | "userSpaceInfo";
|
|
686
694
|
host_mid: number;
|
|
687
695
|
}, unknown>>;
|
|
688
696
|
readonly emojiList: zod.ZodType<{
|
|
@@ -754,10 +762,10 @@ declare const BilibiliValidationSchemas: {
|
|
|
754
762
|
qrcode_key: string;
|
|
755
763
|
}, unknown>>;
|
|
756
764
|
readonly uploaderTotalViews: zod.ZodType<{
|
|
757
|
-
methodType: "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo";
|
|
765
|
+
methodType: "userCard" | "userDynamicList" | "userLiveStatus" | "uploaderTotalViews" | "userSpaceInfo";
|
|
758
766
|
host_mid: number;
|
|
759
767
|
}, unknown, zod.core.$ZodTypeInternals<{
|
|
760
|
-
methodType: "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo";
|
|
768
|
+
methodType: "userCard" | "userDynamicList" | "userLiveStatus" | "uploaderTotalViews" | "userSpaceInfo";
|
|
761
769
|
host_mid: number;
|
|
762
770
|
}, unknown>>;
|
|
763
771
|
readonly avToBv: zod.ZodType<{
|
|
@@ -844,6 +852,7 @@ declare const BilibiliMethodRoutes: {
|
|
|
844
852
|
readonly commentReplies: "/fetch_comment_reply";
|
|
845
853
|
readonly userCard: "/fetch_user_profile";
|
|
846
854
|
readonly userDynamicList: "/fetch_user_dynamic";
|
|
855
|
+
readonly userLiveStatus: "/fetch_user_live_status";
|
|
847
856
|
readonly userSpaceInfo: "/fetch_user_space_info";
|
|
848
857
|
readonly emojiList: "/fetch_emoji_list";
|
|
849
858
|
readonly bangumiInfo: "/fetch_bangumi_video_info";
|
|
@@ -2024,12 +2033,12 @@ declare const createErrorResponse: (error: APIErrorType, message: string, code?:
|
|
|
2024
2033
|
//#region src/types/ReturnDataType/Bilibili/ArticleCard/ArticleCard_V0.d.ts
|
|
2025
2034
|
type ArticleCard_V0 = {
|
|
2026
2035
|
code: number;
|
|
2027
|
-
data: DataData$
|
|
2036
|
+
data: DataData$29;
|
|
2028
2037
|
message: string;
|
|
2029
2038
|
ttl: number;
|
|
2030
2039
|
[property: string]: any;
|
|
2031
2040
|
};
|
|
2032
|
-
type DataData$
|
|
2041
|
+
type DataData$29 = {
|
|
2033
2042
|
av2: Av2;
|
|
2034
2043
|
cv1: Cv1;
|
|
2035
2044
|
cv2: Cv2;
|
|
@@ -2391,12 +2400,12 @@ type ArticleCard = ArticleCard_V0;
|
|
|
2391
2400
|
//#region src/types/ReturnDataType/Bilibili/ArticleContent/ArticleContent.d.ts
|
|
2392
2401
|
type ArticleContent_V0 = {
|
|
2393
2402
|
code: number;
|
|
2394
|
-
data: DataData$
|
|
2403
|
+
data: DataData$28;
|
|
2395
2404
|
message: string;
|
|
2396
2405
|
ttl: number;
|
|
2397
2406
|
[property: string]: any;
|
|
2398
2407
|
};
|
|
2399
|
-
type DataData$
|
|
2408
|
+
type DataData$28 = {
|
|
2400
2409
|
act_id: number;
|
|
2401
2410
|
apply_time: string;
|
|
2402
2411
|
authenMark: null;
|
|
@@ -2611,12 +2620,12 @@ type ArticleContent = ArticleContent_V0;
|
|
|
2611
2620
|
//#region src/types/ReturnDataType/Bilibili/ArticleInfo/ArticleInfo_V0.d.ts
|
|
2612
2621
|
type ArticleInfo_V0 = {
|
|
2613
2622
|
code: number;
|
|
2614
|
-
data: DataData$
|
|
2623
|
+
data: DataData$27;
|
|
2615
2624
|
message: string;
|
|
2616
2625
|
ttl: number;
|
|
2617
2626
|
[property: string]: any;
|
|
2618
2627
|
};
|
|
2619
|
-
type DataData$
|
|
2628
|
+
type DataData$27 = {
|
|
2620
2629
|
attention: boolean;
|
|
2621
2630
|
author_name: string;
|
|
2622
2631
|
banner_url: string;
|
|
@@ -3400,12 +3409,12 @@ type BiliEmojiList = BiliEmojiList_V0;
|
|
|
3400
3409
|
//#region src/types/ReturnDataType/Bilibili/BiliCommentReply/BiliCommentReply_V0.d.ts
|
|
3401
3410
|
type BiliCommentReply_V0 = {
|
|
3402
3411
|
code: number;
|
|
3403
|
-
data: DataData$
|
|
3412
|
+
data: DataData$26;
|
|
3404
3413
|
message: string;
|
|
3405
3414
|
ttl: number;
|
|
3406
3415
|
[property: string]: any;
|
|
3407
3416
|
};
|
|
3408
|
-
type DataData$
|
|
3417
|
+
type DataData$26 = {
|
|
3409
3418
|
assist: number;
|
|
3410
3419
|
blacklist: number;
|
|
3411
3420
|
callbacks: {
|
|
@@ -3916,12 +3925,12 @@ type BiliBv2AV = BiliBv2AV_V0;
|
|
|
3916
3925
|
//#region src/types/ReturnDataType/Bilibili/Captcha/ApplyCaptcha/ApplyCaptcha_V0.d.ts
|
|
3917
3926
|
type ApplyCaptcha_V0 = {
|
|
3918
3927
|
code: number;
|
|
3919
|
-
data: DataData$
|
|
3928
|
+
data: DataData$25;
|
|
3920
3929
|
message: string;
|
|
3921
3930
|
ttl: number;
|
|
3922
3931
|
[property: string]: any;
|
|
3923
3932
|
};
|
|
3924
|
-
type DataData$
|
|
3933
|
+
type DataData$25 = {
|
|
3925
3934
|
biliword: null;
|
|
3926
3935
|
geetest: Geetest;
|
|
3927
3936
|
phone: null;
|
|
@@ -3943,12 +3952,12 @@ type ApplyCaptcha = ApplyCaptcha_V0;
|
|
|
3943
3952
|
//#region src/types/ReturnDataType/Bilibili/Captcha/ValidateCaptcha/ValidateCaptcha_V0.d.ts
|
|
3944
3953
|
type ValidateCaptcha_V0 = {
|
|
3945
3954
|
code: number;
|
|
3946
|
-
data: DataData$
|
|
3955
|
+
data: DataData$24;
|
|
3947
3956
|
message: string;
|
|
3948
3957
|
ttl: number;
|
|
3949
3958
|
[property: string]: any;
|
|
3950
3959
|
};
|
|
3951
|
-
type DataData$
|
|
3960
|
+
type DataData$24 = {
|
|
3952
3961
|
grisk_id: string;
|
|
3953
3962
|
is_valid: number;
|
|
3954
3963
|
[property: string]: any;
|
|
@@ -3960,12 +3969,12 @@ type ValidateCaptcha = ValidateCaptcha_V0;
|
|
|
3960
3969
|
//#region src/types/ReturnDataType/Bilibili/ColumnInfo/ColumnInfo_V0.d.ts
|
|
3961
3970
|
type ColumnInfo_V0 = {
|
|
3962
3971
|
code: number;
|
|
3963
|
-
data: DataData$
|
|
3972
|
+
data: DataData$23;
|
|
3964
3973
|
message: string;
|
|
3965
3974
|
ttl: number;
|
|
3966
3975
|
[property: string]: any;
|
|
3967
3976
|
};
|
|
3968
|
-
type DataData$
|
|
3977
|
+
type DataData$23 = {
|
|
3969
3978
|
articles: null;
|
|
3970
3979
|
attention: boolean;
|
|
3971
3980
|
author: Author$9;
|
|
@@ -4071,12 +4080,12 @@ type ColumnInfo = ColumnInfo_V0;
|
|
|
4071
4080
|
//#region src/types/ReturnDataType/Bilibili/Dynamic/DYNAMIC_TYPE_ARTICLE/DYNAMIC_TYPE_ARTICLE_V0.d.ts
|
|
4072
4081
|
type DynamicTypeArticle_V0 = {
|
|
4073
4082
|
code: number;
|
|
4074
|
-
data: DataData$
|
|
4083
|
+
data: DataData$22;
|
|
4075
4084
|
message: string;
|
|
4076
4085
|
ttl: number;
|
|
4077
4086
|
[property: string]: any;
|
|
4078
4087
|
};
|
|
4079
|
-
type DataData$
|
|
4088
|
+
type DataData$22 = {
|
|
4080
4089
|
item: Item$16;
|
|
4081
4090
|
[property: string]: any;
|
|
4082
4091
|
};
|
|
@@ -4335,12 +4344,12 @@ type DynamicTypeArticle = DynamicTypeArticle_V0;
|
|
|
4335
4344
|
//#region src/types/ReturnDataType/Bilibili/Dynamic/DYNAMIC_TYPE_AV/DYNAMIC_TYPE_AV_V0.d.ts
|
|
4336
4345
|
type DynamicTypeAV_V0$1 = {
|
|
4337
4346
|
code: number;
|
|
4338
|
-
data: DataData$
|
|
4347
|
+
data: DataData$21;
|
|
4339
4348
|
message: string;
|
|
4340
4349
|
ttl: number;
|
|
4341
4350
|
[property: string]: any;
|
|
4342
4351
|
};
|
|
4343
|
-
type DataData$
|
|
4352
|
+
type DataData$21 = {
|
|
4344
4353
|
item: Item$15;
|
|
4345
4354
|
[property: string]: any;
|
|
4346
4355
|
};
|
|
@@ -4616,12 +4625,12 @@ type DynamicTypeAV = DynamicTypeAV_V0$1;
|
|
|
4616
4625
|
//#region src/types/ReturnDataType/Bilibili/Dynamic/DYNAMIC_TYPE_DRAW/DYNAMIC_TYPE_DRAW_V0.d.ts
|
|
4617
4626
|
type DynamicTypeDraw_V0$1 = {
|
|
4618
4627
|
code: number;
|
|
4619
|
-
data: DataData$
|
|
4628
|
+
data: DataData$20;
|
|
4620
4629
|
message: string;
|
|
4621
4630
|
ttl: number;
|
|
4622
4631
|
[property: string]: any;
|
|
4623
4632
|
};
|
|
4624
|
-
type DataData$
|
|
4633
|
+
type DataData$20 = {
|
|
4625
4634
|
item: Item$14;
|
|
4626
4635
|
[property: string]: any;
|
|
4627
4636
|
};
|
|
@@ -4976,12 +4985,12 @@ type DynamicTypeDraw = DynamicTypeDraw_V0$1;
|
|
|
4976
4985
|
//#region src/types/ReturnDataType/Bilibili/Dynamic/DYNAMIC_TYPE_FORWARD/Forward/DYNAMIC_TYPE_AV/DYNAMIC_TYPE_AV_V0.d.ts
|
|
4977
4986
|
type DynamicTypeAV_V0 = {
|
|
4978
4987
|
code: number;
|
|
4979
|
-
data: DataData$
|
|
4988
|
+
data: DataData$19;
|
|
4980
4989
|
message: string;
|
|
4981
4990
|
ttl: number;
|
|
4982
4991
|
[property: string]: any;
|
|
4983
4992
|
};
|
|
4984
|
-
type DataData$
|
|
4993
|
+
type DataData$19 = {
|
|
4985
4994
|
item: Item$13;
|
|
4986
4995
|
[property: string]: any;
|
|
4987
4996
|
};
|
|
@@ -5511,12 +5520,12 @@ type Stat$2 = {
|
|
|
5511
5520
|
//#region src/types/ReturnDataType/Bilibili/Dynamic/DYNAMIC_TYPE_FORWARD/Forward/DYNAMIC_TYPE_AV/DYNAMIC_TYPE_AV_V1.d.ts
|
|
5512
5521
|
type DynamicTypeAV_V1 = {
|
|
5513
5522
|
code: number;
|
|
5514
|
-
data: DataData$
|
|
5523
|
+
data: DataData$18;
|
|
5515
5524
|
message: string;
|
|
5516
5525
|
ttl: number;
|
|
5517
5526
|
[property: string]: any;
|
|
5518
5527
|
};
|
|
5519
|
-
type DataData$
|
|
5528
|
+
type DataData$18 = {
|
|
5520
5529
|
item: Item$12;
|
|
5521
5530
|
[property: string]: any;
|
|
5522
5531
|
};
|
|
@@ -6018,12 +6027,12 @@ type DynamicTypeAV$1 = DynamicTypeAV_V0 | DynamicTypeAV_V1;
|
|
|
6018
6027
|
//#region src/types/ReturnDataType/Bilibili/Dynamic/DYNAMIC_TYPE_FORWARD/Forward/DYNAMIC_TYPE_DRAW/DYNAMIC_TYPE_DRAW_V0.d.ts
|
|
6019
6028
|
type DynamicTypeDraw_V0 = {
|
|
6020
6029
|
code: number;
|
|
6021
|
-
data: DataData$
|
|
6030
|
+
data: DataData$17;
|
|
6022
6031
|
message: string;
|
|
6023
6032
|
ttl: number;
|
|
6024
6033
|
[property: string]: any;
|
|
6025
6034
|
};
|
|
6026
|
-
type DataData$
|
|
6035
|
+
type DataData$17 = {
|
|
6027
6036
|
item: Item$11;
|
|
6028
6037
|
[property: string]: any;
|
|
6029
6038
|
};
|
|
@@ -6556,12 +6565,12 @@ type SummaryRichTextNode$2 = {
|
|
|
6556
6565
|
//#region src/types/ReturnDataType/Bilibili/Dynamic/DYNAMIC_TYPE_FORWARD/Forward/DYNAMIC_TYPE_DRAW/DYNAMIC_TYPE_DRAW_V1.d.ts
|
|
6557
6566
|
type DynamicTypeDraw_V1 = {
|
|
6558
6567
|
code: number;
|
|
6559
|
-
data: DataData$
|
|
6568
|
+
data: DataData$16;
|
|
6560
6569
|
message: string;
|
|
6561
6570
|
ttl: number;
|
|
6562
6571
|
[property: string]: any;
|
|
6563
6572
|
};
|
|
6564
|
-
type DataData$
|
|
6573
|
+
type DataData$16 = {
|
|
6565
6574
|
item: Item$10;
|
|
6566
6575
|
[property: string]: any;
|
|
6567
6576
|
};
|
|
@@ -7097,12 +7106,12 @@ type DynamicTypeDraw$1 = DynamicTypeDraw_V0 | DynamicTypeDraw_V1;
|
|
|
7097
7106
|
//#region src/types/ReturnDataType/Bilibili/Dynamic/DYNAMIC_TYPE_FORWARD/Forward/DYNAMIC_TYPE_LIVE_RCMD/DYNAMIC_TYPE_LIVE_RCMD_V0.d.ts
|
|
7098
7107
|
type DynamicTypeLiveRcmd_V0$1 = {
|
|
7099
7108
|
code: number;
|
|
7100
|
-
data: DataData$
|
|
7109
|
+
data: DataData$15;
|
|
7101
7110
|
message: string;
|
|
7102
7111
|
ttl: number;
|
|
7103
7112
|
[property: string]: any;
|
|
7104
7113
|
};
|
|
7105
|
-
type DataData$
|
|
7114
|
+
type DataData$15 = {
|
|
7106
7115
|
item: Item$9;
|
|
7107
7116
|
[property: string]: any;
|
|
7108
7117
|
};
|
|
@@ -7581,12 +7590,12 @@ type DynamicTypeLiveRcmd$1 = DynamicTypeLiveRcmd_V0$1;
|
|
|
7581
7590
|
//#region src/types/ReturnDataType/Bilibili/Dynamic/DYNAMIC_TYPE_FORWARD/Forward/DYNAMIC_TYPE_WORD/DYNAMIC_TYPE_WORD_V0.d.ts
|
|
7582
7591
|
type DynamicTypeWord_V0$1 = {
|
|
7583
7592
|
code: number;
|
|
7584
|
-
data: DataData$
|
|
7593
|
+
data: DataData$14;
|
|
7585
7594
|
message: string;
|
|
7586
7595
|
ttl: number;
|
|
7587
7596
|
[property: string]: any;
|
|
7588
7597
|
};
|
|
7589
|
-
type DataData$
|
|
7598
|
+
type DataData$14 = {
|
|
7590
7599
|
item: Item$8;
|
|
7591
7600
|
[property: string]: any;
|
|
7592
7601
|
};
|
|
@@ -8179,7 +8188,7 @@ type OriginalDynamicItemMap = {
|
|
|
8179
8188
|
};
|
|
8180
8189
|
type ItemBasic = DynamicTypeWord$1['data']['item']['basic'] | DynamicTypeLiveRcmd$1['data']['item']['basic'] | DynamicTypeDraw$1['data']['item']['basic'] | DynamicTypeAV$1['data']['item']['basic'];
|
|
8181
8190
|
type ItemModules = DynamicTypeWord$1['data']['item']['modules'] | DynamicTypeLiveRcmd$1['data']['item']['modules'] | DynamicTypeDraw$1['data']['item']['modules'] | DynamicTypeAV$1['data']['item']['modules'];
|
|
8182
|
-
type DataData$
|
|
8191
|
+
type DataData$13<T extends keyof OriginalDynamicItemMap> = {
|
|
8183
8192
|
item: {
|
|
8184
8193
|
basic: ItemBasic;
|
|
8185
8194
|
id_str: string;
|
|
@@ -8193,7 +8202,7 @@ type DataData$12<T extends keyof OriginalDynamicItemMap> = {
|
|
|
8193
8202
|
};
|
|
8194
8203
|
type DynamicTypeForward<T extends keyof OriginalDynamicItemMap> = {
|
|
8195
8204
|
code: number;
|
|
8196
|
-
data: DataData$
|
|
8205
|
+
data: DataData$13<T>;
|
|
8197
8206
|
message: string;
|
|
8198
8207
|
ttl: number;
|
|
8199
8208
|
[property: string]: any;
|
|
@@ -8203,12 +8212,12 @@ type DynamicTypeForwardUnion = DynamicTypeForward<DynamicType.AV> | DynamicTypeF
|
|
|
8203
8212
|
//#region src/types/ReturnDataType/Bilibili/Dynamic/DYNAMIC_TYPE_LIVE_RCMD/DYNAMIC_TYPE_LIVE_RCMD_V0.d.ts
|
|
8204
8213
|
type DynamicTypeLiveRcmd_V0 = {
|
|
8205
8214
|
code: number;
|
|
8206
|
-
data: DataData$
|
|
8215
|
+
data: DataData$12;
|
|
8207
8216
|
message: string;
|
|
8208
8217
|
ttl: number;
|
|
8209
8218
|
[property: string]: any;
|
|
8210
8219
|
};
|
|
8211
|
-
type DataData$
|
|
8220
|
+
type DataData$12 = {
|
|
8212
8221
|
item: Item$7;
|
|
8213
8222
|
[property: string]: any;
|
|
8214
8223
|
};
|
|
@@ -8483,12 +8492,12 @@ type DynamicTypeLiveRcmd = DynamicTypeLiveRcmd_V0;
|
|
|
8483
8492
|
//#region src/types/ReturnDataType/Bilibili/Dynamic/DYNAMIC_TYPE_WORD/DYNAMIC_TYPE_WORD_V0.d.ts
|
|
8484
8493
|
type DynamicTypeWord_V0 = {
|
|
8485
8494
|
code: number;
|
|
8486
|
-
data: DataData$
|
|
8495
|
+
data: DataData$11;
|
|
8487
8496
|
message: string;
|
|
8488
8497
|
ttl: number;
|
|
8489
8498
|
[property: string]: any;
|
|
8490
8499
|
};
|
|
8491
|
-
type DataData$
|
|
8500
|
+
type DataData$11 = {
|
|
8492
8501
|
item: Item$6;
|
|
8493
8502
|
[property: string]: any;
|
|
8494
8503
|
};
|
|
@@ -8896,12 +8905,12 @@ type DynamicTypeItemMap$1 = {
|
|
|
8896
8905
|
[DynamicType.FORWARD]: DynamicTypeForwardUnion['data']['item'];
|
|
8897
8906
|
[DynamicType.ARTICLE]: DynamicTypeArticle['data']['item'];
|
|
8898
8907
|
};
|
|
8899
|
-
type DataData$
|
|
8908
|
+
type DataData$10<T extends DynamicType> = {
|
|
8900
8909
|
item: DynamicTypeItemMap$1[T];
|
|
8901
8910
|
};
|
|
8902
8911
|
type BiliDynamicInfo<T extends DynamicType> = {
|
|
8903
8912
|
code: number;
|
|
8904
|
-
data: DataData$
|
|
8913
|
+
data: DataData$10<T>;
|
|
8905
8914
|
message: string;
|
|
8906
8915
|
ttl: number;
|
|
8907
8916
|
[property: string]: any;
|
|
@@ -9225,7 +9234,7 @@ type BiliOneWork = BiliOneWork_V0;
|
|
|
9225
9234
|
//#region src/types/ReturnDataType/Bilibili/UserDynamic/index.d.ts
|
|
9226
9235
|
type BiliUserDynamic = {
|
|
9227
9236
|
code: number;
|
|
9228
|
-
data: DataData$
|
|
9237
|
+
data: DataData$9;
|
|
9229
9238
|
message: string;
|
|
9230
9239
|
ttl: number;
|
|
9231
9240
|
[property: string]: any;
|
|
@@ -9244,7 +9253,7 @@ type DynamicTypeItemMap = {
|
|
|
9244
9253
|
[DynamicType.FORWARD]: ForwardItem;
|
|
9245
9254
|
[DynamicType.ARTICLE]: ArticleItem;
|
|
9246
9255
|
};
|
|
9247
|
-
type DataData$
|
|
9256
|
+
type DataData$9<T extends DynamicType = DynamicType> = {
|
|
9248
9257
|
has_more: boolean;
|
|
9249
9258
|
items: DynamicTypeItemMap[T][];
|
|
9250
9259
|
offset: string;
|
|
@@ -9281,6 +9290,32 @@ type Article = {
|
|
|
9281
9290
|
//#region src/types/ReturnDataType/Bilibili/UserFullView/index.d.ts
|
|
9282
9291
|
type BiliUserFullView = BiliUserFullView_V0;
|
|
9283
9292
|
//#endregion
|
|
9293
|
+
//#region src/types/ReturnDataType/Bilibili/UserLiveStatus/UserLiveStatus_V0.d.ts
|
|
9294
|
+
type BiliUserLiveStatus_V0 = {
|
|
9295
|
+
code: number;
|
|
9296
|
+
data: DataData$8;
|
|
9297
|
+
message: string;
|
|
9298
|
+
ttl: number;
|
|
9299
|
+
[property: string]: any;
|
|
9300
|
+
};
|
|
9301
|
+
type DataData$8 = {
|
|
9302
|
+
broadcast_type: number;
|
|
9303
|
+
cover: string;
|
|
9304
|
+
link: string;
|
|
9305
|
+
liveStatus: number;
|
|
9306
|
+
online: number;
|
|
9307
|
+
online_hidden: number;
|
|
9308
|
+
roomid: number;
|
|
9309
|
+
roomStatus: number;
|
|
9310
|
+
roundStatus: number;
|
|
9311
|
+
title: string;
|
|
9312
|
+
url: string;
|
|
9313
|
+
[property: string]: any;
|
|
9314
|
+
};
|
|
9315
|
+
//#endregion
|
|
9316
|
+
//#region src/types/ReturnDataType/Bilibili/UserLiveStatus/index.d.ts
|
|
9317
|
+
type BiliUserLiveStatus = BiliUserLiveStatus_V0;
|
|
9318
|
+
//#endregion
|
|
9284
9319
|
//#region src/types/ReturnDataType/Bilibili/UserProfile/UserProfile_V0.d.ts
|
|
9285
9320
|
type BiliUserProfile_V0 = {
|
|
9286
9321
|
code: number;
|
|
@@ -11768,6 +11803,7 @@ interface BilibiliReturnTypeMap {
|
|
|
11768
11803
|
commentReplies: BiliCommentReply;
|
|
11769
11804
|
userCard: BiliUserProfile;
|
|
11770
11805
|
userDynamicList: BiliUserDynamic;
|
|
11806
|
+
userLiveStatus: BiliUserLiveStatus;
|
|
11771
11807
|
userSpaceInfo: UserSpaceInfo;
|
|
11772
11808
|
emojiList: BiliEmojiList;
|
|
11773
11809
|
bangumiInfo: BiliBangumiVideoInfo;
|
|
@@ -26297,6 +26333,7 @@ declare const BilibiliInternalMethods: {
|
|
|
26297
26333
|
readonly COMMENT_REPLIES: "指定评论的回复";
|
|
26298
26334
|
readonly USER_CARD: "用户主页数据";
|
|
26299
26335
|
readonly USER_DYNAMICS: "用户主页动态列表数据";
|
|
26336
|
+
readonly USER_LIVE_STATUS: "用户直播状态";
|
|
26300
26337
|
readonly USER_SPACE_INFO: "用户空间详细信息";
|
|
26301
26338
|
readonly USER_TOTAL_VIEWS: "获取UP主总播放量";
|
|
26302
26339
|
readonly DYNAMIC_DETAIL: "动态详情数据";
|
|
@@ -26327,6 +26364,7 @@ declare const BilibiliFetcherMethods: {
|
|
|
26327
26364
|
readonly COMMENT_REPLIES: "fetchCommentReplies";
|
|
26328
26365
|
readonly USER_CARD: "fetchUserCard";
|
|
26329
26366
|
readonly USER_DYNAMICS: "fetchUserDynamicList";
|
|
26367
|
+
readonly USER_LIVE_STATUS: "fetchUserLiveStatus";
|
|
26330
26368
|
readonly USER_SPACE_INFO: "fetchUserSpaceInfo";
|
|
26331
26369
|
readonly USER_TOTAL_VIEWS: "fetchUploaderTotalViews";
|
|
26332
26370
|
readonly DYNAMIC_DETAIL: "fetchDynamicDetail";
|
|
@@ -26462,6 +26500,7 @@ declare const MethodMaps: {
|
|
|
26462
26500
|
readonly COMMENT_REPLIES: "指定评论的回复";
|
|
26463
26501
|
readonly USER_CARD: "用户主页数据";
|
|
26464
26502
|
readonly USER_DYNAMICS: "用户主页动态列表数据";
|
|
26503
|
+
readonly USER_LIVE_STATUS: "用户直播状态";
|
|
26465
26504
|
readonly USER_SPACE_INFO: "用户空间详细信息";
|
|
26466
26505
|
readonly USER_TOTAL_VIEWS: "获取UP主总播放量";
|
|
26467
26506
|
readonly DYNAMIC_DETAIL: "动态详情数据";
|
|
@@ -26491,6 +26530,7 @@ declare const MethodMaps: {
|
|
|
26491
26530
|
readonly COMMENT_REPLIES: "fetchCommentReplies";
|
|
26492
26531
|
readonly USER_CARD: "fetchUserCard";
|
|
26493
26532
|
readonly USER_DYNAMICS: "fetchUserDynamicList";
|
|
26533
|
+
readonly USER_LIVE_STATUS: "fetchUserLiveStatus";
|
|
26494
26534
|
readonly USER_SPACE_INFO: "fetchUserSpaceInfo";
|
|
26495
26535
|
readonly USER_TOTAL_VIEWS: "fetchUploaderTotalViews";
|
|
26496
26536
|
readonly DYNAMIC_DETAIL: "fetchDynamicDetail";
|
|
@@ -26696,6 +26736,13 @@ declare class BilibiliAPI {
|
|
|
26696
26736
|
getDynamicCard(data: BilibiliMethodOptionsWithoutMethodType['DynamicParams']): string;
|
|
26697
26737
|
/** 获取用户名片信息 */
|
|
26698
26738
|
getUserCard(data: BilibiliMethodOptionsWithoutMethodType['UserParams']): string;
|
|
26739
|
+
/**
|
|
26740
|
+
* 按用户 UID 获取直播状态。
|
|
26741
|
+
*
|
|
26742
|
+
* @remarks
|
|
26743
|
+
* 该接口直接返回用户当前直播状态,不依赖空间动态中的直播推荐卡片。
|
|
26744
|
+
*/
|
|
26745
|
+
getUserLiveStatus(data: BilibiliMethodOptionsWithoutMethodType['UserParams']): string;
|
|
26699
26746
|
/** 获取直播间信息 */
|
|
26700
26747
|
getLiveRoomInfo(data: BilibiliMethodOptionsWithoutMethodType['LiveRoomParams']): string;
|
|
26701
26748
|
/** 获取直播间初始化信息 */
|
|
@@ -26895,6 +26942,10 @@ interface IBilibiliFetcher {
|
|
|
26895
26942
|
* 获取B站用户动态列表
|
|
26896
26943
|
*/
|
|
26897
26944
|
fetchUserDynamicList: MethodOverload<BilibiliUserOptions, BilibiliReturnTypeMap['userDynamicList']>;
|
|
26945
|
+
/**
|
|
26946
|
+
* 按用户 UID 获取B站直播状态
|
|
26947
|
+
*/
|
|
26948
|
+
fetchUserLiveStatus: MethodOverload<BilibiliUserOptions, BilibiliReturnTypeMap['userLiveStatus']>;
|
|
26898
26949
|
/**
|
|
26899
26950
|
* 获取B站用户空间详细信息
|
|
26900
26951
|
*/
|
|
@@ -27349,22 +27400,70 @@ interface FetcherConfig {
|
|
|
27349
27400
|
requestConfig?: RequestConfig;
|
|
27350
27401
|
}
|
|
27351
27402
|
//#endregion
|
|
27403
|
+
//#region src/model/fetchers/shared/request-types.d.ts
|
|
27404
|
+
type RequestHeaders = NonNullable<RequestConfig['headers']>;
|
|
27405
|
+
/**
|
|
27406
|
+
* 未显式覆盖 Cookie 的单次请求配置。
|
|
27407
|
+
*
|
|
27408
|
+
* Cookie 请求头必须使用大写 `Cookie`。小写 `cookie` 会被类型系统拒绝,
|
|
27409
|
+
* 避免 Axios 请求头与平台签名逻辑读取到不同字段。
|
|
27410
|
+
*/
|
|
27411
|
+
type FetcherRequestConfigWithoutCookie = Omit<RequestConfig, 'headers'> & {
|
|
27412
|
+
headers?: RequestHeaders & {
|
|
27413
|
+
Cookie?: never;
|
|
27414
|
+
cookie?: never;
|
|
27415
|
+
};
|
|
27416
|
+
};
|
|
27417
|
+
/**
|
|
27418
|
+
* 显式覆盖 Cookie 的单次请求配置。
|
|
27419
|
+
*
|
|
27420
|
+
* 裸 Fetcher 会把 `Cookie` 的字符串字面量与 cookie 参数关联起来:
|
|
27421
|
+
* 两处必须传入相同的值。
|
|
27422
|
+
*/
|
|
27423
|
+
type FetcherRequestConfigWithCookie<TCookie extends string> = Omit<RequestConfig, 'headers'> & {
|
|
27424
|
+
headers: RequestHeaders & {
|
|
27425
|
+
Cookie: TCookie;
|
|
27426
|
+
cookie?: never;
|
|
27427
|
+
};
|
|
27428
|
+
};
|
|
27429
|
+
/** 裸 Fetcher 匿名请求使用的严格配置。 */
|
|
27430
|
+
type AnonymousFetcherRequestConfig = FetcherRequestConfigWithCookie<''>;
|
|
27431
|
+
/**
|
|
27432
|
+
* 根据裸 Fetcher 的单次请求配置推导 cookie 参数类型。
|
|
27433
|
+
*
|
|
27434
|
+
* - 大写 `Cookie`:cookie 参数必须与请求头字符串字面量一致。
|
|
27435
|
+
* - 小写 `cookie`:返回 `never`,拒绝大小写错误。
|
|
27436
|
+
* - 未显式声明 Cookie:保持原有的可选字符串参数。
|
|
27437
|
+
*/
|
|
27438
|
+
type FetcherCookieForRequestConfig<TRequestConfig extends RequestConfig> = TRequestConfig extends {
|
|
27439
|
+
headers: infer THeaders;
|
|
27440
|
+
} ? THeaders extends {
|
|
27441
|
+
cookie: unknown;
|
|
27442
|
+
} ? never : THeaders extends {
|
|
27443
|
+
Cookie: infer TCookie;
|
|
27444
|
+
} ? TCookie extends string ? TCookie : never : string | undefined : string | undefined;
|
|
27445
|
+
//#endregion
|
|
27352
27446
|
//#region src/model/fetchers/shared/overload-types.d.ts
|
|
27353
27447
|
/**
|
|
27354
27448
|
* 为单个方法生成函数重载类型
|
|
27355
27449
|
* @template TOptions - 方法的选项参数类型
|
|
27356
27450
|
* @template TStrictReturn - typeMode='strict' 时的返回类型
|
|
27357
|
-
* @template TCookie - Cookie 参数类型(可选)
|
|
27358
|
-
* @template TRequestConfig - 请求配置参数类型(可选)
|
|
27359
27451
|
*/
|
|
27360
|
-
type MethodOverload<TOptions, TStrictReturn
|
|
27452
|
+
type MethodOverload<TOptions, TStrictReturn> = {
|
|
27361
27453
|
(options: TOptions & {
|
|
27362
27454
|
typeMode: 'strict';
|
|
27363
|
-
},
|
|
27364
|
-
|
|
27455
|
+
}, cookie?: string): Promise<Result<TStrictReturn>>;
|
|
27456
|
+
<const TRequestConfig extends RequestConfig>(options: TOptions & {
|
|
27457
|
+
typeMode: 'strict';
|
|
27458
|
+
}, cookie: NoInfer<FetcherCookieForRequestConfig<TRequestConfig>>, requestConfig: TRequestConfig): Promise<Result<TStrictReturn>>;
|
|
27459
|
+
(options: TOptions, cookie?: string): Promise<Result<any>>;
|
|
27460
|
+
<const TRequestConfig extends RequestConfig>(options: TOptions, cookie: NoInfer<FetcherCookieForRequestConfig<TRequestConfig>>, requestConfig: TRequestConfig): Promise<Result<any>>;
|
|
27365
27461
|
};
|
|
27366
27462
|
/**
|
|
27367
27463
|
* 为绑定 Cookie 的方法生成函数重载类型(少了 cookie 参数)
|
|
27464
|
+
*
|
|
27465
|
+
* 第二个参数用于覆盖当前调用的请求配置。绑定 Fetcher 的实现会将它与
|
|
27466
|
+
* 实例级配置合并,不会修改实例本身。
|
|
27368
27467
|
*/
|
|
27369
27468
|
type BoundMethodOverload<TOptions, TStrictReturn, TRequestConfig extends RequestConfig | undefined = RequestConfig | undefined> = {
|
|
27370
27469
|
(options: TOptions & {
|
|
@@ -27375,16 +27474,24 @@ type BoundMethodOverload<TOptions, TStrictReturn, TRequestConfig extends Request
|
|
|
27375
27474
|
/**
|
|
27376
27475
|
* 为无参数方法生成函数重载类型
|
|
27377
27476
|
*/
|
|
27378
|
-
type NoParamMethodOverload<TStrictReturn
|
|
27477
|
+
type NoParamMethodOverload<TStrictReturn> = {
|
|
27379
27478
|
(options: {
|
|
27380
27479
|
typeMode: 'strict';
|
|
27381
|
-
},
|
|
27480
|
+
}, cookie?: string): Promise<Result<TStrictReturn>>;
|
|
27481
|
+
<const TRequestConfig extends RequestConfig>(options: {
|
|
27482
|
+
typeMode: 'strict';
|
|
27483
|
+
}, cookie: NoInfer<FetcherCookieForRequestConfig<TRequestConfig>>, requestConfig: TRequestConfig): Promise<Result<TStrictReturn>>;
|
|
27382
27484
|
(options?: {
|
|
27383
27485
|
typeMode?: TypeMode;
|
|
27384
|
-
},
|
|
27486
|
+
}, cookie?: string): Promise<Result<any>>;
|
|
27487
|
+
<const TRequestConfig extends RequestConfig>(options: {
|
|
27488
|
+
typeMode?: TypeMode;
|
|
27489
|
+
} | undefined, cookie: NoInfer<FetcherCookieForRequestConfig<TRequestConfig>>, requestConfig: TRequestConfig): Promise<Result<any>>;
|
|
27385
27490
|
};
|
|
27386
27491
|
/**
|
|
27387
27492
|
* 为绑定 Cookie 的无参数方法生成函数重载类型
|
|
27493
|
+
*
|
|
27494
|
+
* `requestConfig` 只影响当前调用,并由绑定 Fetcher 与实例级配置合并。
|
|
27388
27495
|
*/
|
|
27389
27496
|
type BoundNoParamMethodOverload<TStrictReturn, TRequestConfig extends RequestConfig | undefined = RequestConfig | undefined> = {
|
|
27390
27497
|
(options: {
|
|
@@ -27397,14 +27504,20 @@ type BoundNoParamMethodOverload<TStrictReturn, TRequestConfig extends RequestCon
|
|
|
27397
27504
|
/**
|
|
27398
27505
|
* 为带可选参数的方法生成函数重载类型(参数可选但可能包含额外字段)
|
|
27399
27506
|
*/
|
|
27400
|
-
type OptionalParamMethodOverload<TOptions, TStrictReturn
|
|
27507
|
+
type OptionalParamMethodOverload<TOptions, TStrictReturn> = {
|
|
27401
27508
|
(options: TOptions & {
|
|
27402
27509
|
typeMode: 'strict';
|
|
27403
|
-
},
|
|
27404
|
-
|
|
27510
|
+
}, cookie?: string): Promise<Result<TStrictReturn>>;
|
|
27511
|
+
<const TRequestConfig extends RequestConfig>(options: TOptions & {
|
|
27512
|
+
typeMode: 'strict';
|
|
27513
|
+
}, cookie: NoInfer<FetcherCookieForRequestConfig<TRequestConfig>>, requestConfig: TRequestConfig): Promise<Result<TStrictReturn>>;
|
|
27514
|
+
(options?: TOptions, cookie?: string): Promise<Result<any>>;
|
|
27515
|
+
<const TRequestConfig extends RequestConfig>(options: TOptions | undefined, cookie: NoInfer<FetcherCookieForRequestConfig<TRequestConfig>>, requestConfig: TRequestConfig): Promise<Result<any>>;
|
|
27405
27516
|
};
|
|
27406
27517
|
/**
|
|
27407
27518
|
* 为绑定 Cookie 的带可选参数方法生成函数重载类型
|
|
27519
|
+
*
|
|
27520
|
+
* `requestConfig` 只影响当前调用,并由绑定 Fetcher 与实例级配置合并。
|
|
27408
27521
|
*/
|
|
27409
27522
|
type BoundOptionalParamMethodOverload<TOptions, TStrictReturn, TRequestConfig extends RequestConfig | undefined = RequestConfig | undefined> = {
|
|
27410
27523
|
(options: TOptions & {
|
|
@@ -27433,6 +27546,8 @@ interface IBoundBilibiliFetcher {
|
|
|
27433
27546
|
fetchUserCard: BoundMethodOverload<BilibiliUserOptions, BilibiliReturnTypeMap['userCard']>;
|
|
27434
27547
|
/** 获取B站用户动态列表 */
|
|
27435
27548
|
fetchUserDynamicList: BoundMethodOverload<BilibiliUserOptions, BilibiliReturnTypeMap['userDynamicList']>;
|
|
27549
|
+
/** 按用户 UID 获取B站直播状态 */
|
|
27550
|
+
fetchUserLiveStatus: BoundMethodOverload<BilibiliUserOptions, BilibiliReturnTypeMap['userLiveStatus']>;
|
|
27436
27551
|
/** 获取B站用户空间详细信息 */
|
|
27437
27552
|
fetchUserSpaceInfo: BoundMethodOverload<BilibiliUserOptions, BilibiliReturnTypeMap['userSpaceInfo']>;
|
|
27438
27553
|
/** 获取B站 UP 主总播放量 */
|
|
@@ -29339,6 +29454,7 @@ declare const BilibiliMethodMapping: {
|
|
|
29339
29454
|
readonly 指定评论的回复: "fetchCommentReplies";
|
|
29340
29455
|
readonly 用户主页数据: "fetchUserCard";
|
|
29341
29456
|
readonly 用户主页动态列表数据: "fetchUserDynamicList";
|
|
29457
|
+
readonly 用户直播状态: "fetchUserLiveStatus";
|
|
29342
29458
|
readonly 用户空间详细信息: "fetchUserSpaceInfo";
|
|
29343
29459
|
readonly 获取UP主总播放量: "fetchUploaderTotalViews";
|
|
29344
29460
|
readonly 动态详情数据: "fetchDynamicDetail";
|
|
@@ -29424,6 +29540,7 @@ declare const BilibiliApiRoutes: {
|
|
|
29424
29540
|
readonly commentReplies: "/comment-replies";
|
|
29425
29541
|
readonly userCard: "/user";
|
|
29426
29542
|
readonly userDynamicList: "/user/dynamics";
|
|
29543
|
+
readonly userLiveStatus: "/user/live-status";
|
|
29427
29544
|
readonly userSpaceInfo: "/user/space";
|
|
29428
29545
|
readonly uploaderTotalViews: "/user/total-views";
|
|
29429
29546
|
readonly dynamicDetail: "/dynamic";
|
|
@@ -29553,4 +29670,4 @@ declare const CreateApp: AmagiConstructor;
|
|
|
29553
29670
|
declare const Client: typeof CreateApp;
|
|
29554
29671
|
declare const amagi: typeof Client;
|
|
29555
29672
|
//#endregion
|
|
29556
|
-
export { APIErrorType, AdditionalType, AmagiEventMap, AmagiEventType, type ApiEndpoint, ApiError, ApiErrorEventData, ApiResponse, ApiSuccessEventData, ArticleCard, ArticleContent, ArticleInfo, ArticleWork, BaseRequestOptions, BaseResponse, BiliAv2Bv, BiliBangumiVideoInfo, BiliBangumiVideoPlayurlIsLogin, BiliBangumiVideoPlayurlNoLogin, BiliBiliVideoPlayurlNoLogin, BiliBv2AV, BiliCheckQrcode, BiliCommentReply, BiliDynamicCard, BiliDynamicInfo, BiliDynamicInfoUnion, BiliEmojiList, BiliLiveRoomDef, BiliLiveRoomDetail, BiliNewLoginQrcode, BiliOneWork, BiliProtobufDanmaku, BiliUserDynamic, BiliUserFullView, BiliUserProfile, BiliVideoPlayurlIsLogin, BiliWorkComments, BilibiliApiRoutes, type BilibiliApplyCaptchaOptions, BilibiliApplyCaptchaParamsSchema, type BilibiliArticleCardOptions, BilibiliArticleCardParamsSchema, BilibiliArticleInfoParamsSchema, type BilibiliArticleOptions, BilibiliArticleParamsSchema, type BilibiliAv2BvOptions, BilibiliAv2BvParamsSchema, type BilibiliBangumiInfoOptions, BilibiliBangumiInfoParamsSchema, type BilibiliBangumiStreamOptions, BilibiliBangumiStreamParamsSchema, type BilibiliBv2AvOptions, BilibiliBv2AvParamsSchema, BilibiliColumnInfoParamsSchema, BilibiliCommentParamsSchema, type BilibiliCommentRepliesOptions, BilibiliCommentReplyParamsSchema, type BilibiliCommentsOptions, type BilibiliDanmakuOptions, BilibiliDanmakuParamsSchema, BilibiliDataOptions, BilibiliDataOptionsMap, type BilibiliDynamicOptions, BilibiliDynamicParamsSchema, BilibiliEmojiParamsSchema, type BilibiliFetcher, BilibiliFetcherMethodKey, BilibiliFetcherMethods, BilibiliInternalMethodKey, BilibiliInternalMethods, BilibiliLiveParamsSchema, type BilibiliLiveRoomOptions, BilibiliLoginParamsSchema, type BilibiliMethodKey, BilibiliMethodMapping, BilibiliMethodOptMap, BilibiliMethodOptionsMap, BilibiliMethodRoutes, BilibiliMethodToFetcher, BilibiliMethodType, type BilibiliMethodValue, BilibiliQrcodeParamsSchema, type BilibiliQrcodeStatusOptions, BilibiliQrcodeStatusParamsSchema, BilibiliReturnTypeMap, type BilibiliUserOptions, BilibiliUserParamsSchema, type BilibiliValidateCaptchaOptions, BilibiliValidateCaptchaParamsSchema, BilibiliValidationSchemas, BilibiliVideoDownloadParamsSchema, type BilibiliVideoInfoOptions, BilibiliVideoParamsSchema, type BilibiliVideoStreamOptions, BoundBilibiliApi, type BoundBilibiliFetcher, BoundDouyinApi, type BoundDouyinFetcher, BoundKuaishouApi, type BoundKuaishouFetcher, BoundXiaohongshuApi, type BoundXiaohongshuFetcher, ColumnInfo, CommentReply, CommentType, ConditionalReturnType, CookieConfig, CreateApp, DouyinApiRoutes, DouyinCommentParamsSchema, type DouyinCommentRepliesOptions, DouyinCommentReplyParamsSchema, type DouyinCommentsOptions, type DouyinDanmakuOptions, DouyinDanmakuParamsSchema, DouyinDataOptions, DouyinDataOptionsMap, DouyinEmojiListParamsSchema, DouyinEmojiProParamsSchema, type DouyinFetcher, DouyinFetcherMethodKey, DouyinFetcherMethods, DouyinHotWordsParamsSchema, DouyinInternalMethodKey, DouyinInternalMethods, type DouyinLiveRoomOptions, DouyinLiveRoomParamsSchema, type DouyinMethodKey, DouyinMethodMapping, DouyinMethodOptMap, DouyinMethodOptionsMap, DouyinMethodRoutes, DouyinMethodToFetcher, DouyinMethodType, type DouyinMethodValue, type DouyinMusicOptions, DouyinMusicParamsSchema, type DouyinQrcodeOptions, DouyinQrcodeParamsSchema, DouyinReturnTypeMap, type DouyinSearchOptions, DouyinSearchParamsSchema, type DouyinSuggestWordsOptions, type DouyinUserListOptions, DouyinUserListParamsSchema, type DouyinUserOptions, DouyinUserParamsSchema, DouyinValidationSchemas, type DouyinWorkOptions, DouyinWorkParamsSchema, DyDanmakuList, DyEmojiList, DyEmojiProList, DyImageAlbumWork, DyMusicWork, DySearchInfo, DySlidesWork, DySuggestWords, DyUserInfo, DyUserLiveVideos, DyUserPostVideos, DyVideoWork, DyWorkComments, DynamicType, DynamicTypeAV, DynamicTypeArticle, DynamicTypeDraw, DynamicTypeForward, DynamicTypeForwardUnion, DynamicTypeLiveRcmd, DynamicTypeWord, ErrorResult, ExtractTypeMode, FetcherConfig, HomeFeed, type HttpMethod, HttpRequestEventData, HttpResponseEventData, type IBilibiliFetcher, type IBoundBilibiliFetcher, type IBoundDouyinFetcher, type IBoundKuaishouFetcher, type IBoundXiaohongshuFetcher, type IDouyinFetcher, type IKuaishouFetcher, type IXiaohongshuFetcher, type KsBannedStatus, KsEmojiList, KsLiveRoomInfo, KsOneWork, type KsUserHomeWork, KsUserProfile, type KsUserProfileCounts, type KsUserProfileGameInfo, type KsUserProfileLiveInfo, type KsUserProfileSensitiveInfo, type KsUserProfileUserInfo, KsUserWorkList, type KsVerifiedStatus, KsWorkComments, KuaishouApiRoutes, KuaishouCommentParamsSchema, type KuaishouCommentsOptions, KuaishouDataOptions, KuaishouDataOptionsMap, KuaishouEmojiParamsSchema, type KuaishouFetcher, KuaishouFetcherMethodKey, KuaishouFetcherMethods, type KuaishouGraphqlRequest, KuaishouInternalMethodKey, KuaishouInternalMethods, type KuaishouLiveApiRequest, type KuaishouLiveRoomInfoOptions, KuaishouLiveRoomInfoParamsSchema, type KuaishouMethodKey, KuaishouMethodMapping, KuaishouMethodOptMap, KuaishouMethodOptionsMap, KuaishouMethodRoutes, KuaishouMethodToFetcher, KuaishouMethodType, type KuaishouMethodValue, KuaishouReturnTypeMap, type KuaishouUserProfileOptions, KuaishouUserProfileParamsSchema, type KuaishouUserWorkListOptions, KuaishouUserWorkListParamsSchema, KuaishouValidationSchemas, KuaishouVideoParamsSchema, type KuaishouVideoWorkOptions, LogEventData, MajorType, MethodMaps, NetworkErrorEventData, NetworkRetryEventData, type NetworksConfigType, NoteComments, OmitMethodType, OneNote, Options, type Platform, RequestConfig, Result, SearchInfoGeneralData, SearchInfoUser, SearchInfoVideo, SearchNotes, SuccessResult, TypeControl, TypeMode, ValidationError, XiaohongshuApiRoutes, type XiaohongshuCommentsOptions, XiaohongshuDataOptions, XiaohongshuDataOptionsMap, XiaohongshuEmojiList, type XiaohongshuFetcher, XiaohongshuFetcherMethodKey, XiaohongshuFetcherMethods, type XiaohongshuHomeFeedOptions, XiaohongshuInternalMethodKey, XiaohongshuInternalMethods, type XiaohongshuMethodKey, XiaohongshuMethodMapping, XiaohongshuMethodOptMap, XiaohongshuMethodOptionsMap, XiaohongshuMethodRoutes, XiaohongshuMethodToFetcher, XiaohongshuMethodType, type XiaohongshuMethodValue, type XiaohongshuNoteDetailOptions, XiaohongshuReturnTypeMap, type XiaohongshuSearchNotesOptions, type XiaohongshuUserNotesOptions, XiaohongshuUserProfile, type XiaohongshuUserProfileOptions, XiaohongshuValidationSchemas, amagi, amagiClient, amagiEvents, av2bv, bilibili, bilibiliApiUrls, bilibiliErrorCodeMap, bilibiliFetcher, bilibiliUtils, bv2av, createAmagiClient, createBilibiliRoutes, createBilibiliRoutes as registerBilibiliRoutes, createBoundBilibiliApi, createBoundBilibiliFetcher, createBoundDouyinApi, createBoundDouyinFetcher, createBoundKuaishouApi, createBoundKuaishouFetcher, createBoundXiaohongshuApi, createBoundXiaohongshuFetcher, createDouyinRoutes, createDouyinRoutes as registerDouyinRoutes, createErrorResponse, createKuaishouRoutes, createKuaishouRoutes as registerKuaishouRoutes, createSuccessResponse, createXiaohongshuRoutes, createXiaohongshuRoutes as registerXiaohongshuRoutes, douyin, douyinApiUrls, douyinFetcher, douyinSign, douyinUtils, emitApiError, emitApiSuccess, emitHttpRequest, emitHttpResponse, emitLog, emitLogDebug, emitLogError, emitLogInfo, emitLogMark, emitLogWarn, emitNetworkError, emitNetworkRetry, fetchData, fetchResponse, getApiRoute, getBilibiliData, getDouyinData, getEnglishMethodName, getHeadersAndData, getKuaishouData, handleError, httpLogger, initLogger, isNetworkErrorResult, kuaishou, kuaishouApiUrls, kuaishouFetcher, kuaishouSign, kuaishouUtils, logMiddleware, logger, parseDmSegMobileReply, qtparam, toFetcherMethod, validateBilibiliParams, validateDouyinParams, validateKuaishouParams, validateXiaohongshuParams, wbi_sign, xiaohongshu, xiaohongshuApiUrls, xiaohongshuFetcher, xiaohongshuSign, xiaohongshuUtils };
|
|
29673
|
+
export { APIErrorType, AdditionalType, AmagiEventMap, AmagiEventType, type AnonymousFetcherRequestConfig, type ApiEndpoint, ApiError, ApiErrorEventData, ApiResponse, ApiSuccessEventData, ArticleCard, ArticleContent, ArticleInfo, ArticleWork, BaseRequestOptions, BaseResponse, BiliAv2Bv, BiliBangumiVideoInfo, BiliBangumiVideoPlayurlIsLogin, BiliBangumiVideoPlayurlNoLogin, BiliBiliVideoPlayurlNoLogin, BiliBv2AV, BiliCheckQrcode, BiliCommentReply, BiliDynamicCard, BiliDynamicInfo, BiliDynamicInfoUnion, BiliEmojiList, BiliLiveRoomDef, BiliLiveRoomDetail, BiliNewLoginQrcode, BiliOneWork, BiliProtobufDanmaku, BiliUserDynamic, BiliUserFullView, BiliUserLiveStatus, BiliUserProfile, BiliVideoPlayurlIsLogin, BiliWorkComments, BilibiliApiRoutes, type BilibiliApplyCaptchaOptions, BilibiliApplyCaptchaParamsSchema, type BilibiliArticleCardOptions, BilibiliArticleCardParamsSchema, BilibiliArticleInfoParamsSchema, type BilibiliArticleOptions, BilibiliArticleParamsSchema, type BilibiliAv2BvOptions, BilibiliAv2BvParamsSchema, type BilibiliBangumiInfoOptions, BilibiliBangumiInfoParamsSchema, type BilibiliBangumiStreamOptions, BilibiliBangumiStreamParamsSchema, type BilibiliBv2AvOptions, BilibiliBv2AvParamsSchema, BilibiliColumnInfoParamsSchema, BilibiliCommentParamsSchema, type BilibiliCommentRepliesOptions, BilibiliCommentReplyParamsSchema, type BilibiliCommentsOptions, type BilibiliDanmakuOptions, BilibiliDanmakuParamsSchema, BilibiliDataOptions, BilibiliDataOptionsMap, type BilibiliDynamicOptions, BilibiliDynamicParamsSchema, BilibiliEmojiParamsSchema, type BilibiliFetcher, BilibiliFetcherMethodKey, BilibiliFetcherMethods, BilibiliInternalMethodKey, BilibiliInternalMethods, BilibiliLiveParamsSchema, type BilibiliLiveRoomOptions, BilibiliLoginParamsSchema, type BilibiliMethodKey, BilibiliMethodMapping, BilibiliMethodOptMap, BilibiliMethodOptionsMap, BilibiliMethodRoutes, BilibiliMethodToFetcher, BilibiliMethodType, type BilibiliMethodValue, BilibiliQrcodeParamsSchema, type BilibiliQrcodeStatusOptions, BilibiliQrcodeStatusParamsSchema, BilibiliReturnTypeMap, type BilibiliUserOptions, BilibiliUserParamsSchema, type BilibiliValidateCaptchaOptions, BilibiliValidateCaptchaParamsSchema, BilibiliValidationSchemas, BilibiliVideoDownloadParamsSchema, type BilibiliVideoInfoOptions, BilibiliVideoParamsSchema, type BilibiliVideoStreamOptions, BoundBilibiliApi, type BoundBilibiliFetcher, BoundDouyinApi, type BoundDouyinFetcher, BoundKuaishouApi, type BoundKuaishouFetcher, BoundXiaohongshuApi, type BoundXiaohongshuFetcher, ColumnInfo, CommentReply, CommentType, ConditionalReturnType, CookieConfig, CreateApp, DouyinApiRoutes, DouyinCommentParamsSchema, type DouyinCommentRepliesOptions, DouyinCommentReplyParamsSchema, type DouyinCommentsOptions, type DouyinDanmakuOptions, DouyinDanmakuParamsSchema, DouyinDataOptions, DouyinDataOptionsMap, DouyinEmojiListParamsSchema, DouyinEmojiProParamsSchema, type DouyinFetcher, DouyinFetcherMethodKey, DouyinFetcherMethods, DouyinHotWordsParamsSchema, DouyinInternalMethodKey, DouyinInternalMethods, type DouyinLiveRoomOptions, DouyinLiveRoomParamsSchema, type DouyinMethodKey, DouyinMethodMapping, DouyinMethodOptMap, DouyinMethodOptionsMap, DouyinMethodRoutes, DouyinMethodToFetcher, DouyinMethodType, type DouyinMethodValue, type DouyinMusicOptions, DouyinMusicParamsSchema, type DouyinQrcodeOptions, DouyinQrcodeParamsSchema, DouyinReturnTypeMap, type DouyinSearchOptions, DouyinSearchParamsSchema, type DouyinSuggestWordsOptions, type DouyinUserListOptions, DouyinUserListParamsSchema, type DouyinUserOptions, DouyinUserParamsSchema, DouyinValidationSchemas, type DouyinWorkOptions, DouyinWorkParamsSchema, DyDanmakuList, DyEmojiList, DyEmojiProList, DyImageAlbumWork, DyMusicWork, DySearchInfo, DySlidesWork, DySuggestWords, DyUserInfo, DyUserLiveVideos, DyUserPostVideos, DyVideoWork, DyWorkComments, DynamicType, DynamicTypeAV, DynamicTypeArticle, DynamicTypeDraw, DynamicTypeForward, DynamicTypeForwardUnion, DynamicTypeLiveRcmd, DynamicTypeWord, ErrorResult, ExtractTypeMode, FetcherConfig, type FetcherCookieForRequestConfig, type FetcherRequestConfigWithCookie, type FetcherRequestConfigWithoutCookie, HomeFeed, type HttpMethod, HttpRequestEventData, HttpResponseEventData, type IBilibiliFetcher, type IBoundBilibiliFetcher, type IBoundDouyinFetcher, type IBoundKuaishouFetcher, type IBoundXiaohongshuFetcher, type IDouyinFetcher, type IKuaishouFetcher, type IXiaohongshuFetcher, type KsBannedStatus, KsEmojiList, KsLiveRoomInfo, KsOneWork, type KsUserHomeWork, KsUserProfile, type KsUserProfileCounts, type KsUserProfileGameInfo, type KsUserProfileLiveInfo, type KsUserProfileSensitiveInfo, type KsUserProfileUserInfo, KsUserWorkList, type KsVerifiedStatus, KsWorkComments, KuaishouApiRoutes, KuaishouCommentParamsSchema, type KuaishouCommentsOptions, KuaishouDataOptions, KuaishouDataOptionsMap, KuaishouEmojiParamsSchema, type KuaishouFetcher, KuaishouFetcherMethodKey, KuaishouFetcherMethods, type KuaishouGraphqlRequest, KuaishouInternalMethodKey, KuaishouInternalMethods, type KuaishouLiveApiRequest, type KuaishouLiveRoomInfoOptions, KuaishouLiveRoomInfoParamsSchema, type KuaishouMethodKey, KuaishouMethodMapping, KuaishouMethodOptMap, KuaishouMethodOptionsMap, KuaishouMethodRoutes, KuaishouMethodToFetcher, KuaishouMethodType, type KuaishouMethodValue, KuaishouReturnTypeMap, type KuaishouUserProfileOptions, KuaishouUserProfileParamsSchema, type KuaishouUserWorkListOptions, KuaishouUserWorkListParamsSchema, KuaishouValidationSchemas, KuaishouVideoParamsSchema, type KuaishouVideoWorkOptions, LogEventData, MajorType, MethodMaps, NetworkErrorEventData, NetworkRetryEventData, type NetworksConfigType, NoteComments, OmitMethodType, OneNote, Options, type Platform, RequestConfig, Result, SearchInfoGeneralData, SearchInfoUser, SearchInfoVideo, SearchNotes, SuccessResult, TypeControl, TypeMode, ValidationError, XiaohongshuApiRoutes, type XiaohongshuCommentsOptions, XiaohongshuDataOptions, XiaohongshuDataOptionsMap, XiaohongshuEmojiList, type XiaohongshuFetcher, XiaohongshuFetcherMethodKey, XiaohongshuFetcherMethods, type XiaohongshuHomeFeedOptions, XiaohongshuInternalMethodKey, XiaohongshuInternalMethods, type XiaohongshuMethodKey, XiaohongshuMethodMapping, XiaohongshuMethodOptMap, XiaohongshuMethodOptionsMap, XiaohongshuMethodRoutes, XiaohongshuMethodToFetcher, XiaohongshuMethodType, type XiaohongshuMethodValue, type XiaohongshuNoteDetailOptions, XiaohongshuReturnTypeMap, type XiaohongshuSearchNotesOptions, type XiaohongshuUserNotesOptions, XiaohongshuUserProfile, type XiaohongshuUserProfileOptions, XiaohongshuValidationSchemas, amagi, amagiClient, amagiEvents, av2bv, bilibili, bilibiliApiUrls, bilibiliErrorCodeMap, bilibiliFetcher, bilibiliUtils, bv2av, createAmagiClient, createBilibiliRoutes, createBilibiliRoutes as registerBilibiliRoutes, createBoundBilibiliApi, createBoundBilibiliFetcher, createBoundDouyinApi, createBoundDouyinFetcher, createBoundKuaishouApi, createBoundKuaishouFetcher, createBoundXiaohongshuApi, createBoundXiaohongshuFetcher, createDouyinRoutes, createDouyinRoutes as registerDouyinRoutes, createErrorResponse, createKuaishouRoutes, createKuaishouRoutes as registerKuaishouRoutes, createSuccessResponse, createXiaohongshuRoutes, createXiaohongshuRoutes as registerXiaohongshuRoutes, douyin, douyinApiUrls, douyinFetcher, douyinSign, douyinUtils, emitApiError, emitApiSuccess, emitHttpRequest, emitHttpResponse, emitLog, emitLogDebug, emitLogError, emitLogInfo, emitLogMark, emitLogWarn, emitNetworkError, emitNetworkRetry, fetchData, fetchResponse, getApiRoute, getBilibiliData, getDouyinData, getEnglishMethodName, getHeadersAndData, getKuaishouData, handleError, httpLogger, initLogger, isNetworkErrorResult, kuaishou, kuaishouApiUrls, kuaishouFetcher, kuaishouSign, kuaishouUtils, logMiddleware, logger, parseDmSegMobileReply, qtparam, toFetcherMethod, validateBilibiliParams, validateDouyinParams, validateKuaishouParams, validateXiaohongshuParams, wbi_sign, xiaohongshu, xiaohongshuApiUrls, xiaohongshuFetcher, xiaohongshuSign, xiaohongshuUtils };
|
package/lib/core_chunk/main.js
CHANGED
|
@@ -571,6 +571,15 @@ var BilibiliAPI = class {
|
|
|
571
571
|
getUserCard(data) {
|
|
572
572
|
return `https://api.bilibili.com/x/web-interface/card?mid=${data.host_mid}&photo=true`;
|
|
573
573
|
}
|
|
574
|
+
/**
|
|
575
|
+
* 按用户 UID 获取直播状态。
|
|
576
|
+
*
|
|
577
|
+
* @remarks
|
|
578
|
+
* 该接口直接返回用户当前直播状态,不依赖空间动态中的直播推荐卡片。
|
|
579
|
+
*/
|
|
580
|
+
getUserLiveStatus(data) {
|
|
581
|
+
return `https://api.live.bilibili.com/room/v1/Room/getRoomInfoOld?mid=${data.host_mid}`;
|
|
582
|
+
}
|
|
574
583
|
/** 获取直播间信息 */
|
|
575
584
|
getLiveRoomInfo(data) {
|
|
576
585
|
return `https://api.live.bilibili.com/room/v1/Room/get_info?room_id=${data.room_id}`;
|
|
@@ -1016,6 +1025,7 @@ var BilibiliUserParamsSchema = zod_default.object({
|
|
|
1016
1025
|
methodType: zod_default.enum([
|
|
1017
1026
|
"userCard",
|
|
1018
1027
|
"userDynamicList",
|
|
1028
|
+
"userLiveStatus",
|
|
1019
1029
|
"uploaderTotalViews",
|
|
1020
1030
|
"userSpaceInfo"
|
|
1021
1031
|
], { error: "方法类型必须是指定的枚举值之一" }),
|
|
@@ -1116,6 +1126,7 @@ var BilibiliValidationSchemas = {
|
|
|
1116
1126
|
commentReplies: BilibiliCommentReplyParamsSchema,
|
|
1117
1127
|
userCard: BilibiliUserParamsSchema,
|
|
1118
1128
|
userDynamicList: BilibiliUserParamsSchema,
|
|
1129
|
+
userLiveStatus: BilibiliUserParamsSchema,
|
|
1119
1130
|
userSpaceInfo: BilibiliUserParamsSchema,
|
|
1120
1131
|
emojiList: BilibiliEmojiParamsSchema,
|
|
1121
1132
|
bangumiInfo: BilibiliBangumiInfoParamsSchema,
|
|
@@ -1146,6 +1157,7 @@ var BilibiliMethodRoutes = {
|
|
|
1146
1157
|
commentReplies: "/fetch_comment_reply",
|
|
1147
1158
|
userCard: "/fetch_user_profile",
|
|
1148
1159
|
userDynamicList: "/fetch_user_dynamic",
|
|
1160
|
+
userLiveStatus: "/fetch_user_live_status",
|
|
1149
1161
|
userSpaceInfo: "/fetch_user_space_info",
|
|
1150
1162
|
emojiList: "/fetch_emoji_list",
|
|
1151
1163
|
bangumiInfo: "/fetch_bangumi_video_info",
|
|
@@ -2417,6 +2429,27 @@ async function fetchUserDynamicList(options, cookie, requestConfig) {
|
|
|
2417
2429
|
});
|
|
2418
2430
|
}
|
|
2419
2431
|
/**
|
|
2432
|
+
* 按用户 UID 获取B站直播状态
|
|
2433
|
+
* @param options - 用户参数
|
|
2434
|
+
* @param options.host_mid - 用户 UID
|
|
2435
|
+
* @param cookie - B站 Cookie (可选)
|
|
2436
|
+
* @param requestConfig - 请求配置 (可选)
|
|
2437
|
+
* @returns 用户直播状态与直播间基础信息
|
|
2438
|
+
* @example
|
|
2439
|
+
* ```typescript
|
|
2440
|
+
* const result = await fetchUserLiveStatus({ host_mid: 123456, typeMode: 'strict' }, cookie)
|
|
2441
|
+
* if (result.success && result.data.data.liveStatus === 1) {
|
|
2442
|
+
* console.log(result.data.data.roomid) // 正在直播的房间 ID
|
|
2443
|
+
* }
|
|
2444
|
+
* ```
|
|
2445
|
+
*/
|
|
2446
|
+
async function fetchUserLiveStatus(options, cookie, requestConfig) {
|
|
2447
|
+
return fetchBilibiliInternal("userLiveStatus", options, {
|
|
2448
|
+
cookie,
|
|
2449
|
+
requestConfig
|
|
2450
|
+
});
|
|
2451
|
+
}
|
|
2452
|
+
/**
|
|
2420
2453
|
* 获取B站用户空间详细信息
|
|
2421
2454
|
* @param options - 用户参数
|
|
2422
2455
|
* @param options.host_mid - 用户 UID
|
|
@@ -2574,6 +2607,37 @@ async function fetchVideoDanmaku(options, cookie, requestConfig) {
|
|
|
2574
2607
|
});
|
|
2575
2608
|
}
|
|
2576
2609
|
//#endregion
|
|
2610
|
+
//#region ../amagi/packages/core/src/model/fetchers/shared/request-config.ts
|
|
2611
|
+
/**
|
|
2612
|
+
* 合并 Fetcher 的实例级请求配置与单次请求配置。
|
|
2613
|
+
*
|
|
2614
|
+
* 单次配置优先,请求头单独合并。函数不会修改任一入参,因此同一绑定
|
|
2615
|
+
* Fetcher 可以安全地在并发任务中为不同请求使用不同配置。
|
|
2616
|
+
*/
|
|
2617
|
+
var mergeRequestConfig = (base, override) => {
|
|
2618
|
+
if (!override) return base;
|
|
2619
|
+
return {
|
|
2620
|
+
...base ?? {},
|
|
2621
|
+
...override,
|
|
2622
|
+
headers: {
|
|
2623
|
+
...base?.headers ?? {},
|
|
2624
|
+
...override.headers ?? {}
|
|
2625
|
+
}
|
|
2626
|
+
};
|
|
2627
|
+
};
|
|
2628
|
+
/**
|
|
2629
|
+
* 解析绑定 Fetcher 当前调用实际使用的 cookie 与请求配置。
|
|
2630
|
+
*
|
|
2631
|
+
* 实例级或单次配置显式提供大写 `headers.Cookie` 时,合并后的值同时替换
|
|
2632
|
+
* 底层 Fetcher 的 cookie 参数,确保平台签名、前置请求和最终请求处于同一身份状态。
|
|
2633
|
+
*/
|
|
2634
|
+
var resolveBoundRequest = (boundCookie, base, override) => {
|
|
2635
|
+
const requestConfig = mergeRequestConfig(base, override);
|
|
2636
|
+
const headers = requestConfig?.headers;
|
|
2637
|
+
const cookieOverride = Boolean(headers && Object.prototype.hasOwnProperty.call(headers, "Cookie")) ? headers.Cookie : void 0;
|
|
2638
|
+
return [typeof cookieOverride === "string" ? cookieOverride : boundCookie, requestConfig];
|
|
2639
|
+
};
|
|
2640
|
+
//#endregion
|
|
2577
2641
|
//#region ../amagi/packages/core/src/model/fetchers/bilibili/bound.ts
|
|
2578
2642
|
/**
|
|
2579
2643
|
* 创建绑定了 Cookie 和请求配置的 B站 Fetcher
|
|
@@ -2589,35 +2653,37 @@ async function fetchVideoDanmaku(options, cookie, requestConfig) {
|
|
|
2589
2653
|
* ```
|
|
2590
2654
|
*/
|
|
2591
2655
|
function createBoundBilibiliFetcher(cookie, requestConfig) {
|
|
2656
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
2592
2657
|
return {
|
|
2593
|
-
fetchVideoInfo: (options) => fetchVideoInfo(options,
|
|
2594
|
-
fetchVideoStreamUrl: (options) => fetchVideoStreamUrl(options,
|
|
2595
|
-
fetchVideoDanmaku: (options) => fetchVideoDanmaku(options,
|
|
2596
|
-
fetchComments: (options) => fetchComments(options,
|
|
2597
|
-
fetchCommentReplies: (options) => fetchCommentReplies$1(options,
|
|
2598
|
-
fetchUserCard: (options) => fetchUserCard(options,
|
|
2599
|
-
fetchUserDynamicList: (options) => fetchUserDynamicList(options,
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2658
|
+
fetchVideoInfo: (options, override) => fetchVideoInfo(options, ...resolveRequest(override)),
|
|
2659
|
+
fetchVideoStreamUrl: (options, override) => fetchVideoStreamUrl(options, ...resolveRequest(override)),
|
|
2660
|
+
fetchVideoDanmaku: (options, override) => fetchVideoDanmaku(options, ...resolveRequest(override)),
|
|
2661
|
+
fetchComments: (options, override) => fetchComments(options, ...resolveRequest(override)),
|
|
2662
|
+
fetchCommentReplies: (options, override) => fetchCommentReplies$1(options, ...resolveRequest(override)),
|
|
2663
|
+
fetchUserCard: (options, override) => fetchUserCard(options, ...resolveRequest(override)),
|
|
2664
|
+
fetchUserDynamicList: (options, override) => fetchUserDynamicList(options, ...resolveRequest(override)),
|
|
2665
|
+
fetchUserLiveStatus: (options, override) => fetchUserLiveStatus(options, ...resolveRequest(override)),
|
|
2666
|
+
fetchUserSpaceInfo: (options, override) => fetchUserSpaceInfo(options, ...resolveRequest(override)),
|
|
2667
|
+
fetchUploaderTotalViews: (options, override) => fetchUploaderTotalViews(options, ...resolveRequest(override)),
|
|
2668
|
+
fetchDynamicDetail: (options, override) => fetchDynamicDetail(options, ...resolveRequest(override)),
|
|
2603
2669
|
/** @deprecated v6.1.3 已废弃,调用将返回错误信息 */
|
|
2604
|
-
fetchDynamicCard: (options) => fetchDynamicCard(options,
|
|
2605
|
-
fetchBangumiInfo: (options) => fetchBangumiInfo(options,
|
|
2606
|
-
fetchBangumiStreamUrl: (options) => fetchBangumiStreamUrl(options,
|
|
2607
|
-
fetchLiveRoomInfo: (options) => fetchLiveRoomInfo$2(options,
|
|
2608
|
-
fetchLiveRoomInitInfo: (options) => fetchLiveRoomInitInfo(options,
|
|
2609
|
-
fetchArticleContent: (options) => fetchArticleContent(options,
|
|
2610
|
-
fetchArticleCards: (options) => fetchArticleCards(options,
|
|
2611
|
-
fetchArticleInfo: (options) => fetchArticleInfo(options,
|
|
2612
|
-
fetchArticleListInfo: (options) => fetchArticleListInfo(options,
|
|
2613
|
-
fetchLoginStatus: (options) => fetchLoginStatus(options,
|
|
2614
|
-
requestLoginQrcode: (options) => requestLoginQrcode$1(options,
|
|
2615
|
-
checkQrcodeStatus: (options) => checkQrcodeStatus(options,
|
|
2616
|
-
requestCaptchaFromVoucher: (options) => requestCaptchaFromVoucher(options,
|
|
2617
|
-
validateCaptchaResult: (options) => validateCaptchaResult(options,
|
|
2618
|
-
convertAvToBv: (options) => convertAvToBv(options,
|
|
2619
|
-
convertBvToAv: (options) => convertBvToAv(options,
|
|
2620
|
-
fetchEmojiList: (options) => fetchEmojiList$3(options,
|
|
2670
|
+
fetchDynamicCard: (options, override) => fetchDynamicCard(options, ...resolveRequest(override)),
|
|
2671
|
+
fetchBangumiInfo: (options, override) => fetchBangumiInfo(options, ...resolveRequest(override)),
|
|
2672
|
+
fetchBangumiStreamUrl: (options, override) => fetchBangumiStreamUrl(options, ...resolveRequest(override)),
|
|
2673
|
+
fetchLiveRoomInfo: (options, override) => fetchLiveRoomInfo$2(options, ...resolveRequest(override)),
|
|
2674
|
+
fetchLiveRoomInitInfo: (options, override) => fetchLiveRoomInitInfo(options, ...resolveRequest(override)),
|
|
2675
|
+
fetchArticleContent: (options, override) => fetchArticleContent(options, ...resolveRequest(override)),
|
|
2676
|
+
fetchArticleCards: (options, override) => fetchArticleCards(options, ...resolveRequest(override)),
|
|
2677
|
+
fetchArticleInfo: (options, override) => fetchArticleInfo(options, ...resolveRequest(override)),
|
|
2678
|
+
fetchArticleListInfo: (options, override) => fetchArticleListInfo(options, ...resolveRequest(override)),
|
|
2679
|
+
fetchLoginStatus: (options, override) => fetchLoginStatus(options, ...resolveRequest(override)),
|
|
2680
|
+
requestLoginQrcode: (options, override) => requestLoginQrcode$1(options, ...resolveRequest(override)),
|
|
2681
|
+
checkQrcodeStatus: (options, override) => checkQrcodeStatus(options, ...resolveRequest(override)),
|
|
2682
|
+
requestCaptchaFromVoucher: (options, override) => requestCaptchaFromVoucher(options, ...resolveRequest(override)),
|
|
2683
|
+
validateCaptchaResult: (options, override) => validateCaptchaResult(options, ...resolveRequest(override)),
|
|
2684
|
+
convertAvToBv: (options, override) => convertAvToBv(options, ...resolveRequest(override)),
|
|
2685
|
+
convertBvToAv: (options, override) => convertBvToAv(options, ...resolveRequest(override)),
|
|
2686
|
+
fetchEmojiList: (options, override) => fetchEmojiList$3(options, ...resolveRequest(override))
|
|
2621
2687
|
};
|
|
2622
2688
|
}
|
|
2623
2689
|
//#endregion
|
|
@@ -2644,6 +2710,7 @@ var bilibiliFetcher$1 = {
|
|
|
2644
2710
|
fetchCommentReplies: fetchCommentReplies$1,
|
|
2645
2711
|
fetchUserCard,
|
|
2646
2712
|
fetchUserDynamicList,
|
|
2713
|
+
fetchUserLiveStatus,
|
|
2647
2714
|
fetchUserSpaceInfo,
|
|
2648
2715
|
fetchUploaderTotalViews,
|
|
2649
2716
|
fetchDynamicDetail,
|
|
@@ -5196,26 +5263,27 @@ async function fetchDanmakuList(options, cookie, requestConfig) {
|
|
|
5196
5263
|
* ```
|
|
5197
5264
|
*/
|
|
5198
5265
|
function createBoundDouyinFetcher(cookie, requestConfig) {
|
|
5266
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
5199
5267
|
return {
|
|
5200
|
-
fetchVideoWork: (options,
|
|
5201
|
-
fetchImageAlbumWork: (options,
|
|
5202
|
-
fetchSlidesWork: (options,
|
|
5203
|
-
fetchTextWork: (options,
|
|
5204
|
-
parseWork: (options,
|
|
5205
|
-
fetchDanmakuList: (options,
|
|
5206
|
-
fetchWorkComments: (options,
|
|
5207
|
-
fetchCommentReplies: (options,
|
|
5208
|
-
fetchUserProfile: (options,
|
|
5209
|
-
fetchUserVideoList: (options,
|
|
5210
|
-
fetchUserFavoriteList: (options,
|
|
5211
|
-
fetchUserRecommendList: (options,
|
|
5212
|
-
searchContent: (options,
|
|
5213
|
-
fetchSuggestWords: (options,
|
|
5214
|
-
fetchMusicInfo: (options,
|
|
5215
|
-
fetchLiveRoomInfo: (options,
|
|
5216
|
-
requestLoginQrcode: (options,
|
|
5217
|
-
fetchEmojiList: (options,
|
|
5218
|
-
fetchDynamicEmojiList: (options,
|
|
5268
|
+
fetchVideoWork: (options, override) => fetchVideoWork$1(options, ...resolveRequest(override)),
|
|
5269
|
+
fetchImageAlbumWork: (options, override) => fetchImageAlbumWork(options, ...resolveRequest(override)),
|
|
5270
|
+
fetchSlidesWork: (options, override) => fetchSlidesWork(options, ...resolveRequest(override)),
|
|
5271
|
+
fetchTextWork: (options, override) => fetchTextWork(options, ...resolveRequest(override)),
|
|
5272
|
+
parseWork: (options, override) => parseWork(options, ...resolveRequest(override)),
|
|
5273
|
+
fetchDanmakuList: (options, override) => fetchDanmakuList(options, ...resolveRequest(override)),
|
|
5274
|
+
fetchWorkComments: (options, override) => fetchWorkComments$1(options, ...resolveRequest(override)),
|
|
5275
|
+
fetchCommentReplies: (options, override) => fetchCommentReplies(options, ...resolveRequest(override)),
|
|
5276
|
+
fetchUserProfile: (options, override) => fetchUserProfile$2(options, ...resolveRequest(override)),
|
|
5277
|
+
fetchUserVideoList: (options, override) => fetchUserVideoList(options, ...resolveRequest(override)),
|
|
5278
|
+
fetchUserFavoriteList: (options, override) => fetchUserFavoriteList(options, ...resolveRequest(override)),
|
|
5279
|
+
fetchUserRecommendList: (options, override) => fetchUserRecommendList(options, ...resolveRequest(override)),
|
|
5280
|
+
searchContent: (options, override) => searchContent(options, ...resolveRequest(override)),
|
|
5281
|
+
fetchSuggestWords: (options, override) => fetchSuggestWords(options, ...resolveRequest(override)),
|
|
5282
|
+
fetchMusicInfo: (options, override) => fetchMusicInfo(options, ...resolveRequest(override)),
|
|
5283
|
+
fetchLiveRoomInfo: (options, override) => fetchLiveRoomInfo$1(options, ...resolveRequest(override)),
|
|
5284
|
+
requestLoginQrcode: (options, override) => requestLoginQrcode(options, ...resolveRequest(override)),
|
|
5285
|
+
fetchEmojiList: (options, override) => fetchEmojiList$2(options, ...resolveRequest(override)),
|
|
5286
|
+
fetchDynamicEmojiList: (options, override) => fetchDynamicEmojiList(options, ...resolveRequest(override))
|
|
5219
5287
|
};
|
|
5220
5288
|
}
|
|
5221
5289
|
//#endregion
|
|
@@ -7608,13 +7676,14 @@ var kuaishouFetcher$1 = {
|
|
|
7608
7676
|
* ```
|
|
7609
7677
|
*/
|
|
7610
7678
|
function createBoundKuaishouFetcher(cookie, requestConfig) {
|
|
7679
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
7611
7680
|
return {
|
|
7612
|
-
fetchVideoWork: (options,
|
|
7613
|
-
fetchWorkComments: (options,
|
|
7614
|
-
fetchUserProfile: (options,
|
|
7615
|
-
fetchUserWorkList: (options,
|
|
7616
|
-
fetchLiveRoomInfo: (options,
|
|
7617
|
-
fetchEmojiList: (options,
|
|
7681
|
+
fetchVideoWork: (options, override) => fetchVideoWork(options, ...resolveRequest(override)),
|
|
7682
|
+
fetchWorkComments: (options, override) => fetchWorkComments(options, ...resolveRequest(override)),
|
|
7683
|
+
fetchUserProfile: (options, override) => fetchUserProfile$1(options, ...resolveRequest(override)),
|
|
7684
|
+
fetchUserWorkList: (options, override) => fetchUserWorkList(options, ...resolveRequest(override)),
|
|
7685
|
+
fetchLiveRoomInfo: (options, override) => fetchLiveRoomInfo(options, ...resolveRequest(override)),
|
|
7686
|
+
fetchEmojiList: (options, override) => fetchEmojiList$1(options, ...resolveRequest(override))
|
|
7618
7687
|
};
|
|
7619
7688
|
}
|
|
7620
7689
|
//#endregion
|
|
@@ -8053,14 +8122,15 @@ var xiaohongshuFetcher$1 = {
|
|
|
8053
8122
|
* ```
|
|
8054
8123
|
*/
|
|
8055
8124
|
function createBoundXiaohongshuFetcher(cookie, requestConfig) {
|
|
8125
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
8056
8126
|
return {
|
|
8057
|
-
fetchHomeFeed: (options = {},
|
|
8058
|
-
fetchNoteDetail: (options,
|
|
8059
|
-
fetchNoteComments: (options,
|
|
8060
|
-
fetchUserProfile: (options,
|
|
8061
|
-
fetchUserNoteList: (options,
|
|
8062
|
-
searchNotes: (options,
|
|
8063
|
-
fetchEmojiList: (options,
|
|
8127
|
+
fetchHomeFeed: (options = {}, override) => fetchHomeFeed(options, ...resolveRequest(override)),
|
|
8128
|
+
fetchNoteDetail: (options, override) => fetchNoteDetail(options, ...resolveRequest(override)),
|
|
8129
|
+
fetchNoteComments: (options, override) => fetchNoteComments(options, ...resolveRequest(override)),
|
|
8130
|
+
fetchUserProfile: (options, override) => fetchUserProfile(options, ...resolveRequest(override)),
|
|
8131
|
+
fetchUserNoteList: (options, override) => fetchUserNoteList(options, ...resolveRequest(override)),
|
|
8132
|
+
searchNotes: (options, override) => searchNotes(options, ...resolveRequest(override)),
|
|
8133
|
+
fetchEmojiList: (options, override) => fetchEmojiList(options, ...resolveRequest(override))
|
|
8064
8134
|
};
|
|
8065
8135
|
}
|
|
8066
8136
|
//#endregion
|
|
@@ -8823,6 +8893,10 @@ var fetchBilibili = async (data, cookie, requestConfig) => {
|
|
|
8823
8893
|
url: bilibiliApiUrls.getUserCard({ host_mid })
|
|
8824
8894
|
});
|
|
8825
8895
|
}
|
|
8896
|
+
case "userLiveStatus": return await GlobalGetData(data.methodType, {
|
|
8897
|
+
...baseRequestConfig,
|
|
8898
|
+
url: bilibiliApiUrls.getUserLiveStatus({ host_mid: data.host_mid })
|
|
8899
|
+
});
|
|
8826
8900
|
case "userSpaceInfo": {
|
|
8827
8901
|
const wbiSignQuery = await wbi_sign(bilibiliApiUrls.getUserSpaceInfo({ host_mid: data.host_mid }), baseRequestConfig.headers?.cookie);
|
|
8828
8902
|
return await GlobalGetData(data.methodType, {
|
|
@@ -9910,6 +9984,7 @@ var BilibiliInternalMethods = {
|
|
|
9910
9984
|
COMMENT_REPLIES: "指定评论的回复",
|
|
9911
9985
|
USER_CARD: "用户主页数据",
|
|
9912
9986
|
USER_DYNAMICS: "用户主页动态列表数据",
|
|
9987
|
+
USER_LIVE_STATUS: "用户直播状态",
|
|
9913
9988
|
USER_SPACE_INFO: "用户空间详细信息",
|
|
9914
9989
|
USER_TOTAL_VIEWS: "获取UP主总播放量",
|
|
9915
9990
|
DYNAMIC_DETAIL: "动态详情数据",
|
|
@@ -9940,6 +10015,7 @@ var BilibiliFetcherMethods = {
|
|
|
9940
10015
|
COMMENT_REPLIES: "fetchCommentReplies",
|
|
9941
10016
|
USER_CARD: "fetchUserCard",
|
|
9942
10017
|
USER_DYNAMICS: "fetchUserDynamicList",
|
|
10018
|
+
USER_LIVE_STATUS: "fetchUserLiveStatus",
|
|
9943
10019
|
USER_SPACE_INFO: "fetchUserSpaceInfo",
|
|
9944
10020
|
USER_TOTAL_VIEWS: "fetchUploaderTotalViews",
|
|
9945
10021
|
DYNAMIC_DETAIL: "fetchDynamicDetail",
|
|
@@ -10048,6 +10124,7 @@ var BilibiliMethodToFetcher = {
|
|
|
10048
10124
|
[BilibiliInternalMethods.COMMENT_REPLIES]: BilibiliFetcherMethods.COMMENT_REPLIES,
|
|
10049
10125
|
[BilibiliInternalMethods.USER_CARD]: BilibiliFetcherMethods.USER_CARD,
|
|
10050
10126
|
[BilibiliInternalMethods.USER_DYNAMICS]: BilibiliFetcherMethods.USER_DYNAMICS,
|
|
10127
|
+
[BilibiliInternalMethods.USER_LIVE_STATUS]: BilibiliFetcherMethods.USER_LIVE_STATUS,
|
|
10051
10128
|
[BilibiliInternalMethods.USER_SPACE_INFO]: BilibiliFetcherMethods.USER_SPACE_INFO,
|
|
10052
10129
|
[BilibiliInternalMethods.USER_TOTAL_VIEWS]: BilibiliFetcherMethods.USER_TOTAL_VIEWS,
|
|
10053
10130
|
[BilibiliInternalMethods.DYNAMIC_DETAIL]: BilibiliFetcherMethods.DYNAMIC_DETAIL,
|
|
@@ -10179,6 +10256,7 @@ var BilibiliMethodMapping = {
|
|
|
10179
10256
|
指定评论的回复: "fetchCommentReplies",
|
|
10180
10257
|
用户主页数据: "fetchUserCard",
|
|
10181
10258
|
用户主页动态列表数据: "fetchUserDynamicList",
|
|
10259
|
+
用户直播状态: "fetchUserLiveStatus",
|
|
10182
10260
|
用户空间详细信息: "fetchUserSpaceInfo",
|
|
10183
10261
|
获取UP主总播放量: "fetchUploaderTotalViews",
|
|
10184
10262
|
动态详情数据: "fetchDynamicDetail",
|
|
@@ -10261,6 +10339,7 @@ var BilibiliApiRoutes = {
|
|
|
10261
10339
|
commentReplies: "/comment-replies",
|
|
10262
10340
|
userCard: "/user",
|
|
10263
10341
|
userDynamicList: "/user/dynamics",
|
|
10342
|
+
userLiveStatus: "/user/live-status",
|
|
10264
10343
|
userSpaceInfo: "/user/space",
|
|
10265
10344
|
uploaderTotalViews: "/user/total-views",
|
|
10266
10345
|
dynamicDetail: "/dynamic",
|
|
@@ -10334,7 +10413,7 @@ function getApiRoute(platform, methodType) {
|
|
|
10334
10413
|
* 构建后使用 __VERSION__,开发环境从 package.json 读取
|
|
10335
10414
|
*/
|
|
10336
10415
|
var getVersion = () => {
|
|
10337
|
-
return "6.
|
|
10416
|
+
return "6.4.0";
|
|
10338
10417
|
};
|
|
10339
10418
|
var VERSION = getVersion();
|
|
10340
10419
|
/**
|
|
@@ -35035,6 +35114,8 @@ var buildBilibiliRichTextForwardMessage = async (document, options = {}) => {
|
|
|
35035
35114
|
//#endregion
|
|
35036
35115
|
//#region src/platform/bilibili/bilibili.ts
|
|
35037
35116
|
var img$1;
|
|
35117
|
+
/** 评论请求统一使用匿名态,避免账号 Cookie 改变评论热度池结果。 */
|
|
35118
|
+
var bilibiliAnonymousRequestConfig = { headers: { Cookie: "" } };
|
|
35038
35119
|
var Bilibili = class extends Base {
|
|
35039
35120
|
e;
|
|
35040
35121
|
type;
|
|
@@ -35158,7 +35239,7 @@ var Bilibili = class extends Base {
|
|
|
35158
35239
|
type: 1,
|
|
35159
35240
|
oid: infoData.data.data.aid.toString(),
|
|
35160
35241
|
typeMode: "strict"
|
|
35161
|
-
}), [SOFT_ERROR_CODES.BILIBILI_COMMENTS_DISABLED]);
|
|
35242
|
+
}, bilibiliAnonymousRequestConfig), [SOFT_ERROR_CODES.BILIBILI_COMMENTS_DISABLED]);
|
|
35162
35243
|
if (commentsData.code === SOFT_ERROR_CODES.BILIBILI_COMMENTS_DISABLED) this.e.reply("UP主已关闭评论区,无法获取评论");
|
|
35163
35244
|
else {
|
|
35164
35245
|
const { comments: commentsdata, image_urls } = bilibiliComments(commentsData.data, infoData.data.data.owner.mid.toString());
|
|
@@ -35786,7 +35867,7 @@ var Bilibili = class extends Base {
|
|
|
35786
35867
|
oid: oid(dynamicInfo.data.data.item.type, dynamicInfo.data),
|
|
35787
35868
|
number: Config.bilibili.numcomment,
|
|
35788
35869
|
typeMode: "strict"
|
|
35789
|
-
}), [SOFT_ERROR_CODES.BILIBILI_COMMENTS_DISABLED]);
|
|
35870
|
+
}, bilibiliAnonymousRequestConfig), [SOFT_ERROR_CODES.BILIBILI_COMMENTS_DISABLED]);
|
|
35790
35871
|
if (commentsData.code === SOFT_ERROR_CODES.BILIBILI_COMMENTS_DISABLED) this.e.reply("UP主已关闭评论区,无法获取评论");
|
|
35791
35872
|
else {
|
|
35792
35873
|
const { comments: commentsdata, image_urls } = bilibiliComments(commentsData.data, dynamicInfo.data.data.item.modules.module_author.mid.toString());
|
|
@@ -36822,6 +36903,43 @@ var bilibiliLogin = async (e) => {
|
|
|
36822
36903
|
}
|
|
36823
36904
|
};
|
|
36824
36905
|
//#endregion
|
|
36906
|
+
//#region src/platform/bilibili/live-status.ts
|
|
36907
|
+
var invalidLiveTimes = /* @__PURE__ */ new Set([
|
|
36908
|
+
"",
|
|
36909
|
+
"-62170012800",
|
|
36910
|
+
"0000-00-00 00:00:00"
|
|
36911
|
+
]);
|
|
36912
|
+
/**
|
|
36913
|
+
* 将B站返回的东八区开播时间转换为数据库可比较的 ISO 时间。
|
|
36914
|
+
*
|
|
36915
|
+
* @param liveTime B站直播间详情返回的开播时间。
|
|
36916
|
+
* @returns 有效的 UTC ISO 时间;无法解析时返回 `null`。
|
|
36917
|
+
*/
|
|
36918
|
+
var parseBilibiliLiveStartedAt = (liveTime) => {
|
|
36919
|
+
const normalizedLiveTime = liveTime.trim();
|
|
36920
|
+
if (invalidLiveTimes.has(normalizedLiveTime)) return null;
|
|
36921
|
+
const zonedLiveTime = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(normalizedLiveTime) ? `${normalizedLiveTime.replace(" ", "T")}+08:00` : normalizedLiveTime;
|
|
36922
|
+
const timestamp = Date.parse(zonedLiveTime);
|
|
36923
|
+
return Number.isNaN(timestamp) ? null : new Date(timestamp).toISOString();
|
|
36924
|
+
};
|
|
36925
|
+
/**
|
|
36926
|
+
* 使用直播间和开播时间构造跨检测源稳定的场次缓存键。
|
|
36927
|
+
*
|
|
36928
|
+
* @remarks
|
|
36929
|
+
* 定时推送可能先从 UID 直播状态接口发现开播,也可能在接口异常时回退到动态列表。
|
|
36930
|
+
* 两条路径必须使用同一个场次键,才能避免同一场直播被重复推送。
|
|
36931
|
+
*
|
|
36932
|
+
* @param hostMid UP 主 UID。
|
|
36933
|
+
* @param roomId 直播间长号。
|
|
36934
|
+
* @param liveTime B站直播间详情返回的本场开播时间。
|
|
36935
|
+
* @returns 可用于 `DynamicCaches` 的场次键;开播时间无效时返回 `null`。
|
|
36936
|
+
*/
|
|
36937
|
+
var buildBilibiliLiveSessionId = (hostMid, roomId, liveTime) => {
|
|
36938
|
+
const normalizedLiveTime = liveTime.trim();
|
|
36939
|
+
if (!parseBilibiliLiveStartedAt(normalizedLiveTime)) return null;
|
|
36940
|
+
return `bilibili-live:${hostMid}:${roomId}:${normalizedLiveTime}`;
|
|
36941
|
+
};
|
|
36942
|
+
//#endregion
|
|
36825
36943
|
//#region src/platform/bilibili/push.ts
|
|
36826
36944
|
/** BilibiliPushType 到 DynamicType 的映射 */
|
|
36827
36945
|
var pushTypeToDynamicType = {
|
|
@@ -36929,6 +37047,88 @@ var Bilibilipush = class extends Base {
|
|
|
36929
37047
|
}
|
|
36930
37048
|
return filteredList;
|
|
36931
37049
|
}
|
|
37050
|
+
/** 将 UID 直播状态接口的结果接入原有动态推送列表。 */
|
|
37051
|
+
async getDirectLivePushItems(userList) {
|
|
37052
|
+
const handledUids = /* @__PURE__ */ new Set();
|
|
37053
|
+
const willBePushList = {};
|
|
37054
|
+
const liveSubscriptions = userList.filter((item) => item.switch !== false && (item.pushTypes || allBilibiliPushTypes).includes("live"));
|
|
37055
|
+
for (const item of liveSubscriptions) {
|
|
37056
|
+
let liveStatus;
|
|
37057
|
+
try {
|
|
37058
|
+
const liveStatusResult = await this.amagi.bilibili.fetcher.fetchUserLiveStatus({
|
|
37059
|
+
host_mid: item.host_mid,
|
|
37060
|
+
typeMode: "strict"
|
|
37061
|
+
});
|
|
37062
|
+
if (!liveStatusResult.success) throw new Error(`code=${liveStatusResult.code}:${liveStatusResult.message}`);
|
|
37063
|
+
liveStatus = liveStatusResult.data.data;
|
|
37064
|
+
} catch (error) {
|
|
37065
|
+
logger.warn(`[Bilibili 推送] UP主 ${item.remark}(${item.host_mid})直播状态直查失败,本轮停止直查并让剩余订阅回退到直播动态检测:${formatErrorMessage(error)}`);
|
|
37066
|
+
break;
|
|
37067
|
+
}
|
|
37068
|
+
if (liveStatus.roomStatus !== 1 || liveStatus.liveStatus !== 1 || liveStatus.roomid <= 0) {
|
|
37069
|
+
handledUids.add(item.host_mid);
|
|
37070
|
+
continue;
|
|
37071
|
+
}
|
|
37072
|
+
try {
|
|
37073
|
+
const liveInfo = (await this.amagi.bilibili.fetcher.fetchLiveRoomInfo({
|
|
37074
|
+
room_id: String(liveStatus.roomid),
|
|
37075
|
+
typeMode: "strict"
|
|
37076
|
+
})).data.data;
|
|
37077
|
+
/** 两个直播接口状态不一致时,以直播间详情为准。 */
|
|
37078
|
+
if (liveInfo.live_status !== 1) {
|
|
37079
|
+
handledUids.add(item.host_mid);
|
|
37080
|
+
continue;
|
|
37081
|
+
}
|
|
37082
|
+
const sessionId = buildBilibiliLiveSessionId(item.host_mid, liveInfo.room_id, liveInfo.live_time);
|
|
37083
|
+
const liveStartedAt = parseBilibiliLiveStartedAt(liveInfo.live_time);
|
|
37084
|
+
if (!sessionId || !liveStartedAt) throw new Error(`直播间 ${liveInfo.room_id} 未返回可用于场次去重的开播时间`);
|
|
37085
|
+
const dynamic = createLiveDynamicItem(sessionId, liveStartedAt, liveInfo, liveStatus);
|
|
37086
|
+
willBePushList[sessionId] = {
|
|
37087
|
+
remark: item.remark,
|
|
37088
|
+
host_mid: item.host_mid,
|
|
37089
|
+
create_time: dynamic.modules.module_author.pub_ts,
|
|
37090
|
+
targets: item.group_id.map((groupWithBot) => {
|
|
37091
|
+
const [groupId, botId] = groupWithBot.split(":");
|
|
37092
|
+
return {
|
|
37093
|
+
groupId,
|
|
37094
|
+
botId
|
|
37095
|
+
};
|
|
37096
|
+
}),
|
|
37097
|
+
Dynamic_Data: dynamic,
|
|
37098
|
+
avatar_img: "",
|
|
37099
|
+
dynamic_type: DynamicType.LIVE_RCMD
|
|
37100
|
+
};
|
|
37101
|
+
handledUids.add(item.host_mid);
|
|
37102
|
+
} catch (error) {
|
|
37103
|
+
logger.warn(`[Bilibili 推送] UP主 ${item.remark}(${item.host_mid})直播场次信息不完整,本轮回退到直播动态检测:${formatErrorMessage(error)}`);
|
|
37104
|
+
}
|
|
37105
|
+
}
|
|
37106
|
+
return {
|
|
37107
|
+
handledUids,
|
|
37108
|
+
willBePushList
|
|
37109
|
+
};
|
|
37110
|
+
}
|
|
37111
|
+
/**
|
|
37112
|
+
* 为降级路径中的直播动态解析与直查路径一致的场次缓存键。
|
|
37113
|
+
*
|
|
37114
|
+
* @param dynamic B站空间动态中的直播推荐项。
|
|
37115
|
+
* @param hostMid UP 主 UID。
|
|
37116
|
+
* @returns 可用时返回直播场次键,否则退回原始动态ID。
|
|
37117
|
+
*/
|
|
37118
|
+
async resolveLiveDynamicCacheId(dynamic, hostMid) {
|
|
37119
|
+
try {
|
|
37120
|
+
const liveData = JSON.parse(dynamic.modules.module_dynamic.major.live_rcmd.content);
|
|
37121
|
+
const roomId = Number(liveData.live_play_info.room_id);
|
|
37122
|
+
const liveInfo = await this.amagi.bilibili.fetcher.fetchLiveRoomInfo({
|
|
37123
|
+
room_id: String(roomId),
|
|
37124
|
+
typeMode: "strict"
|
|
37125
|
+
});
|
|
37126
|
+
return buildBilibiliLiveSessionId(hostMid, liveInfo.data.data.room_id, liveInfo.data.data.live_time) || dynamic.id_str;
|
|
37127
|
+
} catch (error) {
|
|
37128
|
+
logger.warn(`[Bilibili 推送] 直播动态 ${dynamic.id_str} 无法解析统一场次键,将使用动态ID去重:${formatErrorMessage(error)}`);
|
|
37129
|
+
return dynamic.id_str;
|
|
37130
|
+
}
|
|
37131
|
+
}
|
|
36932
37132
|
/**
|
|
36933
37133
|
* 同步配置文件中的订阅信息到数据库
|
|
36934
37134
|
*/
|
|
@@ -37580,18 +37780,22 @@ var Bilibilipush = class extends Base {
|
|
|
37580
37780
|
}
|
|
37581
37781
|
/**
|
|
37582
37782
|
* 根据配置文件获取UP当天的动态列表。
|
|
37783
|
+
* @param userList B站订阅列表。
|
|
37583
37784
|
* @returns
|
|
37584
37785
|
*/
|
|
37585
37786
|
async getDynamicList(userList) {
|
|
37586
|
-
const
|
|
37787
|
+
const directLiveItems = await this.getDirectLivePushItems(userList);
|
|
37788
|
+
const willbepushlist = { ...directLiveItems.willBePushList };
|
|
37587
37789
|
try {
|
|
37588
37790
|
/** 过滤掉不启用的订阅项 */
|
|
37589
37791
|
const filteredUserList = userList.filter((item) => item.switch !== false);
|
|
37590
37792
|
for (const item of filteredUserList) {
|
|
37591
|
-
await common.sleep(2e3);
|
|
37592
|
-
logger.debug(`[Bilibili 推送] 开始获取UP: ${item.remark}(${item.host_mid}) 的动态列表`);
|
|
37593
37793
|
const pushTypes = item.pushTypes || allBilibiliPushTypes;
|
|
37594
37794
|
const allowedDynamicTypes = new Set(pushTypes.map((pt) => pushTypeToDynamicType[pt]));
|
|
37795
|
+
if (directLiveItems.handledUids.has(item.host_mid)) allowedDynamicTypes.delete(DynamicType.LIVE_RCMD);
|
|
37796
|
+
if (allowedDynamicTypes.size === 0) continue;
|
|
37797
|
+
await common.sleep(2e3);
|
|
37798
|
+
logger.debug(`[Bilibili 推送] 开始获取UP: ${item.remark}(${item.host_mid}) 的动态列表`);
|
|
37595
37799
|
const dynamic_list = await this.amagi.bilibili.fetcher.fetchUserDynamicList({
|
|
37596
37800
|
host_mid: item.host_mid,
|
|
37597
37801
|
typeMode: "strict"
|
|
@@ -37630,7 +37834,8 @@ var Bilibilipush = class extends Base {
|
|
|
37630
37834
|
botId
|
|
37631
37835
|
};
|
|
37632
37836
|
});
|
|
37633
|
-
|
|
37837
|
+
const pushId = dynamic.type === DynamicType.LIVE_RCMD ? await this.resolveLiveDynamicCacheId(dynamic, item.host_mid) : dynamic.id_str;
|
|
37838
|
+
if (!willbepushlist[pushId]) willbepushlist[pushId] = {
|
|
37634
37839
|
remark: item.remark,
|
|
37635
37840
|
host_mid: item.host_mid,
|
|
37636
37841
|
create_time: dynamic.modules.module_author.pub_ts,
|
|
@@ -37812,6 +38017,44 @@ var Bilibilipush = class extends Base {
|
|
|
37812
38017
|
}
|
|
37813
38018
|
};
|
|
37814
38019
|
/**
|
|
38020
|
+
* 把直播状态接口的数据适配为现有直播动态分支实际读取的字段。
|
|
38021
|
+
*
|
|
38022
|
+
* 后续过滤、渲染、发送和缓存均继续使用统一的动态推送链路。
|
|
38023
|
+
*/
|
|
38024
|
+
var createLiveDynamicItem = (sessionId, liveStartedAt, liveInfo, liveStatus) => {
|
|
38025
|
+
const content = JSON.stringify({ live_play_info: {
|
|
38026
|
+
area_name: liveInfo.area_name,
|
|
38027
|
+
cover: liveInfo.user_cover || liveStatus.cover,
|
|
38028
|
+
room_id: liveInfo.room_id,
|
|
38029
|
+
title: liveInfo.title || liveStatus.title
|
|
38030
|
+
} });
|
|
38031
|
+
return {
|
|
38032
|
+
id_str: sessionId,
|
|
38033
|
+
type: DynamicType.LIVE_RCMD,
|
|
38034
|
+
modules: {
|
|
38035
|
+
module_author: {
|
|
38036
|
+
face: "",
|
|
38037
|
+
pendant: { image: "" },
|
|
38038
|
+
pub_ts: Math.floor(Date.parse(liveStartedAt) / 1e3)
|
|
38039
|
+
},
|
|
38040
|
+
module_dynamic: {
|
|
38041
|
+
additional: null,
|
|
38042
|
+
desc: null,
|
|
38043
|
+
major: {
|
|
38044
|
+
live_rcmd: {
|
|
38045
|
+
content,
|
|
38046
|
+
reserve_type: 0
|
|
38047
|
+
},
|
|
38048
|
+
type: MajorType.LIVE_RCMD
|
|
38049
|
+
},
|
|
38050
|
+
topic: null
|
|
38051
|
+
}
|
|
38052
|
+
}
|
|
38053
|
+
};
|
|
38054
|
+
};
|
|
38055
|
+
/** 将未知异常转换为适合业务日志展示的文本。 */
|
|
38056
|
+
var formatErrorMessage = (error) => error instanceof Error ? error.message : String(error);
|
|
38057
|
+
/**
|
|
37815
38058
|
* 将换行符替换为HTML的<br>标签。
|
|
37816
38059
|
* @param data 需要进行换行符替换的字符串。
|
|
37817
38060
|
* @returns 替换后的字符串,其中的换行符\n被<br>替换。
|