A minimal CLI for uploading videos to YouTube — single files or entire directories, powered by the YouTube Data API v3.
Project description
ytee
A minimal CLI tool for uploading videos to YouTube — single files or entire directories — powered by the YouTube Data API v3.
Quickstart
ytee init → ytee set-creds → ytee upload
These three commands are all you need. init must be run before anything else.
Installation
pip install ytee
Requires Python 3.9+.
Setup
1. Get Google API credentials
Before using ytee, you need a Google Cloud project with the YouTube Data API v3 enabled:
- Go to the Google Cloud Console.
- Enable the YouTube Data API v3.
- Create OAuth 2.0 credentials for a Desktop application.
- Download the credentials as a JSON file (e.g.
client_secret.json).
Migration from v0.1.0
If you used ytee version v0.1.0, your credentials were stored under ~/.secrets/. In newer versions, ytee now stores credentials in ~/.ytee/.google_secrets/.
Run the migration command once before using ytee :
ytee migrate
This moves client_secret.json and token.json from ~/.secrets/ into the current ytee secrets directory.
CLI Commands
ytee init — Run this first
Copies your Google OAuth credentials into ~/.ytee/.google_secrets/ so ytee can find them.
ytee init --secret-path /path/to/client_secret.json
| Option | Short | Description |
|---|---|---|
--secret-path |
-sp |
Path to your client_secret.json (required on first run) |
--token-path |
-tp |
Path to an existing token.json (optional) |
⚠️ This must be run at least once before any other command will work.
ytee set-creds — Authenticate with Google
Opens a browser window for Google OAuth authorization and saves the access token to ~/.ytee/.google_secrets/token.json.
ytee set-creds
Run this after init. If your credentials are still valid, they are reused automatically.
ytee verify-creds — Check credential status
Checks whether both client_secret.json and token.json are present.
ytee verify-creds
ytee upload — Upload a video or directory
Upload a single video:
ytee upload --path video.mp4 --name "My Video Title" --desc "My description"
Upload all videos in a directory:
ytee upload --path ./videos --name "Episode - " --desc "My description"
When a directory path is given, ytee automatically detects it and uploads every file inside. Each filename (without extension) is appended to the --name prefix to form the video title. For example, if the directory contains part1.mp4, the title becomes Episode - part1.
| Option | Short | Description |
|---|---|---|
--path |
-p |
Path to a video file or directory |
--name |
-n |
YouTube video title (used as a prefix for directory uploads) |
--desc |
-d |
YouTube video description |
After each successful upload, ytee appends a log entry to ~/.ytee/.uploads/uploaded.txt:
{"path": "videos/part1.mp4", "id": "abc123XYZ"}
Uploads show a live progress table displaying upload speed, file size, time elapsed, and time remaining.
ytee show-uploads — View upload history
ytee show-uploads
Prints the full contents of the upload log at ~/.ytee/.uploads/uploaded.txt.
Full Example Walkthrough
# Step 1 — point ytee to your Google credentials (once)
ytee init --secret-path ~/Downloads/client_secret.json
# Step 2 — authenticate with Google (once, or when token expires)
ytee set-creds
# Step 3 — check credentials are in place (optional)
ytee verify-creds
# Step 4a — upload a single video
ytee upload --path ~/videos/intro.mp4 --name "Introduction" --desc "Welcome to my channel"
# Step 4b — or upload a whole folder
ytee upload --path ~/videos --name "Lecture - " --desc "Course upload"
Notes
- Videos are uploaded as unlisted by default.
- Credentials are stored in
~/.ytee/.google_secrets/(client_secret.jsonandtoken.json). - Upload history is stored in
~/.ytee/.uploads/uploaded.txt. - Directory uploads process files sequentially with a short delay between each upload.
- Batch uploads include all files in the directory regardless of file extension.
- On HTTP 5xx errors,
yteewill retry the upload up to 3 times with a 5-second delay.
Dependencies
| Package | Purpose |
|---|---|
google-api-python-client |
YouTube Data API v3 client |
google-auth-oauthlib |
OAuth 2.0 authentication flow |
rich |
Live progress table and terminal output |
typer |
CLI framework |
pathlib |
Path handling |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ytee-0.1.2.tar.gz.
File metadata
- Download URL: ytee-0.1.2.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f19763d40d3cae95950d964396834bbf638b5f95473e59419101973fa19cbf89
|
|
| MD5 |
83a29d203361b80bab3520214bc83361
|
|
| BLAKE2b-256 |
43325a43e202e410c17c74b34448afec992fd4917b48992bf50f33dcffeca090
|
Provenance
The following attestation bundles were made for ytee-0.1.2.tar.gz:
Publisher:
publish.yml on rooooop5/ytee
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ytee-0.1.2.tar.gz -
Subject digest:
f19763d40d3cae95950d964396834bbf638b5f95473e59419101973fa19cbf89 - Sigstore transparency entry: 1436952700
- Sigstore integration time:
-
Permalink:
rooooop5/ytee@e071841dad907368653418f7edc1722dc8fc816c -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/rooooop5
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e071841dad907368653418f7edc1722dc8fc816c -
Trigger Event:
push
-
Statement type:
File details
Details for the file ytee-0.1.2-py3-none-any.whl.
File metadata
- Download URL: ytee-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
688b2cefdbd39bfea7b5201c2c06644a57c08cc797cd86ec88e6fc0c5617faec
|
|
| MD5 |
4208fae677548ca0eb5e1814aa4d49cb
|
|
| BLAKE2b-256 |
aafa41cdc5ef09a2757be124de71f1eec0dbebf4c29b565c413540bbd80dc1e7
|
Provenance
The following attestation bundles were made for ytee-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on rooooop5/ytee
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ytee-0.1.2-py3-none-any.whl -
Subject digest:
688b2cefdbd39bfea7b5201c2c06644a57c08cc797cd86ec88e6fc0c5617faec - Sigstore transparency entry: 1436952711
- Sigstore integration time:
-
Permalink:
rooooop5/ytee@e071841dad907368653418f7edc1722dc8fc816c -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/rooooop5
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e071841dad907368653418f7edc1722dc8fc816c -
Trigger Event:
push
-
Statement type: