- 重命名 plugins/ → skills/,个人插件迁移到 skills-personal/(gitignore) - 更新 generate-marketplace.py 支持 config 读取和 skills-personal 扫描 - 新增 claude-config.yaml(技能启用/禁用 + MCP 配置) - 新增 init.sh(交互式 MCP 初始化,支持 stdio/SSE 模式) - 新增 CLAUDE.md 项目说明 - 重写 README.md 反映新结构 - 删除过时脚本:PUSH.sh、generate-marketplace.sh、convert-skills.sh 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()
|