SocialSisterYi / bilibili-API-collect

哔哩哔哩-API收集整理【不断更新中....】
https://socialsisteryi.github.io/bilibili-API-collect/
Other
15.27k stars 1.73k forks source link

[新增/更新请求] 对于```INTERACT_WORD```事件的补充 #1100

Open yandujun363 opened 2 months ago

yandujun363 commented 2 months ago

提交前请确认

API 来源

Web 端(含 h5)

API 类型

长连接数据帧(含 ws、TCP)

API 地址

https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/live/message_stream.md#%E8%BF%9B%E5%9C%BA%E6%88%96%E5%85%B3%E6%B3%A8%E6%B6%88%E6%81%AF

详情描述

对于INTERACT_WORD事件的补充早就知道了只是懒得更新

个人猜测+抓包+机翻键名,不一定准确,带问号为不确定
为了方便定位值的路径把根对象定义为JSON
10进制颜色代码转16进制,把JSON.info[0][15].user.medal.color_start替换为要转换的值的路径

"#"+JSON.info[0][15].user.medal.color_start.toString(16).padStart(6,"0") //假如输入为3111,那么输出为#000C27
{
    "cmd": "INTERACT_WORD",
    "data": {
        "contribution": {
            "grade": 0
        },
        "contribution_v2": {
            "grade": 0,
            "rank_type": "",
            "text": ""
        },
        "core_user_type": 0,
        "dmscore": 3,
        "fans_medal": null,
        "group_medal": null,
        "identities": [
            1
        ],
        "is_mystery": false,
        "is_spread": 0,
        "msg_type": 1,//事件类型,1为进场,2为关注
        "privilege_type": 0,
        "relation_tail": {
            "tail_guide_text": "曾经活跃过,近期与你互动较少",
            "tail_icon": "https://i0.hdslb.com/bfs/live/bb88734558c6383a4cfb5fa16c9749d5290d95e8.png",
            "tail_type": 4
        },
        "roomid": 26906753,//直播间号(不知道是不是长号)
        "score": 1726490026997,
        "spread_desc": "",
        "spread_info": "",
        "tail_icon": 0,
        "tail_text": "",
        "timestamp": 1726490026,//时间戳(秒级)
        "trigger_time": 1726490025771742000,//时间戳(纳秒级)
        "uid": 183503724,//用户uid
        "uinfo": {//用户信息
            "base": {
                "face": "http://i0.hdslb.com/bfs/face/9739b7c33460b631b1cee9a15e765e2afd1c8cc9.jpg",//用户头像
                "is_mystery": false,
                "name": "寻觅花灯",//用户名称
                "name_color": 0,//用户名称颜色(10进制(?))
                "name_color_str": "",//用户名称颜色(css颜色代码(?))
                "official_info": null,
                "origin_info": null,
                "risk_ctrl_info": null
            },
            "guard": {
                "expired_str": "",
                "level": 0
            },
            "guard_leader": null,
            "medal": {//牌子信息(无牌子为null,原始数据是null,为了解释放了一段上去)
                        "color": //粉丝牌颜色(10进制)#2d0855
                        "color_border": //粉丝牌边框颜色(10进制)#ffe854
                        "color_end": //粉丝牌渐变颜色结束(10进制)#9d9bff
                        "color_start": //粉丝牌渐变颜色开始(10进制)#2d0855
                        "guard_icon": "https://i0.hdslb.com/bfs/live/1d16bf0fcc3b1b768d1179d60f1fdbabe6ab4489.png",//舰长、提督、总督图标(无为空)
                        "guard_level": 1,//类型 1.总督 2.提督 3,舰长
                        "honor_icon": "",
                        "id": 1279130,
                        "is_light": 1,
                        "level": 29,//粉丝牌等级
                        "name": "果咩吖",//粉丝牌名称
                        "ruid": 3546569288714792,//粉丝牌创建者UID
                        "score": 50427312,
                        "typ": 0,
                        "user_receive_count": 0,
                        "v2_medal_color_border": "#D47AFFFF",//粉丝牌边框颜色(APP)
                        "v2_medal_color_end": "#9660E5CC",//粉丝牌渐变颜色结束(APP)
                        "v2_medal_color_level": "#6C00A099",//粉丝牌右边等级数字颜色(APP)
                        "v2_medal_color_start": "#9660E5CC",//粉丝牌渐变颜色开始(APP)
                        "v2_medal_color_text": "#FFFFFFFF"//弹幕颜色(APP(?))
                    },,
            "title": null,
            "uhead_frame": null,
            "uid": 183503724,//同JSON.data.uid
            "wealth": {
                "dm_icon_key": "",
                "level": 6
            }
        },
        "uname": "寻觅花灯",//同JSON.data.uinfo.base.name
        "uname_color": ""//用户名称颜色(?)
    }
}