# Send YouTube Publisher to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "youtube-publisher",
    "name": "YouTube Publisher",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/pdpaer/youtube-publisher",
    "canonicalUrl": "https://clawhub.ai/pdpaer/youtube-publisher",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/youtube-publisher",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=youtube-publisher",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "client_secret.example.json",
      "scripts/youtube_upload.py"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T17:22:31.273Z",
      "expiresAt": "2026-05-14T17:22:31.273Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
        "contentDisposition": "attachment; filename=\"afrexai-annual-report-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/youtube-publisher"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/youtube-publisher",
    "downloadUrl": "https://openagent3.xyz/downloads/youtube-publisher",
    "agentUrl": "https://openagent3.xyz/skills/youtube-publisher/agent",
    "manifestUrl": "https://openagent3.xyz/skills/youtube-publisher/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/youtube-publisher/agent.md"
  }
}
```
## Documentation

### youtube-publisher

YouTube 视频自动上传与管理工具

基于 YouTube Data API v3 + OAuth 2.0，支持从命令行自动上传视频到 YouTube。

### 架构

本地 Mac (Python)
    ↓ OAuth 2.0 认证
Google YouTube Data API v3
    ↓ 断点续传上传
YouTube 频道

### 功能

✅ 视频上传（支持大文件断点续传，10MB 分块）
✅ 设置标题、描述、标签、分类
✅ 隐私状态控制（private / public / unlisted）
✅ 自定义缩略图
✅ 添加到播放列表
✅ 频道信息查询
✅ 已上传视频列表
✅ OAuth 2.0 自动刷新 Token

### 第一步：Google Cloud Console 配置

⚠️ 这一步必须手动完成，只需做一次。

打开 Google Cloud Console
创建新项目（或选择已有项目）
启用 API：

搜索 "YouTube Data API v3" → 点击 "启用"


创建 OAuth 凭证：

左侧菜单 → "API 和服务" → "凭据"
"创建凭据" → "OAuth 客户端 ID"
应用类型选 "桌面应用"
名称随意（如 "OpenClaw YouTube"）
下载 JSON 文件


保存凭证文件：
mv ~/Downloads/client_secret_*.json ~/.openclaw/workspace/skills/youtube-publisher/client_secret.json

注意： 如果项目处于"测试"状态，需要在 OAuth 同意屏幕 → 测试用户 中添加你的 Google 邮箱。

### 第二步：安装依赖

pip3 install google-api-python-client google-auth-oauthlib google-auth-httplib2

### 第三步：首次授权

python3 {baseDir}/scripts/youtube_upload.py auth

浏览器会自动打开 Google 授权页面，登录并授权后，Token 自动保存到本地。后续使用无需再授权。

### 第四步：上传视频

# 基本上传（默认 private）
python3 {baseDir}/scripts/youtube_upload.py upload video.mp4 \\
  --title "视频标题" \\
  --description "视频描述" \\
  --tags AI OpenClaw 自动化

# 公开发布 + 设置缩略图
python3 {baseDir}/scripts/youtube_upload.py upload video.mp4 \\
  --title "OpenClaw 实战教程" \\
  --description "详细教程..." \\
  --tags AI OpenClaw 教程 \\
  --privacy public \\
  --thumbnail cover.png \\
  --category 28

# 上传并添加到播放列表
python3 {baseDir}/scripts/youtube_upload.py upload video.mp4 \\
  --title "系列教程 #1" \\
  --playlist PLxxxxxx

### 其他命令

# 查看频道信息
python3 {baseDir}/scripts/youtube_upload.py channels

# 列出最近上传的视频
python3 {baseDir}/scripts/youtube_upload.py list
python3 {baseDir}/scripts/youtube_upload.py list -n 20

# 列出播放列表
python3 {baseDir}/scripts/youtube_upload.py playlists

### 在 OpenClaw 中使用

直接对 Agent 说：

"帮我把 ~/Videos/demo.mp4 上传到 YouTube，标题是 xxx，标签加上 AI 和教程"

Agent 会自动调用上传脚本完成发布。

### 视频分类 ID 参考

分类ID分类ID电影/动画1游戏20汽车/交通2博客/Vlog22音乐10喜剧23宠物/动物15娱乐24体育17新闻25短片18时尚26旅游/活动19教育27科技28

### 隐私状态

private — 仅自己可见（默认，推荐先用此状态检查后再公开）
unlisted — 不公开列出，有链接可访问
public — 公开发布

### 1. "client_secret.json 找不到"

请按照"第一步"从 Google Cloud Console 下载 OAuth 凭证文件。

### 2. "Access blocked: This app's request is invalid"

OAuth 同意屏幕未配置。在 Google Cloud Console → OAuth 同意屏幕 → 设置。

### 3. "The user has exceeded the number of videos they may upload"

YouTube API 有每日上传配额限制（通常约 6 个视频/天）。

### 4. "缩略图设置失败"

自定义缩略图需要频道已通过电话号码验证。

### 5. Token 过期

脚本会自动刷新 Token。如果持续失败，删除 token.json 重新授权：

rm ~/.openclaw/workspace/skills/youtube-publisher/token.json
python3 {baseDir}/scripts/youtube_upload.py auth

### 文件结构

youtube-publisher/
├── SKILL.md              # 本文档
├── client_secret.json    # Google OAuth 凭证（需自行配置）
├── token.json            # 自动生成的访问令牌
└── scripts/
    └── youtube_upload.py  # 上传脚本

### 参考资料

YouTube Data API v3
Google Cloud Console
OAuth 2.0 配置指南
视频上传 API
API 配额说明
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: pdpaer
- Version: 1.0.0
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-05-07T17:22:31.273Z
- Expires at: 2026-05-14T17:22:31.273Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/youtube-publisher)
- [Send to Agent page](https://openagent3.xyz/skills/youtube-publisher/agent)
- [JSON manifest](https://openagent3.xyz/skills/youtube-publisher/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/youtube-publisher/agent.md)
- [Download page](https://openagent3.xyz/downloads/youtube-publisher)