skills/ → skills-dev(9), skills-req(10), skills-ops(4), skills-integration(8), skills-biz(4), skills-workflow(7) generate-marketplace.py 改为自动扫描所有 skills-* 目录。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
52 lines
1.6 KiB
Python
52 lines
1.6 KiB
Python
#!/usr/bin/env python3
|
|
"""检查文档中的图片块状态"""
|
|
|
|
import requests
|
|
from datetime import datetime, timedelta
|
|
|
|
ZHIYUN_APP_ID = "cli_a9f29dca82b9dbef"
|
|
ZHIYUN_APP_SECRET = "sDfhjG7QT1S4gfHiMVYSygmPQPN1R2Ho"
|
|
BASE_URL = "https://open.feishu.cn/open-apis"
|
|
DOCUMENT_ID = "Eqt2dpcpToVDxExFmhicqFa9nJf"
|
|
|
|
def get_token():
|
|
url = f"{BASE_URL}/auth/v3/tenant_access_token/internal"
|
|
response = requests.post(url, json={
|
|
"app_id": ZHIYUN_APP_ID,
|
|
"app_secret": ZHIYUN_APP_SECRET
|
|
})
|
|
return response.json()["tenant_access_token"]
|
|
|
|
def main():
|
|
token = get_token()
|
|
headers = {"Authorization": f"Bearer {token}"}
|
|
|
|
url = f"{BASE_URL}/docx/v1/documents/{DOCUMENT_ID}/blocks"
|
|
response = requests.get(url, headers=headers)
|
|
data = response.json()
|
|
|
|
if data.get("code") != 0:
|
|
print(f"获取失败: {data}")
|
|
return
|
|
|
|
blocks = data["data"].get("items", [])
|
|
print(f"文档共有 {len(blocks)} 个块\n")
|
|
|
|
image_count = 0
|
|
for block in blocks:
|
|
if block.get("block_type") == 27:
|
|
image_count += 1
|
|
image_data = block.get("image", {})
|
|
token_value = image_data.get("token", "")
|
|
print(f"图片块 #{image_count}:")
|
|
print(f" block_id: {block.get('block_id')}")
|
|
print(f" token: {token_value if token_value else '(空)'}")
|
|
print(f" width: {image_data.get('width')}, height: {image_data.get('height')}")
|
|
print()
|
|
|
|
if image_count == 0:
|
|
print("文档中没有图片块")
|
|
|
|
if __name__ == "__main__":
|
|
main()
|