Amagi API 文档 - v5.13.0
    正在准备搜索索引...

    接口 BilibiliMethodOptionsMap

    B站 API 方法参数映射接口

    每个键对应一种 API 方法,值为该方法所需的参数接口

    interface BilibiliMethodOptionsMap {
        VideoInfoParams: { methodType: "videoInfo"; bvid: string };
        VideoStreamParams: { methodType: "videoStream"; avid: number; cid: number };
        CommentParams: {
            methodType: "comments";
            type: CommentType;
            oid: string;
            number?: number;
            mode?: 0 | 1 | 2 | 3;
            pagination_str?: string;
            plat?: number;
            seek_rpid?: string;
            web_location?: string;
        };
        CommentReplyParams: {
            methodType: "commentReplies";
            type: CommentType;
            oid: string;
            root: string;
            number?: number;
        };
        UserParams: {
            methodType: | "userCard"
            | "userDynamicList"
            | "uploaderTotalViews"
            | "userSpaceInfo";
            host_mid: number;
        };
        DynamicParams: {
            methodType: "dynamicDetail"
            | "dynamicCard";
            dynamic_id: string;
        };
        BangumiInfoParams: {
            methodType: "bangumiInfo";
            season_id?: string;
            ep_id?: string;
        };
        BangumiStreamParams: {
            methodType: "bangumiStream";
            cid: number;
            ep_id: string;
        };
        LiveRoomParams: {
            methodType: "liveRoomInfo"
            | "liveRoomInit";
            room_id: string;
        };
        QrcodeParams: { methodType: "qrcodeStatus"; qrcode_key: string };
        EmojiParams: { methodType: "emojiList" };
        LoginBaseInfoParams: { methodType: "loginStatus" };
        GetQrcodeParams: { methodType: "loginQrcode" };
        Bv2AvParams: { methodType: "bvToAv"; bvid: string };
        Av2BvParams: { methodType: "avToBv"; avid: number };
        ArticleParams: { methodType: "articleContent"; id: string };
        ArticleCardParams: { methodType: "articleCards"; ids: string | string[] };
        ArticleInfoParams: { methodType: "articleInfo"; id: string };
        ColumnInfoParams: { methodType: "articleListInfo"; id: string };
        DanmakuParams: {
            methodType: "videoDanmaku";
            cid: number;
            segment_index?: number;
        };
        ApplyVoucherCaptchaParams: {
            methodType: "captchaFromVoucher";
            csrf?: string;
            v_voucher: string;
        };
        ValidateCaptchaParams: {
            methodType: "validateCaptcha";
            csrf?: string;
            challenge: string;
            token: string;
            validate: string;
            seccode: string;
        };
    }
    索引

    属性

    VideoInfoParams: { methodType: "videoInfo"; bvid: string }

    获取单个视频信息

    类型声明

    • methodType: "videoInfo"
    • bvid: string

      稿件BVID

    VideoStreamParams: { methodType: "videoStream"; avid: number; cid: number }

    获取视频流下载信息

    类型声明

    • methodType: "videoStream"
    • avid: number

      稿件AVID

    • cid: number

      稿件cid

    CommentParams: {
        methodType: "comments";
        type: CommentType;
        oid: string;
        number?: number;
        mode?: 0 | 1 | 2 | 3;
        pagination_str?: string;
        plat?: number;
        seek_rpid?: string;
        web_location?: string;
    }

    获取评论数据

    类型声明

    • methodType: "comments"
    • type: CommentType

      评论区类型代码,详见 评论区类型代码

    • oid: string

      稿件ID,也就是AV号去除前缀后的内容

    • 可选number?: number

      获取的评论数量,默认20

      20
      
    • 可选mode?: 0 | 1 | 2 | 3

      排序方式 默认为3 0和3: 仅热度 1: 按热度+按时间 2: 仅时间

      3
      
    • 可选pagination_str?: string

      翻页信息,用于懒加载分页 首次请求时不传,后续请求使用上次响应中的 data.cursor.pagination_reply.next_offset

    • 可选plat?: number

      平台类型

      1
      
    • 可选seek_rpid?: string

      当获取第一页评论时存在

    • 可选web_location?: string

      web位置参数

      1315875
      
    CommentReplyParams: {
        methodType: "commentReplies";
        type: CommentType;
        oid: string;
        root: string;
        number?: number;
    }

    获取指定评论的回复

    类型声明

    • methodType: "commentReplies"
    • type: CommentType

      评论区类型代码,详见 评论区类型代码

    • oid: string

      目标评论区 ID,也就是AV号去除前缀后的内容

    • root: string

      根评论ID

    • 可选number?: number

      获取的评论数量,默认20

      20
      
    UserParams: {
        methodType:
            | "userCard"
            | "userDynamicList"
            | "uploaderTotalViews"
            | "userSpaceInfo";
        host_mid: number;
    }

    获取用户相关数据

    类型声明

    • methodType: "userCard" | "userDynamicList" | "uploaderTotalViews" | "userSpaceInfo"
    • host_mid: number

      UP主UID

    DynamicParams: {
        methodType: "dynamicDetail" | "dynamicCard";
        dynamic_id: string;
    }

    获取动态数据

    类型声明

    • methodType: "dynamicDetail" | "dynamicCard"
    • dynamic_id: string

      动态ID

    BangumiInfoParams: {
        methodType: "bangumiInfo";
        season_id?: string;
        ep_id?: string;
    }

    获取番剧基本信息

    类型声明

    BangumiStreamParams: { methodType: "bangumiStream"; cid: number; ep_id: string }

    获取番剧视频流信息

    类型声明

    LiveRoomParams: { methodType: "liveRoomInfo" | "liveRoomInit"; room_id: string }

    获取直播间信息

    类型声明

    • methodType: "liveRoomInfo" | "liveRoomInit"
    • room_id: string

      直播间ID

    QrcodeParams: { methodType: "qrcodeStatus"; qrcode_key: string }

    查询二维码状态

    类型声明

    • methodType: "qrcodeStatus"
    • qrcode_key: string

      扫码登录秘钥

    EmojiParams: { methodType: "emojiList" }

    获取表情列表

    LoginBaseInfoParams: { methodType: "loginStatus" }

    获取登录基本信息

    GetQrcodeParams: { methodType: "loginQrcode" }

    申请登录二维码

    Bv2AvParams: { methodType: "bvToAv"; bvid: string }

    BV号转AV号

    类型声明

    • methodType: "bvToAv"
    • bvid: string

      视频BV号

    Av2BvParams: { methodType: "avToBv"; avid: number }

    AV号转BV号

    类型声明

    • methodType: "avToBv"
    • avid: number

      视频AV号

    ArticleParams: { methodType: "articleContent"; id: string }

    获取专栏正文内容

    ArticleCardParams: { methodType: "articleCards"; ids: string | string[] }

    获取专栏显示卡片信息

    类型声明

    ArticleInfoParams: { methodType: "articleInfo"; id: string }

    获取专栏文章基本信息

    ColumnInfoParams: { methodType: "articleListInfo"; id: string }

    获取文集基本信息

    DanmakuParams: {
        methodType: "videoDanmaku";
        cid: number;
        segment_index?: number;
    }

    获取实时弹幕

    类型声明

    • methodType: "videoDanmaku"
    • cid: number

      稿件cid

    • 可选segment_index?: number

      分段序号(从1开始),每6分钟为一段

      1
      
    ApplyVoucherCaptchaParams: {
        methodType: "captchaFromVoucher";
        csrf?: string;
        v_voucher: string;
    }

    从 v_voucher 申请验证码

    类型声明

    • methodType: "captchaFromVoucher"
    • 可选csrf?: string

      CSRF Token (位于 Cookie 的 bili_jct)

    • v_voucher: string

      结构为字符串 voucher_ 尾随一串以 - 为分隔符的小写 UUID

    ValidateCaptchaParams: {
        methodType: "validateCaptcha";
        csrf?: string;
        challenge: string;
        token: string;
        validate: string;
        seccode: string;
    }

    验证验证码结果

    类型声明

    • methodType: "validateCaptcha"
    • 可选csrf?: string

      CSRF Token (位于 Cookie 的 bili_jct)

    • challenge: string

      极验3 https://www.geetest.com 的验证码 challenge

    • token: string

      验证码 token

    • validate: string

      人机验证成功后的 validate 参数

    • seccode: string

      人机验证成功后的 seccode 参数,{validate}|jordan