mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
修复类型检查
This commit is contained in:
parent
bd0e335ed1
commit
61432032c8
@ -7,7 +7,7 @@ from typing import Any, ClassVar, Literal, cast
|
|||||||
|
|
||||||
import aiofiles
|
import aiofiles
|
||||||
import httpx
|
import httpx
|
||||||
from httpx import AsyncHTTPTransport, HTTPStatusError, Response
|
from httpx import AsyncHTTPTransport, HTTPStatusError, Proxy, Response
|
||||||
from nonebot_plugin_alconna import UniMessage
|
from nonebot_plugin_alconna import UniMessage
|
||||||
from nonebot_plugin_htmlrender import get_browser
|
from nonebot_plugin_htmlrender import get_browser
|
||||||
from playwright.async_api import Page
|
from playwright.async_api import Page
|
||||||
@ -36,8 +36,12 @@ def get_async_client(
|
|||||||
https_proxy = proxies.get("https://")
|
https_proxy = proxies.get("https://")
|
||||||
return httpx.AsyncClient(
|
return httpx.AsyncClient(
|
||||||
mounts={
|
mounts={
|
||||||
"http://": AsyncHTTPTransport(proxy=http_proxy),
|
"http://": AsyncHTTPTransport(
|
||||||
"https://": AsyncHTTPTransport(proxy=https_proxy),
|
proxy=Proxy(http_proxy) if http_proxy else None
|
||||||
|
),
|
||||||
|
"https://": AsyncHTTPTransport(
|
||||||
|
proxy=Proxy(https_proxy) if https_proxy else None
|
||||||
|
),
|
||||||
},
|
},
|
||||||
transport=transport,
|
transport=transport,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user