mirror of
https://github.com/xfgryujk/blivedm.git
synced 2025-02-07 10:10:49 +08:00
添加HTTP请求超时
This commit is contained in:
parent
7b50f1ea9c
commit
4669b2c1c9
@ -361,7 +361,7 @@ class BLiveClient:
|
|||||||
self._future = None
|
self._future = None
|
||||||
|
|
||||||
if session is None:
|
if session is None:
|
||||||
self._session = aiohttp.ClientSession(loop=self._loop)
|
self._session = aiohttp.ClientSession(loop=self._loop, timeout=aiohttp.ClientTimeout(total=10))
|
||||||
self._own_session = True
|
self._own_session = True
|
||||||
else:
|
else:
|
||||||
self._session = session
|
self._session = session
|
||||||
@ -469,7 +469,7 @@ class BLiveClient:
|
|||||||
return False
|
return False
|
||||||
if not self._parse_room_init(data['data']):
|
if not self._parse_room_init(data['data']):
|
||||||
return False
|
return False
|
||||||
except aiohttp.ClientConnectionError:
|
except (aiohttp.ClientConnectionError, asyncio.TimeoutError):
|
||||||
logger.exception('room %d init_room失败:', self._tmp_room_id)
|
logger.exception('room %d init_room失败:', self._tmp_room_id)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
@ -495,7 +495,7 @@ class BLiveClient:
|
|||||||
return False
|
return False
|
||||||
if not self._parse_danmaku_server_conf(data['data']):
|
if not self._parse_danmaku_server_conf(data['data']):
|
||||||
return False
|
return False
|
||||||
except aiohttp.ClientConnectionError:
|
except (aiohttp.ClientConnectionError, asyncio.TimeoutError):
|
||||||
logger.exception('room %d getConf失败:', self._room_id)
|
logger.exception('room %d getConf失败:', self._room_id)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user