We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f7f2c93 commit 94df65dCopy full SHA for 94df65d
Muice/utils/utils.py
@@ -2,6 +2,7 @@
2
import os
3
import sys
4
import time
5
+import ssl
6
from typing import Optional
7
8
import httpx
@@ -39,7 +40,10 @@ async def save_image_as_file(
39
40
41
:return: 保存后的本地目录
42
"""
- async with httpx.AsyncClient(proxy=proxy) as client:
43
+ ssl_context = ssl.create_default_context()
44
+ ssl_context.set_ciphers("DEFAULT")
45
+
46
+ async with httpx.AsyncClient(proxy=proxy,verify=ssl_context) as client:
47
r = await client.get(image_url, headers={"User-Agent": User_Agent})
48
local_path = (IMG_DIR / file_name).resolve()
49
with open(local_path, "wb") as file:
0 commit comments