360 Secure SkillHub
360 安全技能中心

OpenClaw YouTube Upload

该 Skill 通过官方 YouTube Data API v3 与 OAuth 2.0 上传本地视频,以脚本方式替代浏览器自动化;支持标题、描述、公开/不公开/私享隐私设置与大文件分块。需预先安装 Google API 与 OAuth 客户端库,并提供 Google Cloud 生成的 OAuth 凭据文件;首次运行需完成授权,之后凭本地令牌静默上传。

brorlandi
brorlandi
热度 86.50
最近更新 2026-05-11 17:27:50
分类:营销依赖:代码执行 / 第三方 API / 读写文件应用场景:社交媒体 / API 集成 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add openclaw-youtube-upload
Metadata
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

  1. The Google API Python Client and OAuth libraries must be installed:
    pip3 install google-api-python-client google-auth-oauthlib google-auth-httplib2
    
  2. 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

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.