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
d80e15de2b
commit
1ae0de87ce
@ -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:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user