A simple CLI-based YouTube Video Uploader 🎬 ⬆️ 🚀
GopherUpload is a lightweight command-line tool that uploads videos to YouTube using the YouTube Data API v3. It supports:
- 📤 Video uploads with custom metadata
- 📝 Title, description, and tags from metadata.json
- 🖼️ Custom thumbnails (thumbnail.png)
- 📅 Scheduled publishing at a specific date/time
- 🏷️ Hashtags appended to descriptions
# 1. Authenticate with Google
gopherupload login
# 2. Upload a video
gopherupload upload "outputs/My Video Folder"- Go 1.21 or later
- Google OAuth2 credentials for YouTube Data API v3
# Clone the repository
git clone https://github.com/yourusername/gopherupload.git
cd gopherupload
# Get dependencies
go mod tidy
# Build the application
go build -o gopherupload
# (Optional) Move to PATH
# Windows: move gopherupload.exe to a directory in your PATH
# macOS/Linux: sudo mv gopherupload /usr/local/bin/- Go to the Google Cloud Console
- Create a new project or select an existing one
- Enable the YouTube Data API v3 from the API Library
- Go to "Credentials" → "Create Credentials" → "OAuth client ID"
- Select "Desktop app" as the application type
- Download the credentials JSON file
- Save it as
client_secrets.jsonin the GopherUpload directory
Create a config.json file to set upload defaults:
{
"upload_defaults": {
"default_privacy": "public",
"default_category": "22",
"default_description": "Uploaded with GopherUpload",
"default_tags": ["video", "upload"]
}
}Category IDs:
1- Film & Animation2- Autos & Vehicles10- Music15- Pets & Animals17- Sports20- Gaming22- People & Blogs (default)23- Comedy24- Entertainment25- News & Politics26- Howto & Style27- Education28- Science & Technology
Before uploading, authenticate with your Google account:
gopherupload loginThis opens a browser for OAuth2 authentication. After granting access, copy the authorization code back to the terminal.
Note: The token is valid for ~1 hour. Run
loginagain when it expires.
gopherupload upload <directory>The directory should contain:
- One
.mp4file (required) - the video to upload metadata.json(optional) - video metadatathumbnail.png(optional) - custom thumbnail
outputs/My Video/
├── My Video.mp4 # Required: video file
├── metadata.json # Optional: metadata
└── thumbnail.png # Optional: thumbnail
{
"youtube": {
"title": "My Awesome Video",
"description": "This is a great video about...",
"tags": ["tutorial", "coding", "golang"],
"hashtags": ["#programming", "#tech"],
"schedule": {
"publish_date": "2025-12-31",
"publish_time": "10:00"
}
}
}Fields:
| Field | Type | Description |
|---|---|---|
title |
string | Video title (uses filename if empty) |
description |
string | Video description |
tags |
array | Search tags (no # symbol) |
hashtags |
array | Hashtags (with # symbol, appended to description) |
schedule.publish_date |
string | Publish date (YYYY-MM-DD) |
schedule.publish_time |
string | Publish time (HH:MM, system timezone) |
Fallback Behavior:
- If
metadata.jsonis missing → video filename becomes the title, uploaded as public - If
scheduleis missing or in the past → uploads immediately as public - Empty fields → use values from
config.jsondefaults
gopherupload login # Authenticate with Google
gopherupload upload <directory> # Upload video from directory
gopherupload help # Show detailed help"Token not found" error:
Run gopherupload login to authenticate.
"Multiple .mp4 files found" error:
The upload directory must contain exactly one .mp4 file.
"Scheduled time is in the past" warning: The video will upload as public immediately instead of scheduled.
Upload quota exceeded: YouTube API has daily quota limits. See YouTube API Quotas.
MIT License - see LICENSE for details.
Made with ❤️ and Go
