YouTube
Purpose
Read public YouTube data (channels, videos with stats, search, playlist items) and write to the authenticated user's channel: upload video files and post top-level comments. Use when the user mentions YouTube or videos.
Tooling
All commands go through bin/youtube.py:
bin/youtube.py auth # verify the OAuth token
bin/youtube.py channel --id UC_abc123 # show a channel
bin/youtube.py video --id dQw4w9WgXcQ # show a video
bin/youtube.py search --query "repair cafe" --limit 10 # search videos
bin/youtube.py playlist-items --playlist-id PL_abc123 --limit 25 # list playlist items
bin/youtube.py upload --file demo.mp4 --title "Demo" --description "..." \
--privacy private \
--confirm 'upload "demo.mp4" as private video "Demo"'
bin/youtube.py comment --video-id dQw4w9WgXcQ --text "Great build!" \
--confirm 'post comment on video dQw4w9WgXcQ: "Great build!"'
The auth check uses the 1-unit /channels?mine=true endpoint, never the expensive search endpoint. upload does a resumable upload in one chunk (session init, then a single PUT of the file bytes); --privacy defaults to private. comment posts a top-level comment as the authenticated channel.
Auth
- Provider id:
youtube (credential is collected as custom.youtube)
- Collection: OAuth 2.0 via the secure credential flow (
credentials.request_api_access); Google Cloud Console OAuth client with the YouTube Data API v3 enabled. The token is sent as Authorization: Bearer <token>.
- Required scopes:
https://www.googleapis.com/auth/youtube.readonly (reads), https://www.googleapis.com/auth/youtube.upload (uploads), https://www.googleapis.com/auth/youtube.force-ssl (comments; this is the scope commentThreads.insert requires). If reads work but writes 403, re-approve with all three scopes.
- Allowed hosts:
www.googleapis.com
- Status check:
bin/youtube.py auth (must return "ok": true)
- Quota binding constraint: YouTube grants 10,000 quota units per day by default.
search costs 100 units per call, a comment costs 50, and an upload costs ~1,600 (reported by secondary sources; not in Google's own docs — treat as approximate), so use them sparingly. Favor the 1-unit reads and cache results aggressively: do not re-run the same lookup twice in a session.
Operating Rules
- Reads (
auth, channel, video, search, playlist-items) need no confirmation.
- Writes need exact-match confirmation on every call.
upload requires --confirm with the exact string the CLI echoes (names the file, the privacy setting, and the title) because it puts a video on the user's channel. comment requires --confirm with its echoed string (video ID plus the first 60 chars of the text) because the comment is public immediately.
- Keep every upload
private by default; only use --privacy public when the user explicitly asks.
- Never exfiltrate the credential: the CLI only ever handles surrogates. Do not print, log, or transmit the token value.
Files
Maturity
🧪 Draft: written from Google's public API docs; not yet live-tested end-to-end. The upload flow (resumable session + byte PUT) and comment path have not been verified in a live flow.
1---2name: "youtube"3description: "Work with YouTube: read channels, videos, search, playlist items; upload videos and post comments (with confirmation). Trigger phrases: youtube, videos, upload video, youtube comment."4metadata:5 source: https://skillmd.com/skills/anil-matcha/youtube6 includeInPrompt: true7tagline: "Read channels and videos, search, plus uploads and comments with confirmation."8catalog_auth: "OAuth 2.0 (per-user)"9catalog_hosts: ["www.googleapis.com"]10---1112# YouTube1314## Purpose15Read public YouTube data (channels, videos with stats, search, playlist items) and write to the authenticated user's channel: upload video files and post top-level comments. Use when the user mentions YouTube or videos.1617## Tooling18All commands go through `bin/youtube.py`:1920```bash21bin/youtube.py auth # verify the OAuth token22bin/youtube.py channel --id UC_abc123 # show a channel23bin/youtube.py video --id dQw4w9WgXcQ # show a video24bin/youtube.py search --query "repair cafe" --limit 10 # search videos25bin/youtube.py playlist-items --playlist-id PL_abc123 --limit 25 # list playlist items2627bin/youtube.py upload --file demo.mp4 --title "Demo" --description "..." \28 --privacy private \29 --confirm 'upload "demo.mp4" as private video "Demo"'30bin/youtube.py comment --video-id dQw4w9WgXcQ --text "Great build!" \31 --confirm 'post comment on video dQw4w9WgXcQ: "Great build!"'32```3334The auth check uses the 1-unit `/channels?mine=true` endpoint, never the expensive search endpoint. `upload` does a resumable upload in one chunk (session init, then a single PUT of the file bytes); `--privacy` defaults to `private`. `comment` posts a top-level comment as the authenticated channel.3536## Auth37- Provider id: `youtube` (credential is collected as `custom.youtube`)38- Collection: OAuth 2.0 via the secure credential flow (`credentials.request_api_access`); Google Cloud Console OAuth client with the YouTube Data API v3 enabled. The token is sent as `Authorization: Bearer <token>`.39- Required scopes: `https://www.googleapis.com/auth/youtube.readonly` (reads), `https://www.googleapis.com/auth/youtube.upload` (uploads), `https://www.googleapis.com/auth/youtube.force-ssl` (comments; this is the scope commentThreads.insert requires). If reads work but writes 403, re-approve with all three scopes.40- Allowed hosts: `www.googleapis.com`41- Status check: `bin/youtube.py auth` (must return `"ok": true`)42- Quota binding constraint: YouTube grants 10,000 quota units per day by default. `search` costs 100 units per call, a comment costs 50, and an upload costs ~1,600 (reported by secondary sources; not in Google's own docs — treat as approximate), so use them sparingly. Favor the 1-unit reads and cache results aggressively: do not re-run the same lookup twice in a session.4344## Operating Rules451. Reads (`auth`, `channel`, `video`, `search`, `playlist-items`) need no confirmation.462. **Writes need exact-match confirmation on every call.** `upload` requires `--confirm` with the exact string the CLI echoes (names the file, the privacy setting, and the title) because it puts a video on the user's channel. `comment` requires `--confirm` with its echoed string (video ID plus the first 60 chars of the text) because the comment is public immediately.473. Keep every upload `private` by default; only use `--privacy public` when the user explicitly asks.484. Never exfiltrate the credential: the CLI only ever handles surrogates. Do not print, log, or transmit the token value.4950## Files51- SKILL.md52- bin/youtube.py5354## Maturity55🧪 Draft: written from Google's public API docs; not yet live-tested end-to-end. The upload flow (resumable session + byte PUT) and comment path have not been verified in a live flow.