mirror of
https://github.com/xfgryujk/blivechat.git
synced 2025-03-28 21:10:49 +08:00
降级身份码错误的日志
This commit is contained in:
parent
ef7f0dc0ac
commit
dccb3fc890
@ -67,7 +67,7 @@ async def _request_open_live(url, body: dict) -> dict:
|
||||
cfg = config.get_config()
|
||||
assert cfg.is_open_live_configured
|
||||
|
||||
# 输错身份码的人太多了,临时处理屏蔽请求,不然要被B站下架了
|
||||
# 输错身份码的人太多了,屏蔽掉明显错误的请求,防止B站抱怨
|
||||
if url == START_GAME_OPEN_LIVE_URL:
|
||||
auth_code = body.get('code', '')
|
||||
_validate_auth_code(auth_code)
|
||||
@ -125,7 +125,7 @@ async def _read_response(req_ctx_mgr: AsyncContextManager[aiohttp.ClientResponse
|
||||
def _validate_auth_code(auth_code):
|
||||
if (
|
||||
auth_code in _error_auth_code_cache
|
||||
# 我也不知道是不是一定是这个格式,先临时这么处理
|
||||
# 我也不知道是不是一定是这个格式,先这么处理
|
||||
or not re.fullmatch(r'[0-9A-Z]{12,14}', auth_code)
|
||||
):
|
||||
raise BusinessError({
|
||||
@ -206,7 +206,7 @@ class _StartGameMixin(_OpenLiveHandlerBase):
|
||||
if code == 7007:
|
||||
# 身份码错误
|
||||
# 让我看看是哪个混蛋把房间ID、UID当做身份码
|
||||
logger.warning('Auth code error! auth_code=%s', self.json_args.get('code', None))
|
||||
logger.info('Auth code error! auth_code=%s', self.json_args.get('code', None))
|
||||
|
||||
|
||||
class StartGamePublicHandler(_StartGameMixin, _PublicHandlerBase):
|
||||
|
@ -187,7 +187,7 @@ class OpenLiveClient(blivedm.OpenLiveClient):
|
||||
if e.code == 7007:
|
||||
# 身份码错误
|
||||
# 让我看看是哪个混蛋把房间ID、UID当做身份码
|
||||
logger.warning('Auth code error! auth_code=%s', self._room_owner_auth_code)
|
||||
logger.info('Auth code error! auth_code=%s', self._room_owner_auth_code)
|
||||
room = client_room_manager.get_room(self.room_key)
|
||||
if room is not None:
|
||||
room.send_cmd_data(api.chat.Command.FATAL_ERROR, {
|
||||
|
Loading…
Reference in New Issue
Block a user