Skip to content

Add YouTube upload pipeline (tools/youtube_upload.py + /publish)#29

Open
dascope wants to merge 2 commits into
digitalsamba:mainfrom
dascope:feature/youtube-upload-pipeline
Open

Add YouTube upload pipeline (tools/youtube_upload.py + /publish)#29
dascope wants to merge 2 commits into
digitalsamba:mainfrom
dascope:feature/youtube-upload-pipeline

Conversation

@dascope

@dascope dascope commented Jun 9, 2026

Copy link
Copy Markdown

What

Adds the toolkit's first publishing capability: upload a rendered video to YouTube via the Data API v3, with a guided /publish workflow that fills metadata from a project's project.json.

New

  • tools/youtube_upload.py — OAuth 2.0 installed-app flow with silent token refresh (per-account cache), resumable upload with exponential-backoff retry, optional thumbnail/captions/playlist, and private/unlisted/public or scheduled (publishAt) visibility. Flags include --auth, --dry-run, --json-out, --account.
  • /publish command (.claude/commands/publish.md) — locates a project's render, drafts title/description/tags, dry-runs, uploads, and writes the resulting video URL back to project.json.
  • docs/youtube-upload.md — Google Cloud Console walkthrough, quota math, and the relevant gotchas.

Changed

  • tools/config.py: get_youtube_client_secrets_file(), get_youtube_token_dir().
  • tools/requirements.txt: google-api-python-client, google-auth-oauthlib, google-auth-httplib2.
  • Registry entries (tools.youtube_upload, commands.publish), CLAUDE.md publishing section, .env.example.
  • .gitignore: ignores the _internal/.youtube/ OAuth token cache (refresh tokens are secrets).

Auth model

Uploads act on behalf of a channel, so this uses OAuth 2.0 (Desktop-app client), not an API key. First run does a browser consent (--auth); the refresh token is cached and reused silently afterward.

Testing

Live-tested end-to-end against a real channel:

  • --help, --dry-run, and registry JSON parse — verified.
  • Real uploads of a 60s render: requested unlisted → stayed unlisted; requested publicprocessed and stayed public (no rejection). Test videos deleted afterward.
  • Note on the docs' "unaudited projects are restricted to private" rule: in practice it targets third-party apps uploading to other channels — first-party uploads (own Cloud project + own channel + own account) publish public/scheduled fine without an audit. The tool reports the actual returned privacyStatus as the source of truth.

Notes for maintainers

  • All google-* deps are optional and only imported by this tool (graceful ImportError hint if missing).
  • No secrets in the diff; the token cache and client secret live under the gitignored _internal/.youtube/.

🤖 Generated with Claude Code

robertstrobl and others added 2 commits June 9, 2026 20:24
Adds the toolkit's first publishing capability: upload a rendered video to
YouTube via the Data API v3.

- tools/youtube_upload.py: OAuth 2.0 installed-app flow with silent token
  refresh (per-account cache), resumable upload with exponential-backoff
  retry, optional thumbnail/captions/playlist, and private/unlisted/public
  or scheduled (publishAt) visibility. Flags for --auth, --dry-run, --json-out.
- /publish command: guided workflow that auto-fills title/description/tags
  from a project's project.json, dry-runs, uploads, and writes back the URL.
- config.py: get_youtube_client_secrets_file(), get_youtube_token_dir().
- docs/youtube-upload.md: Google Cloud Console walkthrough, quota math, and
  the unverified-app private-lock / 7-day token gotchas.
- Wiring: requirements (google-api-python-client/auth-oauthlib/auth-httplib2),
  registry entries, CLAUDE.md publishing section, .env.example, and a
  .gitignore rule for the _internal/.youtube/ token cache.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The pre-upload warning and docs asserted that unverified apps force every
upload to private. Verified empirically that first-party uploads (own Cloud
project + own channel + own account) publish public/scheduled fine without an
audit — the lock mainly targets third-party apps uploading to other channels.

Rewords the runtime warning, module comment, docs/youtube-upload.md, CLAUDE.md,
and .env.example to say public uploads MAY be locked (chiefly cross-account),
and to treat the tool's actual returned privacyStatus as the source of truth.

Co-Authored-By: Claude Opus 4.8 (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.

2 participants