From 9f6be384fccd58d6f8ac890205bfa259549897cc Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Sat, 23 May 2026 09:48:03 -0400 Subject: [PATCH] toolchain/youtube: zero-dep YouTube Data API CLI (auth, upload) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds yt.mjs — a zero-dependency Node CLI for posting to the aesthetic.computer YouTube channel via YouTube Data API v3. OAuth client + token live in the vault, never the repo. Pairs with the new pop/dance youtube-format visualizer; the trancenwaltz upload at youtu.be/RBG3k_XsfLA was the first run. Co-Authored-By: Claude Opus 4.7 (1M context) --- toolchain/youtube/README.md | 71 ++++++ toolchain/youtube/yt.mjs | 434 ++++++++++++++++++++++++++++++++++++ 2 files changed, 505 insertions(+) create mode 100644 toolchain/youtube/README.md create mode 100644 toolchain/youtube/yt.mjs diff --git a/toolchain/youtube/README.md b/toolchain/youtube/README.md new file mode 100644 index 000000000..d421a4557 --- /dev/null +++ b/toolchain/youtube/README.md @@ -0,0 +1,71 @@ +# YouTube posting pipeline + +Scripted uploads to the aesthetic.computer YouTube channel +(signed in as **mail@aesthetic.computer**). Zero npm dependencies — +`yt.mjs` talks to the YouTube Data API v3 directly over `fetch`. + +## One-time setup + +Credentials live in the **vault**, never in this repo: + +``` +aesthetic-computer-vault/youtube/client.json OAuth client (Desktop app) +aesthetic-computer-vault/youtube/token.json saved refresh token +``` + +1. **Enable the API.** [console.cloud.google.com](https://console.cloud.google.com) + → project `aesthetic-computer` → APIs & Services → Library → + enable **YouTube Data API v3**. +2. **Make an OAuth client.** APIs & Services → Credentials → + Create credentials → OAuth client ID → Application type + **Desktop app**. Download the JSON, save it as + `aesthetic-computer-vault/youtube/client.json`. + - If the consent screen isn't configured yet, set it up as + **External**, add `mail@aesthetic.computer` as a test user + (the app can stay in "testing" — test-user refresh tokens + issued to a Desktop client don't expire on the 7-day clock). +3. **Authorize.** + + ```bash + node toolchain/youtube/yt.mjs auth + ``` + + A browser opens — sign in as **mail@aesthetic.computer**, approve. + The refresh token is written to the vault. Done once; uploads are + fully scripted afterward. + +## Commands + +```bash +# confirm which channel is wired up +node toolchain/youtube/yt.mjs whoami + +# upload (defaults to PRIVATE so you review in YouTube Studio first) +node toolchain/youtube/yt.mjs upload \ + --title "..." \ + --description-file \ + --tags trance,waltz,aesthetic-computer \ + --privacy private \ + --category 10 \ + --thumbnail +``` + +Flags: `--title` (required), `--description` / `--description-file`, +`--tags a,b,c`, `--privacy private|unlisted|public` (default +`private`), `--category` (default `10` = Music), `--thumbnail`, +`--playlist `, `--made-for-kids`. + +Every upload drops a `