修复通不过检查的问题

This commit is contained in:
molanp 2025-06-02 00:56:03 +08:00
parent d80e15de2b
commit 1ae0de87ce

View File

@ -37,17 +37,12 @@ def get_async_client(proxies=None, **kwargs):
try:
return httpx.AsyncClient(proxies=proxies, **kwargs)
except TypeError:
return httpx.AsyncClient(
mounts={
"http://": httpx.AsyncHTTPTransport(proxy=proxies.get("http"))
if proxies
else None,
"https://": httpx.AsyncHTTPTransport(proxy=proxies.get("https"))
if proxies
else None,
},
**kwargs,
)
return httpx.AsyncClient(mounts={
k: v for k, v in {
"http://": httpx.AsyncHTTPTransport(proxy=proxies.get("http")) if proxies else None,
"https://": httpx.AsyncHTTPTransport(proxy=proxies.get("https")) if proxies else None
}.items() if v is not None
}, **kwargs)
class AsyncHttpx: