1
0
mirror of https://github.com/wbt5/real-url.git synced 2025-07-28 03:20:31 +08:00

🐛 修复企鹅电竞弹幕

修复:企鹅电竞弹幕解包时,有一类消息type属性为空时导致判断出错的问题。
This commit is contained in:
wbt5 2021-07-05 00:12:48 +08:00
parent 750ce90471
commit 9caecc1cf5
No known key found for this signature in database
GPG Key ID: 92D5C42E815A2BD6

View File

@ -51,7 +51,8 @@ class eGame:
if body:
bin_datas = body['bin_data']
for bin_data in bin_datas:
if bin_data['type'] in (0, 3, 9):
# if bin_data['type'] in (0, 3, 9):
if bin_data.get('type', '') in (0, 3, 9):
msg['name'] = bin_data['nick']
msg['content'] = bin_data['content']
msg['msg_type'] = 'danmaku'
@ -230,6 +231,8 @@ class MessageDecode:
value, position = self.f9(i, s_position)
elif type == 12:
value, position = self.f12(i, s_position)
elif type == 13:
value, position = self.f13(i, s_position)
i = ''