YouTube Publisher

v1.0.0

YouTube 视频自动上传工具。支持视频上传、设置标题/描述/标签/缩略图、管理频道和播放列表。基于 YouTube Data API v3 + OAuth 2.0。

8· 2k·9 current·9 all-time
byleogao@pdpaer

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for pdpaer/youtube-publisher.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "YouTube Publisher" (pdpaer/youtube-publisher) from ClawHub.
Skill page: https://clawhub.ai/pdpaer/youtube-publisher
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install youtube-publisher

ClawHub CLI

Package manager switcher

npx clawhub@latest install youtube-publisher
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name and description describe YouTube upload/management. The included script implements YouTube Data API v3 operations and OAuth 2.0, and the skill only asks the user to provide a Google OAuth client JSON — there are no unrelated environment variables, binaries, or services requested.
Instruction Scope
SKILL.md instructs the user to obtain a Google OAuth client_secret.json and to run the included Python script. Runtime actions are limited to opening a browser for OAuth, starting a local redirect server (port 8090), saving token.json to the skill directory, and calling Google APIs. The script reads video/thumbnail files supplied by the user and writes token.json in ~/.openclaw/workspace/skills/youtube-publisher — no instructions reference unrelated system files or external endpoints beyond Google.
Install Mechanism
No install spec; the skill is instruction-only with a Python script that relies on standard google-auth and google-api-python-client libraries. Dependencies are documented and installed via pip by the user. There are no downloads from arbitrary URLs or archive extraction steps in the manifest.
Credentials
The skill requests no environment variables or secrets in the registry metadata. It uses OAuth client credentials (user-provided client_secret.json) and saves an OAuth token locally — these are the expected credentials for interacting with the YouTube API. No unrelated credentials or high-privilege config paths are requested.
Persistence & Privilege
always is false and the skill does not request persistent system-wide privileges. It stores token.json in its own skill workspace directory and does not modify other skills or global agent configuration.
Assessment
This skill appears to be what it says: a YouTube uploader that uses Google OAuth. Before using it, manually obtain OAuth credentials from the Google Cloud Console and save client_secret.json to the indicated path. Understand that the script will run a local webserver (default port 8090) and open your browser to complete OAuth, and that an access/refresh token (token.json) will be written to ~/.openclaw/workspace/skills/youtube-publisher — protect that file as it grants access to your YouTube account. Install the listed Python dependencies in a controlled environment (virtualenv) and review the included script if you have concerns. If you share the machine with others, ensure the skill workspace directory is only readable by you. Finally, because the skill can publish videos, be mindful of privacy and publishing settings when instructing an agent to upload on your behalf.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

🎬 Clawdis
latestvk978pqpqpawm7yea3dvgq45bn981p1qh
2kdownloads
8stars
1versions
Updated 2mo ago
v1.0.0
MIT-0

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 配置

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

  1. 打开 Google Cloud Console
  2. 创建新项目(或选择已有项目)
  3. 启用 API:
    • 搜索 "YouTube Data API v3" → 点击 "启用"
  4. 创建 OAuth 凭证:
    • 左侧菜单 → "API 和服务" → "凭据"
    • "创建凭据" → "OAuth 客户端 ID"
    • 应用类型选 "桌面应用"
    • 名称随意(如 "OpenClaw YouTube")
    • 下载 JSON 文件
  5. 保存凭证文件:
    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  # 上传脚本

参考资料

Comments

Loading comments...