mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-05 19:36:43 +08:00
fixup! feat: add temp client for bilibili
fix bug
This commit is contained in:
parent
0a4fd60e7a
commit
88e3d4de12
@ -21,8 +21,11 @@ class _BilibiliClient:
|
||||
|
||||
async def _init_session(self):
|
||||
self._http_client = httpx.AsyncClient(**http_args)
|
||||
res = await self._http_client.get("https://bilibili.com")
|
||||
res = await self._http_client.get("https://www.bilibili.com/")
|
||||
if res.status_code != 200:
|
||||
import ipdb
|
||||
|
||||
ipdb.set_trace()
|
||||
logger.warning("unable to refresh temp cookie")
|
||||
else:
|
||||
self._client_refresh_time = datetime.now()
|
||||
|
@ -27,7 +27,7 @@ async def test_fetch_bilibili_live_status(bili_live, dummy_user_subinfo):
|
||||
)
|
||||
bili_live_router.mock(return_value=Response(200, json=mock_bili_live_status))
|
||||
|
||||
bilibili_main_page_router = respx.get("https://bilibili.com")
|
||||
bilibili_main_page_router = respx.get("https://www.bilibili.com/")
|
||||
bilibili_main_page_router.mock(return_value=Response(200))
|
||||
|
||||
target = "13164144"
|
||||
|
@ -440,7 +440,7 @@ async def test_add_with_bilibili_target_parser(app: App):
|
||||
return_value=Response(200, json=get_json("bilibili_arknights_profile.json"))
|
||||
)
|
||||
|
||||
bilibili_main_page_router = respx.get("https://bilibili.com")
|
||||
bilibili_main_page_router = respx.get("https://www.bilibili.com/")
|
||||
bilibili_main_page_router.mock(return_value=Response(200))
|
||||
|
||||
async with app.test_matcher(add_sub_matcher) as ctx:
|
||||
|
Loading…
x
Reference in New Issue
Block a user