← Back to Skills Marketplace
cindypapa

飞书消息文件下载

by Cindypapa · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
81
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install feishu-message-download
Description
从飞书消息中下载文件(视频、图片、文档等)到本地
README (SKILL.md)

飞书消息文件下载

从飞书消息中下载文件(视频、图片、文档等)到本地。

描述

本 Skill 用于从飞书聊天消息中下载附件到本地,支持视频、图片、文件等多种类型。

下载后的文件可以用于:

  • 视频编辑和处理
  • 上传到抖音、小红书、B 站等平台
  • 本地存档和备份
  • AI 分析和处理
  • 转发到其他平台

功能

  • 从飞书消息链接或消息 ID 中提取文件信息
  • 支持手动指定 file_key 和 message_id
  • 自动获取飞书 tenant_access_token
  • 下载文件到本地指定目录

安装

# 安装依赖
pip install -r requirements.txt

配置

本 Skill 需要以下飞书应用凭证,可通过以下方式配置:

方式 1:OpenClaw 配置(推荐)

在 OpenClaw 配置文件中设置:

{
  "channels": {
    "feishu": {
      "appId": "your_app_id",
      "appSecret": "your_app_secret"
    }
  }
}

方式 2:环境变量

export FEISHU_APP_ID="your_app_id"
export FEISHU_APP_SECRET="your_app_secret"

使用方法

方法 1:通过消息链接下载

from download import FeishuMessageDownloader

downloader = FeishuMessageDownloader()
downloader.download_from_message_url(
    message_url="https://open.feishu.cn/im/xxx",
    output_dir="~/Downloads"
)

方法 2:通过消息 ID 和 file_key 下载

from download import FeishuMessageDownloader

downloader = FeishuMessageDownloader()
downloader.download_file(
    message_id="om_xxxxxxxx",
    file_key="file_xxxxxxxx",
    output_dir="~/Downloads",
    filename="my_video.mp4"
)

方法 3:命令行使用

# 通过消息链接下载
python download.py --url "https://open.feishu.cn/im/xxx" --output ~/Downloads

# 通过消息 ID 和 file_key 下载
python download.py --message-id "om_xxxxxxxx" --file-key "file_xxxxxxxx" --output ~/Downloads

# 指定保存文件名
python download.py --message-id "om_xxxxxxxx" --file-key "file_xxxxxxxx" --output ~/Downloads --filename "video.mp4"

参数说明

参数 说明 必填
--url 飞书消息链接 可选
--message-id 消息 ID (om_xxx) 可选
--file-key 文件 key (file_xxx) 可选
--output 输出目录,默认为当前目录 可选
--filename 保存的文件名 可选

飞书应用权限要求

本 Skill 需要以下飞书应用权限:

  • im:resource - 访问消息资源

支持的文件类型

  • 视频文件 (.mp4, .mov, .avi, etc.) - 可用于视频编辑、平台发布
  • 图片文件 (.jpg, .png, .gif, .webp, etc.) - 可用于设计、文档制作
  • 文档文件 (.pdf, .doc, .xls, .ppt, etc.) - 可用于本地编辑、存档
  • 音频文件 (.mp3, .wav, etc.) - 可用于音频处理、转录
  • 其他飞书支持的文件类型

典型使用场景

场景 1:视频内容发布

用户发送视频到飞书 → 下载到本地 → 发布到抖音/小红书/B 站

# 下载视频
python download.py --message-id "om_xxx" --file-key "file_xxx" --output ~/Videos

# 然后使用视频发布工具发布到各平台

场景 2:文档处理

收到飞书文档 → 下载到本地 → 编辑处理 → 重新上传或转发

python download.py --url "https://open.feishu.cn/im/xxx" --output ~/Documents

场景 3:图片素材收集

收集飞书群里的图片 → 批量下载 → 用于设计或存档

from download import FeishuMessageDownloader

downloader = FeishuMessageDownloader()
for msg in messages:
    downloader.download_file(
        message_id=msg['id'],
        file_key=msg['file_key'],
        output_dir="~/Pictures/Collection"
    )

场景 4:AI 处理流程

下载飞书文件 → AI 分析/处理 → 生成报告或内容

# 下载视频
downloader = FeishuMessageDownloader()
result = downloader.download_file(message_id, file_key, "~/AI_Input")

# 使用 AI 处理
# ... AI 处理代码 ...

使用建议

  1. 批量下载:可以结合飞书消息列表 API,批量下载多个文件
  2. 自动命名:如果不指定 filename,会自动使用原始文件名
  3. 目录管理:建议按日期或项目分类保存文件
  4. 定期清理:下载后的文件记得定期清理,避免占用过多空间

API 端点

GET https://open.feishu.cn/open-apis/im/v1/messages/{message_id}/resources/{file_key}?type=file

返回结果

成功下载后返回保存的文件路径:

{
    "success": True,
    "file_path": "/path/to/downloaded/file.mp4",
    "file_size": 1234567,
    "filename": "file.mp4"
}

错误处理

可能的错误情况:

  • 凭证无效或过期
  • 消息不存在或无权访问
  • 文件不存在或已过期
  • 网络连接问题

注意事项

  1. 文件下载链接有过期时间,请及时下载(通常 7 天)
  2. 大文件下载可能需要较长时间,请耐心等待
  3. 确保应用有访问该消息的权限,否则无法下载
  4. 下载后的文件处理
    • 视频文件:可用于剪辑、转码、发布到视频平台
    • 图片文件:可用于编辑、压缩、格式转换
    • 文档文件:可用于内容提取、格式转换、打印
  5. 存储空间:定期清理下载的文件,避免占用过多磁盘空间
  6. 隐私合规:下载的文件仅供个人使用,注意数据安全和隐私保护

与其他 Skill 的配合

本 Skill 可以与以下类型的 Skill 配合使用:

配合 Skill 类型 使用场景
视频发布 Skill 下载飞书视频 → 发布到抖音/小红书/B 站
视频处理 Skill 下载视频 → 剪辑/转码/压缩
AI 分析 Skill 下载文件 → AI 分析/总结/提取
文档处理 Skill 下载文档 → 编辑/转换/合并
云存储 Skill 下载文件 → 上传到云盘/网盘

完整工作流程示例

飞书视频 → 抖音发布 完整流程

# 步骤 1:从飞书下载视频
python download.py \
  --message-id "om_x100b523c2b77fd30c24abb58a94deee" \
  --file-key "file_v3_0010e_dc672f40-87b6-4d67-b69d-e40290032c2g" \
  --output ~/.openclaw/workspace \
  --filename "douyin_video.mp4"

# 步骤 2:(可选)视频处理
# ffmpeg -i douyin_video.mp4 -c:v libx264 -c:a aac output.mp4

# 步骤 3:发布到抖音
# 使用抖音发布工具或手动上传

批量处理飞书文件

from download import FeishuMessageDownloader
import os

# 初始化下载器
downloader = FeishuMessageDownloader()

# 批量下载多个文件
messages = [
    {"message_id": "om_xxx1", "file_key": "file_xxx1", "type": "video"},
    {"message_id": "om_xxx2", "file_key": "file_xxx2", "type": "image"},
    {"message_id": "om_xxx3", "file_key": "file_xxx3", "type": "document"},
]

output_base = "~/Downloads/Feishu_Files"

for msg in messages:
    # 按类型分类保存
    type_dir = os.path.join(output_base, msg['type'])
    os.makedirs(type_dir, exist_ok=True)
    
    result = downloader.download_file(
        message_id=msg['message_id'],
        file_key=msg['file_key'],
        output_dir=type_dir
    )
    
    if result['success']:
        print(f"✅ 下载成功:{result['file_path']}")
    else:
        print(f"❌ 下载失败:{result.get('error')}")

作者

勇哥的小飞侠 🧚🏻‍♀️🌸🧚🏻

Usage Guidance
This skill implements a normal Feishu file downloader, but exercise caution before installing: (1) The code requires FEISHU_APP_ID and FEISHU_APP_SECRET (or an OpenClaw config) but the registry metadata did not declare these — do not supply credentials unless you trust the author. (2) The skill reads ~/.openclaw/openclaw.json if present; that file can contain other channel configs — inspect it before running. (3) The SKILL.md contained unicode control characters (a prompt‑injection signal); open the file in a plain text viewer and remove/verify any unexpected characters. (4) Inspect download.py fully (it appears to use only open.feishu.cn endpoints and local file writes) and run the script in a sandbox or isolated account with minimal permissions the first time. (5) If you plan to provide real credentials, create an app with minimal required permissions (im:resource) and rotate/revoke keys after testing. If you want, I can highlight exact lines in download.py and the SKILL.md that reference credentials, config paths, and the unicode control characters.
Capability Analysis
Type: OpenClaw Skill Name: feishu-message-download Version: 1.0.0 The skill is a legitimate utility for downloading files from Feishu (Lark) messages using official API endpoints (open.feishu.cn). The code in `download.py` follows standard practices for authentication, token management, and file handling, with no evidence of data exfiltration, obfuscation, or malicious intent. It correctly identifies and uses configuration from environment variables or the OpenClaw config directory as described in the documentation.
Capability Tags
requires-oauth-token
Capability Assessment
Purpose & Capability
The code and instructions implement a Feishu file downloader and require FEISHU_APP_ID / FEISHU_APP_SECRET or an OpenClaw config; however the registry metadata lists no required environment variables or primary credential. That mismatch (skill will not work without credentials) is an incoherence that should have been declared.
Instruction Scope
SKILL.md and download.py instruct the agent to obtain tenant_access_token from Feishu and download resources via open.feishu.cn, and to read environment variables or ~/.openclaw/openclaw.json. That scope matches the stated purpose. However the SKILL.md contained detected unicode-control-chars (prompt-injection pattern) — this is suspicious for an instruction file intended to be interpreted by an LLM/evaluator and should be reviewed/cleaned.
Install Mechanism
No install spec (instruction-only plus a Python script). Only requires python3 and the requests dependency; no remote arbitrary downloads or unusual installers were specified.
Credentials
The skill legitimately needs Feishu app credentials (app id/secret) to obtain tenant_access_token, but those credentials are not declared in the registry metadata. The code also reads ~/.openclaw/openclaw.json if present (which may contain other channel configs) — while it only looks for feishu keys, loading that file is wider access than declared and should be documented.
Persistence & Privilege
The skill does not request always:true or system-wide changes and does not install persistent services. It reads user config files in the home directory and writes downloaded files to the specified output directory (expected behavior).
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install feishu-message-download
  3. After installation, invoke the skill by name or use /feishu-message-download
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
feishu-message-download 1.0.0 - Initial release: Download files (videos, images, documents, etc.) from Feishu messages to local storage. - Supports downloads via message URL, message ID + file_key, and command line usage. - Compatible with a wide range of file types: video, image, document, audio, and more. - Automatic retrieval of Feishu tenant_access_token and flexible configuration (OpenClaw or environment variables). - Includes features for batch downloads, auto file naming, and directory management. - Provides error handling for access, network, and file validity issues.
Metadata
Slug feishu-message-download
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is 飞书消息文件下载?

从飞书消息中下载文件(视频、图片、文档等)到本地. It is an AI Agent Skill for Claude Code / OpenClaw, with 81 downloads so far.

How do I install 飞书消息文件下载?

Run "/install feishu-message-download" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 飞书消息文件下载 free?

Yes, 飞书消息文件下载 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 飞书消息文件下载 support?

飞书消息文件下载 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 飞书消息文件下载?

It is built and maintained by Cindypapa (@cindypapa); the current version is v1.0.0.

💬 Comments