asemxin commited on
Commit ·
278f9aa
1
Parent(s): 8455100
fix: add image_type=message param to download API
Browse files- image_daemon.py +2 -1
image_daemon.py
CHANGED
|
@@ -104,8 +104,9 @@ def extract_image_keys(msg):
|
|
| 104 |
def download_image(token, image_key):
|
| 105 |
headers = {"Authorization": f"Bearer {token}"}
|
| 106 |
resp = requests.get(f"{FEISHU_BASE}/im/v1/images/{image_key}",
|
| 107 |
-
headers=headers, timeout=30)
|
| 108 |
if resp.status_code == 200 and len(resp.content) > 100:
|
|
|
|
| 109 |
return resp.content
|
| 110 |
log(f"❌ 下载图片失败 {image_key}: HTTP {resp.status_code}, {resp.text[:200]}")
|
| 111 |
log(f" 需要权限: im:resource")
|
|
|
|
| 104 |
def download_image(token, image_key):
|
| 105 |
headers = {"Authorization": f"Bearer {token}"}
|
| 106 |
resp = requests.get(f"{FEISHU_BASE}/im/v1/images/{image_key}",
|
| 107 |
+
headers=headers, params={"image_type": "message"}, timeout=30)
|
| 108 |
if resp.status_code == 200 and len(resp.content) > 100:
|
| 109 |
+
log(f"✅ 下载成功: {len(resp.content)} bytes")
|
| 110 |
return resp.content
|
| 111 |
log(f"❌ 下载图片失败 {image_key}: HTTP {resp.status_code}, {resp.text[:200]}")
|
| 112 |
log(f" 需要权限: im:resource")
|