xfgryujk / blivedm

获取bilibili直播弹幕,使用WebSocket协议,支持web端和B站直播开放平台两种接口
MIT License
1.05k stars 225 forks source link

新增@弹幕(web) #56

Closed okashi-ya closed 4 months ago

okashi-ya commented 4 months ago

@弹幕功能

完整CMD如下(仅web,开放平台还没试过): {'cmd': 'DANMU_MSG', 'dm_v2': '', 'info': [[0, 1, 25, 5566168, 1719239945209, 1263391853, 0, 'f8f8cf6e', 0, 0, 0, '', 0, '{}', '{}', {'extra': '{"send_from_me":false,"mode":0,"color":5566168,"dm_type":0,"font_size":25,"player_mode":1,"show_player_type":0,"content":"testtest","user_hash":"4177055598","emoticon_unique":"","bulge_display":0,"recommend_score":5,"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":null,"is_audited":false,"id_str":"31f924b408b25a9623b43a100e66798590","icon":null,"show_reply":true,"reply_mid":3493146323323311,"reply_uname":"816个114514","reply_uname_color":"#FB7299","reply_is_mystery":false,"hit_combo":0}', 'mode': 0, 'show_player_type': 0, 'user': {'base': {'face': 'https://i1.hdslb.com/bfs/face/6c6c3f3e6f43d6118c0e23e1b4fa92da638c0dfa.jpg', 'is_mystery': False, 'name': '星熊uru的熊熊小窝', 'name_color': 0, 'name_color_str': '', 'official_info': {'desc': '', 'role': 0, 'title': '', 'type': -1}, 'origin_info': {'face': 'https://i1.hdslb.com/bfs/face/6c6c3f3e6f43d6118c0e23e1b4fa92da638c0dfa.jpg', 'name': '星熊uru的熊熊小窝'}, 'risk_ctrl_info': None}, 'guard': None, 'guard_leader': {'is_guard_leader': False}, 'medal': {'color': 1725515, 'color_border': 12632256, 'color_end': 12632256, 'color_start': 12632256, 'guard_icon': '', 'guard_level': 0, 'honor_icon': '', 'id': 1075808, 'is_light': 0, 'level': 21, 'name': '星星熊', 'ruid': 3493105972021270, 'score': 50001380, 'typ': 0, 'user_receive_count': 0, 'v2_medal_color_border': '#919298CC', 'v2_medal_color_end': '#919298CC', 'v2_medal_color_level': '#6C6C7299', 'v2_medal_color_start': '#919298CC', 'v2_medal_color_text': '#FFFFFFFF'}, 'title': {'old_title_css_id': '', 'title_css_id': ''}, 'uhead_frame': None, 'uid': 3493270189508953, 'wealth': None}}, {'activity_identity': '', 'activity_source': 0, 'not_show': 0}, 0], 'testtest', [3493270189508953, '星熊uru的熊熊小窝', 0, 0, 0, 10000, 1, ''], [21, '星星熊', '星熊uru', 27016766, 1725515, '', 0, 12632256, 12632256, 12632256, 0, 0, 3493105972021270], [5, 0, 9868950, '>50000', 0], ['', ''], 0, 0, None, {'ct': '9D5648BA', 'ts': 1719239945}, 0, 0, None, None, 0, 108, [0], None]}

info[0][15]["extra"]的内容是一个完整且一直存在的json字符串 reply_uname字段无论登录与否,@与否,均是一个已有的字段

xfgryujk commented 4 months ago

需要的可以自己解析mode_info,没必要加在这里