DEV Community

Andrew Detwiler
Andrew Detwiler

Posted on

I stopped uploading YouTube videos in the browser

I run more than one YouTube channel from one Google account. If you do too, you know the
moment: it is one in the morning, the render finally finished, and the browser upload page
has a small dropdown deciding which channel this video lands on. One dropdown. Whatever your
browser happens to be signed into. I never shipped a video to the wrong channel, but I came
close enough times that I stopped trusting myself with the dropdown at all.

So I moved uploading to the terminal, and I made the safety model the whole point.

channel-cli is three small tools: yt-upload, yt-thumbnail, yt-describe. They
authenticate with a refresh token that is bound to a single channel. --handle is not a
label, it is the security boundary: a token minted for one channel cannot touch any other,
no matter what is signed in anywhere. And before a byte moves, the tool prints the channel's
real name back at you, because a token is an opaque string and a channel title is something
you can recognize as wrong.

Three other choices I made on purpose:

Uploads default to unlisted. Publishing is an outward-facing act and should need someone
to say so. You pass --privacy public explicitly or it does not happen.

yt-describe does not destroy your metadata. This is the one that bites people. The
YouTube API's videos.update replaces the entire snippet, so a script that sends only a new
description silently blanks the title, the tags, the category, and the language. My tool
reads the current snippet, changes the one field you asked for, and passes everything else
back verbatim. If you take nothing else from this post, take that trap.

It refuses em dashes in public copy. They are a common tell of machine-written text, and
I want copy that sounds like a person. There is an --allow-dashes flag, because it is your
channel, not mine.

The honest cost: Google credentials take about twenty minutes to set up, because you create
your own Cloud project and hold your own keys. Nothing is shared with me, which is the
point, but the real trap is that a project left in Testing mode expires its refresh tokens
every seven days. The README walks the whole thing, including that part, because that is
where everyone actually gives up.

MIT, no dependencies, nothing phones home except YouTube itself.
https://github.com/adetwiler/channel-cli

I built this for my own one-in-the-morning problem. If you run more than one channel, it
might be yours too.

Top comments (0)