函数 validateBilibiliParams
validateBilibiliParams< T extends | "videoInfo" | "videoStream" | "comments" | "commentReplies" | "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo" | "dynamicDetail" | "dynamicCard" | "bangumiInfo" | "bangumiStream" | "liveRoomInfo" | "liveRoomInit" | "qrcodeStatus" | "emojiList" | "loginStatus" | "loginQrcode" | "bvToAv" | "avToBv" | "articleContent" | "articleCards" | "articleInfo" | "articleListInfo" | "videoDanmaku" | "captchaFromVoucher" | "validateCaptcha",>( methodType: T, params: unknown,): output< { videoInfo: ZodType< { methodType: "videoInfo"; bvid: string }, unknown, $ZodTypeInternals<{ methodType: "videoInfo"; bvid: string }, unknown>, >; videoStream: ZodType< { methodType: "videoStream"; avid: number; cid: number }, unknown, $ZodTypeInternals< { methodType: "videoStream"; avid: number; cid: number }, unknown, >, >; comments: ZodType< { methodType: "comments"; type: CommentType; oid: string; number?: number; mode?: 0 | 1 | 2 | 3; pagination_str?: string; plat?: number; seek_rpid?: string; web_location?: string; }, unknown, $ZodTypeInternals< { methodType: "comments"; type: CommentType; oid: string; number?: number; mode?: 0 | 1 | 2 | 3; pagination_str?: string; plat?: number; seek_rpid?: string; web_location?: string; }, unknown, >, >; commentReplies: ZodType< { methodType: "commentReplies"; type: CommentType; oid: string; root: string; number?: number; }, unknown, $ZodTypeInternals< { methodType: "commentReplies"; type: CommentType; oid: string; root: string; number?: number; }, unknown, >, >; userCard: ZodType< { methodType: | "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo"; host_mid: number; }, unknown, $ZodTypeInternals< { methodType: | "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo"; host_mid: number; }, unknown, >, >; userDynamicList: ZodType< { methodType: | "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo"; host_mid: number; }, unknown, $ZodTypeInternals< { methodType: | "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo"; host_mid: number; }, unknown, >, >; userSpaceInfo: ZodType< { methodType: | "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo"; host_mid: number; }, unknown, $ZodTypeInternals< { methodType: | "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo"; host_mid: number; }, unknown, >, >; emojiList: ZodType< { methodType: "emojiList" }, unknown, $ZodTypeInternals<{ methodType: "emojiList" }, unknown>, >; bangumiInfo: ZodType< { methodType: "bangumiInfo"; season_id?: string; ep_id?: string }, unknown, $ZodTypeInternals< { methodType: "bangumiInfo"; season_id?: string; ep_id?: string }, unknown, >, >; bangumiStream: ZodType< { methodType: "bangumiStream"; cid: number; ep_id: string }, unknown, $ZodTypeInternals< { methodType: "bangumiStream"; cid: number; ep_id: string }, unknown, >, >; dynamicDetail: ZodType< { methodType: "dynamicDetail" | "dynamicCard"; dynamic_id: string }, unknown, $ZodTypeInternals< { methodType: "dynamicDetail" | "dynamicCard"; dynamic_id: string }, unknown, >, >; dynamicCard: ZodType< { methodType: "dynamicDetail" | "dynamicCard"; dynamic_id: string }, unknown, $ZodTypeInternals< { methodType: "dynamicDetail" | "dynamicCard"; dynamic_id: string }, unknown, >, >; liveRoomInfo: ZodType< { methodType: "liveRoomInfo" | "liveRoomInit"; room_id: string }, unknown, $ZodTypeInternals< { methodType: "liveRoomInfo" | "liveRoomInit"; room_id: string }, unknown, >, >; liveRoomInit: ZodType< { methodType: "liveRoomInfo" | "liveRoomInit"; room_id: string }, unknown, $ZodTypeInternals< { methodType: "liveRoomInfo" | "liveRoomInit"; room_id: string }, unknown, >, >; loginStatus: ZodType< { methodType: "loginStatus" }, unknown, $ZodTypeInternals<{ methodType: "loginStatus" }, unknown>, >; loginQrcode: ZodType< { methodType: "loginQrcode" }, unknown, $ZodTypeInternals<{ methodType: "loginQrcode" }, unknown>, >; qrcodeStatus: ZodType< { methodType: "qrcodeStatus"; qrcode_key: string }, unknown, $ZodTypeInternals< { methodType: "qrcodeStatus"; qrcode_key: string }, unknown, >, >; uploaderTotalViews: ZodType< { methodType: | "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo"; host_mid: number; }, unknown, $ZodTypeInternals< { methodType: | "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo"; host_mid: number; }, unknown, >, >; avToBv: ZodType< { methodType: "avToBv"; avid: number }, unknown, $ZodTypeInternals<{ methodType: "avToBv"; avid: number }, unknown>, >; bvToAv: ZodType< { methodType: "bvToAv"; bvid: string }, unknown, $ZodTypeInternals<{ methodType: "bvToAv"; bvid: string }, unknown>, >; articleContent: ZodType< { methodType: "articleContent"; id: string }, unknown, $ZodTypeInternals<{ methodType: "articleContent"; id: string }, unknown>, >; articleCards: ZodType< { methodType: "articleCards"; ids: string | string[] }, unknown, $ZodTypeInternals< { methodType: "articleCards"; ids: string | string[] }, unknown, >, >; articleInfo: ZodType< { methodType: "articleInfo"; id: string }, unknown, $ZodTypeInternals<{ methodType: "articleInfo"; id: string }, unknown>, >; articleListInfo: ZodType< { methodType: "articleListInfo"; id: string }, unknown, $ZodTypeInternals<{ methodType: "articleListInfo"; id: string }, unknown>, >; captchaFromVoucher: ZodType< { methodType: "captchaFromVoucher"; csrf?: string; v_voucher: string }, unknown, $ZodTypeInternals< { methodType: "captchaFromVoucher"; csrf?: string; v_voucher: string; }, unknown, >, >; validateCaptcha: ZodType< { methodType: "validateCaptcha"; csrf?: string; challenge: string; token: string; validate: string; seccode: string; }, unknown, $ZodTypeInternals< { methodType: "validateCaptcha"; csrf?: string; challenge: string; token: string; validate: string; seccode: string; }, unknown, >, >; videoDanmaku: ZodType< { methodType: "videoDanmaku"; cid: number; segment_index?: number }, unknown, $ZodTypeInternals< { methodType: "videoDanmaku"; cid: number; segment_index?: number }, unknown, >, >; }[T],> 类型参数
- T extends
| "videoInfo"
| "videoStream"
| "comments"
| "commentReplies"
| "userCard"
| "userDynamicList"
| "uploaderTotalViews"
| "userSpaceInfo"
| "dynamicDetail"
| "dynamicCard"
| "bangumiInfo"
| "bangumiStream"
| "liveRoomInfo"
| "liveRoomInit"
| "qrcodeStatus"
| "emojiList"
| "loginStatus"
| "loginQrcode"
| "bvToAv"
| "avToBv"
| "articleContent"
| "articleCards"
| "articleInfo"
| "articleListInfo"
| "videoDanmaku"
| "captchaFromVoucher"
| "validateCaptcha"
参数
- methodType: T
- params: unknown
返回 output<
{
videoInfo: ZodType<
{ methodType: "videoInfo"; bvid: string },
unknown,
$ZodTypeInternals<{ methodType: "videoInfo"; bvid: string }, unknown>,
>;
videoStream: ZodType<
{ methodType: "videoStream"; avid: number; cid: number },
unknown,
$ZodTypeInternals<
{ methodType: "videoStream"; avid: number; cid: number },
unknown,
>,
>;
comments: ZodType<
{
methodType: "comments";
type: CommentType;
oid: string;
number?: number;
mode?: 0
| 1
| 2
| 3;
pagination_str?: string;
plat?: number;
seek_rpid?: string;
web_location?: string;
},
unknown,
$ZodTypeInternals<
{
methodType: "comments";
type: CommentType;
oid: string;
number?: number;
mode?: 0
| 1
| 2
| 3;
pagination_str?: string;
plat?: number;
seek_rpid?: string;
web_location?: string;
},
unknown,
>,
>;
commentReplies: ZodType<
{
methodType: "commentReplies";
type: CommentType;
oid: string;
root: string;
number?: number;
},
unknown,
$ZodTypeInternals<
{
methodType: "commentReplies";
type: CommentType;
oid: string;
root: string;
number?: number;
},
unknown,
>,
>;
userCard: ZodType<
{
methodType: | "userCard"
| "userDynamicList"
| "uploaderTotalViews"
| "userSpaceInfo";
host_mid: number;
},
unknown,
$ZodTypeInternals<
{
methodType: | "userCard"
| "userDynamicList"
| "uploaderTotalViews"
| "userSpaceInfo";
host_mid: number;
},
unknown,
>,
>;
userDynamicList: ZodType<
{
methodType: | "userCard"
| "userDynamicList"
| "uploaderTotalViews"
| "userSpaceInfo";
host_mid: number;
},
unknown,
$ZodTypeInternals<
{
methodType: | "userCard"
| "userDynamicList"
| "uploaderTotalViews"
| "userSpaceInfo";
host_mid: number;
},
unknown,
>,
>;
userSpaceInfo: ZodType<
{
methodType: | "userCard"
| "userDynamicList"
| "uploaderTotalViews"
| "userSpaceInfo";
host_mid: number;
},
unknown,
$ZodTypeInternals<
{
methodType: | "userCard"
| "userDynamicList"
| "uploaderTotalViews"
| "userSpaceInfo";
host_mid: number;
},
unknown,
>,
>;
emojiList: ZodType<
{ methodType: "emojiList" },
unknown,
$ZodTypeInternals<{ methodType: "emojiList" }, unknown>,
>;
bangumiInfo: ZodType<
{ methodType: "bangumiInfo"; season_id?: string; ep_id?: string },
unknown,
$ZodTypeInternals<
{ methodType: "bangumiInfo"; season_id?: string; ep_id?: string },
unknown,
>,
>;
bangumiStream: ZodType<
{ methodType: "bangumiStream"; cid: number; ep_id: string },
unknown,
$ZodTypeInternals<
{ methodType: "bangumiStream"; cid: number; ep_id: string },
unknown,
>,
>;
dynamicDetail: ZodType<
{ methodType: "dynamicDetail"
| "dynamicCard"; dynamic_id: string },
unknown,
$ZodTypeInternals<
{ methodType: "dynamicDetail"
| "dynamicCard"; dynamic_id: string },
unknown,
>,
>;
dynamicCard: ZodType<
{ methodType: "dynamicDetail"
| "dynamicCard"; dynamic_id: string },
unknown,
$ZodTypeInternals<
{ methodType: "dynamicDetail"
| "dynamicCard"; dynamic_id: string },
unknown,
>,
>;
liveRoomInfo: ZodType<
{ methodType: "liveRoomInfo"
| "liveRoomInit"; room_id: string },
unknown,
$ZodTypeInternals<
{ methodType: "liveRoomInfo"
| "liveRoomInit"; room_id: string },
unknown,
>,
>;
liveRoomInit: ZodType<
{ methodType: "liveRoomInfo"
| "liveRoomInit"; room_id: string },
unknown,
$ZodTypeInternals<
{ methodType: "liveRoomInfo"
| "liveRoomInit"; room_id: string },
unknown,
>,
>;
loginStatus: ZodType<
{ methodType: "loginStatus" },
unknown,
$ZodTypeInternals<{ methodType: "loginStatus" }, unknown>,
>;
loginQrcode: ZodType<
{ methodType: "loginQrcode" },
unknown,
$ZodTypeInternals<{ methodType: "loginQrcode" }, unknown>,
>;
qrcodeStatus: ZodType<
{ methodType: "qrcodeStatus"; qrcode_key: string },
unknown,
$ZodTypeInternals<
{ methodType: "qrcodeStatus"; qrcode_key: string },
unknown,
>,
>;
uploaderTotalViews: ZodType<
{
methodType: | "userCard"
| "userDynamicList"
| "uploaderTotalViews"
| "userSpaceInfo";
host_mid: number;
},
unknown,
$ZodTypeInternals<
{
methodType: | "userCard"
| "userDynamicList"
| "uploaderTotalViews"
| "userSpaceInfo";
host_mid: number;
},
unknown,
>,
>;
avToBv: ZodType<
{ methodType: "avToBv"; avid: number },
unknown,
$ZodTypeInternals<{ methodType: "avToBv"; avid: number }, unknown>,
>;
bvToAv: ZodType<
{ methodType: "bvToAv"; bvid: string },
unknown,
$ZodTypeInternals<{ methodType: "bvToAv"; bvid: string }, unknown>,
>;
articleContent: ZodType<
{ methodType: "articleContent"; id: string },
unknown,
$ZodTypeInternals<{ methodType: "articleContent"; id: string }, unknown>,
>;
articleCards: ZodType<
{ methodType: "articleCards"; ids: string
| string[] },
unknown,
$ZodTypeInternals<
{ methodType: "articleCards"; ids: string
| string[] },
unknown,
>,
>;
articleInfo: ZodType<
{ methodType: "articleInfo"; id: string },
unknown,
$ZodTypeInternals<{ methodType: "articleInfo"; id: string }, unknown>,
>;
articleListInfo: ZodType<
{ methodType: "articleListInfo"; id: string },
unknown,
$ZodTypeInternals<{ methodType: "articleListInfo"; id: string }, unknown>,
>;
captchaFromVoucher: ZodType<
{ methodType: "captchaFromVoucher"; csrf?: string; v_voucher: string },
unknown,
$ZodTypeInternals<
{
methodType: "captchaFromVoucher";
csrf?: string;
v_voucher: string;
},
unknown,
>,
>;
validateCaptcha: ZodType<
{
methodType: "validateCaptcha";
csrf?: string;
challenge: string;
token: string;
validate: string;
seccode: string;
},
unknown,
$ZodTypeInternals<
{
methodType: "validateCaptcha";
csrf?: string;
challenge: string;
token: string;
validate: string;
seccode: string;
},
unknown,
>,
>;
videoDanmaku: ZodType<
{ methodType: "videoDanmaku"; cid: number; segment_index?: number },
unknown,
$ZodTypeInternals<
{ methodType: "videoDanmaku"; cid: number; segment_index?: number },
unknown,
>,
>;
}[T],
>
验证后的参数,符合原始API期望的类型
验证哔哩哔哩参数