fix #I8AXL6 [app_ai_media]当前在网页不生效,要能将图转本地

This commit is contained in:
Chill
2023-10-31 15:42:31 +08:00
parent 7357339bb5
commit 8c5e56faf9

View File

@@ -149,7 +149,9 @@ def get_image_url2attachment(url):
if not url: if not url:
return None return None
try: try:
response = requests.get(url, timeout=5) if url.startswith('//'):
url = 'https:%s' % url
response = requests.get(url, timeout=30)
except Exception as e: except Exception as e:
return None, None return None, None
# 返回这个图片的base64编码 # 返回这个图片的base64编码