官方 API 视频上传一键搞定
简介
通过 YouTube Data API v3 官方接口安全上传视频,支持 OAuth 2.0 认证、隐私设置与断点续传,需用户自备 Google Cloud 凭证。
原始描述
Uploads a video to YouTube using the official YouTube Data API v3 and OAuth 2.0. Use this skill when the user asks to upload a video to YouTube. It supports...
通过你的 Agent 添加
安装目录:youtube-upload/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
youtube-upload 是一款基于 YouTube Data API v3 的官方视频上传工具,采用 Python 实现,通过 OAuth 2.0 完成身份认证。用户需提供 Google Cloud Console 生成的 client_secret.json 文件(桌面应用类型),首次运行会触发浏览器授权流程并生成本地 token.pickle 持久化令牌,后续上传无需重复登录。
关键特性
- 官方 API 接入:直接调用 Google 官方接口,稳定性远超浏览器自动化方案
- 大文件分片上传:内置 chunking 机制,支持 GB 级视频可靠传输
- 灵活的隐私控制:支持
public(公开)/private(私有)/unlisted(不公开)三种状态
- 完整的元数据:可自定义标题、描述等视频信息
使用示例
python3 scripts/upload.py \
--file "/path/to/video.mp4" \
--title "视频标题" \
--description "视频描述" \
--privacy "unlisted" \
--secrets "/path/to/client_secret.json"
局限性与注意事项
问题
说明
配额限制
YouTube API 设有每日上传配额,超限后需等待次日重置
凭证依赖
强制要求用户自行配置 Google Cloud 项目,有一定门槛
令牌失效
token.pickle 可能因权限撤销或过期失效,需手动删除后重新授权
网络要求
上传过程需稳定的网络连接,中断后依赖 API 端续传机制
适合人群
- 内容创作者寻求自动化上传工作流
- 企业/团队需要批量管理视频资产
- 开发者构建视频发布相关的自动化工具链
常规风险
- 凭证泄露:
client_secret.json 包含敏感 OAuth 信息,需严格保管
- 账户安全:授权范围涉及 YouTube 账号管理权限,建议在专用项目中使用
- 配额规划:商业高频使用需向 Google 申请配额提升
public(公开)/private(私有)/unlisted(不公开)三种状态python3 scripts/upload.py \
--file "/path/to/video.mp4" \
--title "视频标题" \
--description "视频描述" \
--privacy "unlisted" \
--secrets "/path/to/client_secret.json"
局限性与注意事项
问题
说明
配额限制
YouTube API 设有每日上传配额,超限后需等待次日重置
凭证依赖
强制要求用户自行配置 Google Cloud 项目,有一定门槛
令牌失效
token.pickle 可能因权限撤销或过期失效,需手动删除后重新授权
网络要求
上传过程需稳定的网络连接,中断后依赖 API 端续传机制
适合人群
- 内容创作者寻求自动化上传工作流
- 企业/团队需要批量管理视频资产
- 开发者构建视频发布相关的自动化工具链
常规风险
- 凭证泄露:
client_secret.json 包含敏感 OAuth 信息,需严格保管
- 账户安全:授权范围涉及 YouTube 账号管理权限,建议在专用项目中使用
- 配额规划:商业高频使用需向 Google 申请配额提升
| 问题 | 说明 |
|---|---|
| 配额限制 | YouTube API 设有每日上传配额,超限后需等待次日重置 |
| 凭证依赖 | 强制要求用户自行配置 Google Cloud 项目,有一定门槛 |
| 令牌失效 | token.pickle 可能因权限撤销或过期失效,需手动删除后重新授权 |
| 网络要求 | 上传过程需稳定的网络连接,中断后依赖 API 端续传机制 |
- 内容创作者寻求自动化上传工作流
- 企业/团队需要批量管理视频资产
- 开发者构建视频发布相关的自动化工具链
常规风险
- 凭证泄露:
client_secret.json 包含敏感 OAuth 信息,需严格保管
- 账户安全:授权范围涉及 YouTube 账号管理权限,建议在专用项目中使用
- 配额规划:商业高频使用需向 Google 申请配额提升
client_secret.json 包含敏感 OAuth 信息,需严格保管技能正文
name: youtube-upload
description: "Uploads a video to YouTube using the official YouTube Data API v3 and OAuth 2.0. Use this skill when the user asks to upload a video to YouTube. It supports titles, descriptions, privacy settings (public, private, unlisted), and large file chunking. Requires a Google Cloud 'client_secret.json' file."
metadata:
openclaw:
emoji: "📺"
requires:
bins: ["python3", "pip3"]
YouTube Upload Skill
This skill allows you to securely upload videos to YouTube via the official API, bypassing the need for fragile browser automation.
Prerequisites
- The Google API Python Client and OAuth libraries must be installed:
pip3 install google-api-python-client google-auth-oauthlib google-auth-httplib2
- A
client_secret.json file is required. The user must generate an OAuth 2.0 Client ID (Desktop App) from the Google Cloud Console with the YouTube Data API v3 enabled.
Usage
pip3 install google-api-python-client google-auth-oauthlib google-auth-httplib2
client_secret.json file is required. The user must generate an OAuth 2.0 Client ID (Desktop App) from the Google Cloud Console with the YouTube Data API v3 enabled.Use the provided Python script to upload the video:
python3 scripts/upload.py \
--file "/path/to/video.mp4" \
--title "My Video Title" \
--description "My Video Description" \
--privacy "unlisted" \
--secrets "/path/to/client_secret.json"
First Run (Authentication)
On the very first run, the script will output a URL or open a browser window for the user to authenticate and grant permission to their YouTube account. Instruct the user to complete the login flow. Once approved, a token.pickle file is generated locally, and subsequent uploads will run silently.
Troubleshooting
- Token Expired / Revoked: If the token becomes invalid, delete
token.pickle and re-run to trigger the auth flow again.
- Quota Exceeded: The YouTube API has a daily upload quota. If this is hit, the user must wait until the quota resets.
token.pickle and re-run to trigger the auth flow again.正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。