Add YouTube upload pipeline (tools/youtube_upload.py + /publish)#29
Open
dascope wants to merge 2 commits into
Open
Add YouTube upload pipeline (tools/youtube_upload.py + /publish)#29dascope wants to merge 2 commits into
dascope wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the toolkit's first publishing capability: upload a rendered video to YouTube via the Data API v3, with a guided
/publishworkflow that fills metadata from a project'sproject.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, andprivate/unlisted/publicor scheduled (publishAt) visibility. Flags include--auth,--dry-run,--json-out,--account./publishcommand (.claude/commands/publish.md) — locates a project's render, drafts title/description/tags, dry-runs, uploads, and writes the resulting video URL back toproject.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.tools.youtube_upload,commands.publish),CLAUDE.mdpublishing 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.unlisted→ stayed unlisted; requestedpublic→ processed and stayed public (no rejection). Test videos deleted afterward.privacyStatusas the source of truth.Notes for maintainers
google-*deps are optional and only imported by this tool (graceful ImportError hint if missing)._internal/.youtube/.🤖 Generated with Claude Code