Skip to content

Commit

Permalink
fix: send_msg
Browse files Browse the repository at this point in the history
  • Loading branch information
lumina37 committed Feb 4, 2023
1 parent d7c82ce commit 6ef9bd8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion aiotieba/client/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2064,7 +2064,7 @@ async def send_msg(self, _id: Union[str, int], content: str) -> bool:
from . import send_msg

proto = send_msg.pack_proto(user_id, content, self.websocket._record_id)
body = await self.websocket.send(proto, send_msg.CMD, encrypt=False, timeout=5.0)
body = await self.websocket.send(proto, send_msg.CMD, timeout=5.0)
send_msg.parse_body(body)

except Exception as err:
Expand Down
2 changes: 1 addition & 1 deletion aiotieba/client/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def aes_ecb_chiper(self):

if self._aes_ecb_chiper is None:
salt = b'\xa4\x0b\xc8\x34\xd6\x95\xf3\x13'
ws_secret_key = hashlib.pbkdf2_hmac('sha1', b"0123456789abcdefghyjklmnopqrstu", salt, 5, 32)
ws_secret_key = hashlib.pbkdf2_hmac('sha1', self.aes_ecb_sec_key, salt, 5, 32)
self._aes_ecb_chiper = AES.new(ws_secret_key, AES.MODE_ECB)

return self._aes_ecb_chiper
Expand Down
2 changes: 1 addition & 1 deletion aiotieba/client/_websocket/_classdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ async def send(
_REQ_ID += 1
req_id = _REQ_ID

req_data = pack_ws_bytes(self._core, data, cmd, req_id, compress, encrypt)
req_data = pack_ws_bytes(self._core, data, cmd, req_id, compress=compress, encrypt=encrypt)

res_future = asyncio.Future()
self._res_waiter[req_id] = res_future
Expand Down
2 changes: 1 addition & 1 deletion aiotieba/client/_websocket/_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


def pack_ws_bytes(
core: TbCore, data: bytes, cmd: int, req_id: int, compress: bool = False, encrypt: bool = True
core: TbCore, data: bytes, cmd: int, req_id: int, *, compress: bool = False, encrypt: bool = True
) -> bytes:
"""
打包数据并添加9字节头部
Expand Down

0 comments on commit 6ef9bd8

Please sign in to comment.