YouTube Upload from Markdown Notes | Generated by AI
Here’s what was built and wired up:
Created: ww/gen_video/youtube_upload.py
- YouTube upload module that reads a markdown note’s YAML frontmatter for title/description/tags
- Uploads the MP4 to YouTube via the YouTube Data API v3 with resumable upload
- Supports
--public,--unlisted,--credential,--description,--tagsoptions - OAuth 2.0 flow: opens browser for auth, caches token at
~/.google/youtube_token.json - Requires
client_secret.jsonat~/.google/client_secret.json(setup instructions in error message)
Modified: ww/main.py
- gen-video dispatch now checks for
uploadsubcommand before falling through to the existing video generation ww gen-video <file>still works exactly as beforeww gen-video upload <note_path> <mp4_path>routes to the new upload module- Help text updated to show both commands
Modified: ~/.zsh/completions/_ww
- Added
gen_video_cmdsarray withuploadentry - Added case entry for
gen-videoin the subcmd dispatch - Added
gen-video uploadcompletion with file suggestions for*.md(note) and*.mp4(video)
Installed dependencies:
google-api-python-client,google-auth-oauthlibviauv add
Verified:
ww gen-video upload --help— shows proper usageww gen-video --help— old behavior preservedww gen-video upload some_note.md— error: missing mp4_pathww gen-video upload /path/to/note.md /nonexistent/video.mp4— error: video not found- Main help (
ww) shows both gen-video entries
To actually upload, you’ll need to:
- Create a Google Cloud project → enable YouTube Data API v3 → create OAuth 2.0 Desktop credentials
- Save the JSON as
~/.google/client_secret.json - Run
ww gen-video upload notes/your-post.md output.mp4
