We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web 端(含 h5)
长连接数据帧(含 ws、TCP)
https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/live/message_stream.md#%E5%BC%B9%E5%B9%95
对于DANMU_MSG事件数据的补充 个人猜测+抓包+机翻键名,不一定准确
DANMU_MSG
{ "cmd": "DANMU_MSG", "dm_v2": "", "info": [ [ 0, 1, 25,//字体大小 9920249,//弹幕颜色代码(10进制)#975ef9 1723979200649, -1312973962, 0, "0bc8acd0", 0, 0, 0, "", 0, "{}", "{}", { "extra": "{\"send_from_me\":false,\"mode\":0,\"color\":9920249,\"dm_type\":0,\"font_size\":25,\"player_mode\":1,\"show_player_type\":0,\"content\":\"白花300块[热]\",\"user_hash\":\"197700816\",\"emoticon_unique\":\"\",\"bulge_display\":0,\"recommend_score\":3,\"main_state_dm_color\":\"\",\"objective_state_dm_color\":\"\",\"direction\":0,\"pk_direction\":0,\"quartet_direction\":0,\"anniversary_crowd\":0,\"yeah_space_type\":\"\",\"yeah_space_url\":\"\",\"jump_to_url\":\"\",\"space_type\":\"\",\"space_url\":\"\",\"animation\":{},\"emots\":{\"[热]\":{\"count\":1,\"descript\":\"[热]\",\"emoji\":\"[热]\",\"emoticon_id\":278,\"emoticon_unique\":\"emoji_278\",\"height\":20,\"url\":\"http://i0.hdslb.com/bfs/live/6df760280b17a6cbac8c1874d357298f982ba4cf.png\",\"width\":20}},\"is_audited\":false,\"id_str\":\"364b06e3c561af3d5921f1253d66c1d575\",\"icon\":{\"prefix\":{\"type\":1,\"resource\":\"ChronosWealth_4.png\"}},\"show_reply\":true,\"reply_mid\":0,\"reply_uname\":\"\",\"reply_uname_color\":\"\",\"reply_is_mystery\":false,\"hit_combo\":0}", "mode": 0, "show_player_type": 0, "user": { "base": { "face": "https://i1.hdslb.com/bfs/face/5a9bb9cac3afbb58347c808ae76aaa41ca967d07.jpg",//弹幕发送用户头像 "is_mystery": false, "name": "tim1997",//弹幕发送用户名称 "name_color": 0, "name_color_str": "", "official_info": { "desc": "", "role": 0, "title": "", "type": -1 }, "origin_info": { "face": "https://i1.hdslb.com/bfs/face/5a9bb9cac3afbb58347c808ae76aaa41ca967d07.jpg", "name": "tim1997" }, "risk_ctrl_info": null }, "guard": null, "guard_leader": { "is_guard_leader": false }, "medal": { "color": 2951253,//粉丝牌颜色(10进制)#2d0855 "color_border": 16771156,//粉丝牌边框颜色(10进制)#ffe854 "color_end": 10329087,//粉丝牌渐变颜色结束(10进制)#9d9bff "color_start": 2951253,//粉丝牌渐变颜色开始(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": { "old_title_css_id": "", "title_css_id": "" }, "uhead_frame": null, "uid": 6088969,//弹幕发送用户UID "wealth": null } }, { "activity_identity": "", "activity_source": 0, "not_show": 0 }, 0 ], "白花300块[热]",//弹幕内容 [ 6088969,//同info[0][15].user.uid "tim1997",//同info[0][15].user.base.name 0, 0, 0, 10000, 1, "" ], [ 29,//同info[0][15].user.medal.level "果咩吖",//同info[0][15].user.medal.name "果宝Official",//粉丝牌创建主播名称 31180317, 2951253,//同info[0][15].user.medal.color "", 0, 16771156,//同info[0][15].user.medal.color_border 2951253,//同info[0][15].user.medal.color_start 10329087,//同info[0][15].user.medal.color_end 1,//同info[0][15].user.medal.guard_level 1,//同info[0][15].user.medal.is_light 3546569288714792//同info[0][15].user.medal.ruid ], [ 39, 0, 10512625, 42523, 2 ], [ "", "" ], 0, 0, null, { "ct": "AFFF4206", "ts": 1723979200//时间戳(秒级) }, 0, 0, null, null, 0, 1040, [ 49 ], null ] }
The text was updated successfully, but these errors were encountered:
勘误 10进制颜色应转为以下格式
//9920249 -> rgb(99,202,49) //2951253 -> rgb(29,51,253) //其它同理
Sorry, something went wrong.
勘误 10进制颜色应转为以下格式 //9920249 -> rgb(99,202,49) //2951253 -> rgb(29,51,253) //其它同理
我测试了一下,这个10进制颜色还是搞不明白,先用16进制的代替吧
勘误 10进制颜色应转为以下格式 //9920249 -> rgb(99,202,49) //2951253 -> rgb(29,51,253) //其它同理 我测试了一下,这个10进制颜色还是搞不明白,先用16进制的代替吧
搞明白了原来是我没补齐位数
color_start = "#"+JSON.info[0][15].user.medal.color_start.toString(16).padStart(6,"0") //假如输入为3111,那么输出为#000C27
感谢贡献 🙏
最近发现发送的弹幕内容如果包含html标签,获取的数据不会对标签进行转义,请注意防范XSS攻击
No branches or pull requests
提交前请确认
API 来源
Web 端(含 h5)
API 类型
长连接数据帧(含 ws、TCP)
API 地址
https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/live/message_stream.md#%E5%BC%B9%E5%B9%95
详情描述
对于
DANMU_MSG
事件数据的补充个人猜测+抓包+机翻键名,不一定准确
The text was updated successfully, but these errors were encountered: