youtube-uploader
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseYouTube Uploader
YouTube 视频上传工具
First time? Ifabove, runsetup_complete: falsefirst, then set./SETUP.md.setup_complete: true
Upload videos to YouTube with full metadata control.
首次使用? 如果上方的,请先运行setup_complete: false,然后将./SETUP.md设置为setup_complete。true
上传视频至YouTube,可全面控制元数据。
Quick Start
快速开始
bash
cd ~/.claude/skills/youtube-uploader/scriptsbash
cd ~/.claude/skills/youtube-uploader/scriptsFirst time: authenticate
First time: authenticate
npx ts-node youtube-upload.ts --auth
npx ts-node youtube-upload.ts --auth
Upload video
Upload video
npx ts-node youtube-upload.ts
--video /path/to/video.mp4
--title "My Awesome Video"
--description "Check out this amazing content!"
--tags "tech,ai,tutorial"
--privacy unlisted
--video /path/to/video.mp4
--title "My Awesome Video"
--description "Check out this amazing content!"
--tags "tech,ai,tutorial"
--privacy unlisted
npx ts-node youtube-upload.ts
--video /path/to/video.mp4
--title "My Awesome Video"
--description "Check out this amazing content!"
--tags "tech,ai,tutorial"
--privacy unlisted
--video /path/to/video.mp4
--title "My Awesome Video"
--description "Check out this amazing content!"
--tags "tech,ai,tutorial"
--privacy unlisted
Upload as YouTube Short (vertical video)
Upload as YouTube Short (vertical video)
npx ts-node youtube-upload.ts
--video /path/to/short.mp4
--title "Quick Tip #Shorts"
--description "A quick tip for you!"
--privacy public
--short
--video /path/to/short.mp4
--title "Quick Tip #Shorts"
--description "A quick tip for you!"
--privacy public
--short
undefinednpx ts-node youtube-upload.ts
--video /path/to/short.mp4
--title "Quick Tip #Shorts"
--description "A quick tip for you!"
--privacy public
--short
--video /path/to/short.mp4
--title "Quick Tip #Shorts"
--description "A quick tip for you!"
--privacy public
--short
undefinedOptions
选项
| Option | Short | Description |
|---|---|---|
| | Video file path (required) |
| | Video title (required) |
| | Video description |
| Comma-separated tags | |
| | Privacy: public, unlisted, private (default: unlisted) |
| | Category ID (default: 22 = People & Blogs) |
| Custom thumbnail image path | |
| Add to playlist ID | |
| Mark as YouTube Short | |
| Run OAuth2 authentication flow | |
| Preview without uploading |
| 选项 | 缩写 | 描述 |
|---|---|---|
| | 视频文件路径(必填) |
| | 视频标题(必填) |
| | 视频描述 |
| 逗号分隔的标签 | |
| | 隐私设置:公开、不公开可分享、私有(默认:不公开可分享) |
| | 分类ID(默认:22 = 人物与博客) |
| 自定义缩略图图片路径 | |
| 添加至播放列表ID | |
| 标记为YouTube Short | |
| 运行OAuth2身份验证流程 | |
| 预览上传内容,不实际上传 |
Category IDs
分类ID
| ID | Category |
|---|---|
| 1 | Film & Animation |
| 2 | Autos & Vehicles |
| 10 | Music |
| 15 | Pets & Animals |
| 17 | Sports |
| 19 | Travel & Events |
| 20 | Gaming |
| 22 | People & Blogs |
| 23 | Comedy |
| 24 | Entertainment |
| 25 | News & Politics |
| 26 | Howto & Style |
| 27 | Education |
| 28 | Science & Technology |
| ID | 分类 |
|---|---|
| 1 | 电影与动画 |
| 2 | 汽车与交通工具 |
| 10 | 音乐 |
| 15 | 宠物与动物 |
| 17 | 体育 |
| 19 | 旅行与活动 |
| 20 | 游戏 |
| 22 | 人物与博客 |
| 23 | 喜剧 |
| 24 | 娱乐 |
| 25 | 新闻与政治 |
| 26 | 教程与风格 |
| 27 | 教育 |
| 28 | 科学与技术 |
Authentication
身份验证
First-time setup requires OAuth2 authentication:
- Run
npx ts-node youtube-upload.ts --auth - Browser opens Google login
- Grant permissions to upload videos
- Token is saved to
.youtube-token.json
Token refreshes automatically. Re-run if expired.
--auth首次使用需要完成OAuth2身份验证:
- 运行
npx ts-node youtube-upload.ts --auth - 浏览器将打开Google登录页面
- 授予上传视频的权限
- 令牌将保存至
.youtube-token.json
令牌会自动刷新。如果过期,请重新运行。
--authEnvironment
环境配置
Create :
scripts/.envenv
YOUTUBE_CLIENT_ID=your_client_id
YOUTUBE_CLIENT_SECRET=your_client_secretGet credentials from Google Cloud Console:
- Create project at console.cloud.google.com
- Enable YouTube Data API v3
- Create OAuth2 credentials (Desktop app)
- Download and extract client_id & client_secret
创建文件:
scripts/.envenv
YOUTUBE_CLIENT_ID=your_client_id
YOUTUBE_CLIENT_SECRET=your_client_secret从Google Cloud Console获取凭证:
- 在console.cloud.google.com创建项目
- 启用YouTube Data API v3
- 创建OAuth2凭证(桌面应用)
- 下载并提取client_id和client_secret
Examples
示例
Upload Tutorial Video
上传教程视频
bash
npx ts-node youtube-upload.ts \
-v tutorial.mp4 \
-t "How to Use Claude Code - Complete Guide" \
-d "Learn everything about Claude Code in this comprehensive tutorial.
Timestamps:
00:00 Introduction
02:30 Getting Started
05:00 Advanced Features
#ClaudeCode #AI #Tutorial" \
--tags "claude code,ai,tutorial,anthropic,coding" \
--category 28 \
--privacy publicbash
npx ts-node youtube-upload.ts \
-v tutorial.mp4 \
-t "How to Use Claude Code - Complete Guide" \
-d "Learn everything about Claude Code in this comprehensive tutorial.
Timestamps:
00:00 Introduction
02:30 Getting Started
05:00 Advanced Features
#ClaudeCode #AI #Tutorial" \
--tags "claude code,ai,tutorial,anthropic,coding" \
--category 28 \
--privacy publicUpload YouTube Short
上传YouTube Short
bash
npx ts-node youtube-upload.ts \
-v short_video.mp4 \
-t "Mind-blowing AI trick! #Shorts" \
-d "This will change how you work! #AI #Tech" \
--privacy public \
--shortbash
npx ts-node youtube-upload.ts \
-v short_video.mp4 \
-t "Mind-blowing AI trick! #Shorts" \
-d "This will change how you work! #AI #Tech" \
--privacy public \
--shortUpload to Playlist
上传至播放列表
bash
npx ts-node youtube-upload.ts \
-v episode5.mp4 \
-t "Podcast Episode 5" \
--playlist PLxxxxxxxxxxxxxx \
--privacy unlistedbash
npx ts-node youtube-upload.ts \
-v episode5.mp4 \
-t "Podcast Episode 5" \
--playlist PLxxxxxxxxxxxxxx \
--privacy unlistedOutput
输出结果
On success, returns:
- Video ID
- Video URL (https://youtu.be/VIDEO_ID)
- Status
上传成功后,将返回:
- 视频ID
- 视频链接(https://youtu.be/VIDEO_ID)
- 上传状态
Limitations
限制说明
- Max file size: 256GB (YouTube limit)
- Supported formats: MP4, MOV, AVI, WMV, FLV, 3GP, MPEG
- Daily upload quota: 10,000 units (typically ~6 videos/day)
- Title max: 100 characters
- Description max: 5,000 characters
- Tags max: 500 characters total
- 最大文件大小:256GB(YouTube限制)
- 支持格式:MP4、MOV、AVI、WMV、FLV、3GP、MPEG
- 每日上传配额:10,000单位(通常约6个视频/天)
- 标题最大长度:100字符
- 描述最大长度:5,000字符
- 标签总长度最大:500字符