mirror of
https://github.com/xfgryujk/blivechat.git
synced 2024-12-28 05:40:19 +08:00
更新版本号
This commit is contained in:
parent
e93f6b2383
commit
8d40f9f9e5
@ -9,7 +9,7 @@
|
|||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
<div class="version">
|
<div class="version">
|
||||||
v1.2.3
|
v1.2.4
|
||||||
</div>
|
</div>
|
||||||
<sidebar></sidebar>
|
<sidebar></sidebar>
|
||||||
</el-aside>
|
</el-aside>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
|
|
||||||
VERSION = 'v1.2.3'
|
VERSION = 'v1.2.4'
|
||||||
|
|
||||||
|
|
||||||
async def check_update():
|
async def check_update():
|
||||||
|
@ -96,15 +96,16 @@ async def _fetch_avatar_loop():
|
|||||||
asyncio.ensure_future(_fetch_avatar_loop())
|
asyncio.ensure_future(_fetch_avatar_loop())
|
||||||
|
|
||||||
|
|
||||||
|
class Room(blivedm.BLiveClient):
|
||||||
# 重新定义parse_XXX是为了减少对字段名的依赖,防止B站改字段名
|
# 重新定义parse_XXX是为了减少对字段名的依赖,防止B站改字段名
|
||||||
def _parse_danmaku(client: blivedm.BLiveClient, command):
|
def __parse_danmaku(self, command):
|
||||||
info = command['info']
|
info = command['info']
|
||||||
if info[3]:
|
if info[3]:
|
||||||
room_id = info[3][3]
|
room_id = info[3][3]
|
||||||
medal_level = info[3][0]
|
medal_level = info[3][0]
|
||||||
else:
|
else:
|
||||||
room_id = medal_level = 0
|
room_id = medal_level = 0
|
||||||
return client._on_receive_danmaku(blivedm.DanmakuMessage(
|
return self._on_receive_danmaku(blivedm.DanmakuMessage(
|
||||||
None, None, None, info[0][4], None, None, info[0][9], None,
|
None, None, None, info[0][4], None, None, info[0][9], None,
|
||||||
info[1],
|
info[1],
|
||||||
info[2][0], info[2][1], info[2][2], None, None, info[2][5], info[2][6], None,
|
info[2][0], info[2][1], info[2][2], None, None, info[2][5], info[2][6], None,
|
||||||
@ -114,27 +115,24 @@ def _parse_danmaku(client: blivedm.BLiveClient, command):
|
|||||||
info[7]
|
info[7]
|
||||||
))
|
))
|
||||||
|
|
||||||
|
def __parse_gift(self, command):
|
||||||
def _parse_gift(client: blivedm.BLiveClient, command):
|
|
||||||
data = command['data']
|
data = command['data']
|
||||||
return client._on_receive_gift(blivedm.GiftMessage(
|
return self._on_receive_gift(blivedm.GiftMessage(
|
||||||
data['giftName'], data['num'], data['uname'], data['face'], None,
|
data['giftName'], data['num'], data['uname'], data['face'], None,
|
||||||
None, data['timestamp'], None, None,
|
None, data['timestamp'], None, None,
|
||||||
None, None, None, data['coin_type'], data['total_coin']
|
None, None, None, data['coin_type'], data['total_coin']
|
||||||
))
|
))
|
||||||
|
|
||||||
|
def __parse_buy_guard(self, command):
|
||||||
def _parse_buy_guard(client: blivedm.BLiveClient, command):
|
|
||||||
data = command['data']
|
data = command['data']
|
||||||
return client._on_buy_guard(blivedm.GuardBuyMessage(
|
return self._on_buy_guard(blivedm.GuardBuyMessage(
|
||||||
data['uid'], data['username'], None, None, None,
|
data['uid'], data['username'], None, None, None,
|
||||||
None, None, data['start_time'], None
|
None, None, data['start_time'], None
|
||||||
))
|
))
|
||||||
|
|
||||||
|
def __parse_super_chat(self, command):
|
||||||
def _parse_super_chat(client: blivedm.BLiveClient, command):
|
|
||||||
data = command['data']
|
data = command['data']
|
||||||
return client._on_super_chat(blivedm.SuperChatMessage(
|
return self._on_super_chat(blivedm.SuperChatMessage(
|
||||||
data['price'], data['message'], None, data['start_time'],
|
data['price'], data['message'], None, data['start_time'],
|
||||||
None, None, data['id'], None,
|
None, None, data['id'], None,
|
||||||
None, None, data['user_info']['uname'],
|
None, None, data['user_info']['uname'],
|
||||||
@ -144,14 +142,12 @@ def _parse_super_chat(client: blivedm.BLiveClient, command):
|
|||||||
None
|
None
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
class Room(blivedm.BLiveClient):
|
|
||||||
_COMMAND_HANDLERS = {
|
_COMMAND_HANDLERS = {
|
||||||
**blivedm.BLiveClient._COMMAND_HANDLERS,
|
**blivedm.BLiveClient._COMMAND_HANDLERS,
|
||||||
'DANMU_MSG': _parse_danmaku,
|
'DANMU_MSG': __parse_danmaku,
|
||||||
'SEND_GIFT': _parse_gift,
|
'SEND_GIFT': __parse_gift,
|
||||||
'GUARD_BUY': _parse_buy_guard,
|
'GUARD_BUY': __parse_buy_guard,
|
||||||
'SUPER_CHAT_MESSAGE': _parse_super_chat
|
'SUPER_CHAT_MESSAGE': __parse_super_chat
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, room_id):
|
def __init__(self, room_id):
|
||||||
|
Loading…
Reference in New Issue
Block a user