修复通不过检查的问题

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: try:
return httpx.AsyncClient(proxies=proxies, **kwargs) return httpx.AsyncClient(proxies=proxies, **kwargs)
except TypeError: except TypeError:
return httpx.AsyncClient( return httpx.AsyncClient(mounts={
mounts={ k: v for k, v in {
"http://": httpx.AsyncHTTPTransport(proxy=proxies.get("http")) "http://": httpx.AsyncHTTPTransport(proxy=proxies.get("http")) if proxies else None,
if proxies "https://": httpx.AsyncHTTPTransport(proxy=proxies.get("https")) if proxies else None
else None, }.items() if v is not None
"https://": httpx.AsyncHTTPTransport(proxy=proxies.get("https")) }, **kwargs)
if proxies
else None,
},
**kwargs,
)
class AsyncHttpx: class AsyncHttpx: