Skip to content

feat: add -videoID flag to set thumbnail on existing videos#218

Open
dandaka wants to merge 1 commit into
porjo:masterfrom
dandaka:feat/thumbnail-set
Open

feat: add -videoID flag to set thumbnail on existing videos#218
dandaka wants to merge 1 commit into
porjo:masterfrom
dandaka:feat/thumbnail-set

Conversation

@dandaka

@dandaka dandaka commented May 8, 2026

Copy link
Copy Markdown

Summary

  • Adds a new -videoID flag that, combined with -thumbnail, allows setting a thumbnail on an already-uploaded video via the YouTube Data API v3 thumbnails.set endpoint
  • Solves the real-world problem where upload succeeds but thumbnail fails (e.g., file too large) — currently requires manual fix in YouTube Studio
  • -videoID + -thumbnail triggers the new thumbnail-only mode; -videoID + -filename is rejected; existing upload behavior is unchanged

Changes

  • files.go: Added VideoID field to Config struct
  • cmd/youtubeuploader/main.go: Added -videoID flag, validation logic to route between upload and thumbnail-set modes
  • thumbnail.go: New file with SetThumbnail() function — opens thumbnail (file or URL via existing Open()), builds OAuth client, calls Thumbnails.Set()

Usage

# Set thumbnail on existing video
youtubeuploader -videoID LSfZhFqSH0c -thumbnail cover.jpg

# Still works as before
youtubeuploader -filename video.mp4 -thumbnail cover.jpg -title "My Video"

Test plan

  • go build compiles cleanly
  • -videoID without -thumbnail → error
  • -videoID with -filename → error
  • -videoID with -thumbnail → successfully sets thumbnail via YouTube API (tested against a real video)

Allows updating the thumbnail on an already-uploaded video without
re-uploading. Useful when the initial thumbnail upload fails or when
a thumbnail needs to be changed after the fact.

Usage: youtubeuploader -videoID <id> -thumbnail <file>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant