GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - richardsondx/drive-to-youtube: Upload a video from Google Drive (or a local file) to YouTube from the command line. Resumable upload, metadata, thumbnail, playlist, schedule.

BranchesTags
Open more actions menu

Latest commit

 

History

2 Commits
2 Commits

Folders and files

NameName
Last commit message
Last commit date
drive2yt
drive2yt
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

drive-to-youtube

Upload a video from Google Drive (or a local file) to YouTube from the command line. Resumable upload with retries, metadata, thumbnail, playlist, and scheduling.

What it does

  • Finds a video in Google Drive by file id or exact name, and downloads it.
  • Uploads it to YouTube with a resumable upload that retries server errors.
  • Sets title, description, tags, category, language, privacy, publish time, thumbnail, and playlist.
  • Reads the video back after upload and prints its watch URL.
  • Defaults to unlisted, so nothing goes public by accident.

Setup

You need a Google Cloud project with an OAuth client. This is a one-time setup, about five minutes in the Google Cloud Console.

  1. Create a project at Google Cloud Console.
  2. Enable two APIs in that project: Google Drive API and YouTube Data API v3.
  3. Go to APIs & Services > Credentials > Create Credentials > OAuth client ID, pick Desktop app, and download the JSON.
  4. Save it as ~/.config/drive2yt/client_secret.json.
  5. Install the tool and sign in:
pip install drive2yt
drive2yt auth

drive2yt auth opens Google sign-in in your browser. Sign in with the Google account that owns the YouTube channel you want to upload to. Uploads always go to the signed-in account's channel. The token is stored at ~/.config/drive2yt/token.json and refreshed automatically.

Quota

The YouTube Data API gives a fresh project 10,000 quota units a day. One video upload costs about 1,600 units, so that covers about 6 uploads a day. Request a quota increase in Google Cloud if you need more.

Usage

# Upload a video from Drive by name
drive2yt upload --drive-name "Kyoto Temple Rain.mp4" \
  --title "Kyoto Temple Rain | Engawa Lofi" \
  --description "Rain on a Kyoto temple roof. 50 minutes of calm." \
  --tags "lofi,kyoto,rain sounds" \
  --privacy unlisted

# Upload a Drive file by id, schedule it, set a thumbnail and playlist
drive2yt upload --drive-id 1AbC2dEfGhIjKlMnOpQrStUv \
  --title "My video" --privacy private \
  --publish-at 2026-11-15T14:00:00Z \
  --thumbnail ./thumb.jpg --playlist PLxxxxxxxxxxxxxxxx

# Upload a local file instead
drive2yt upload --file ./clip.mp4 --title "My video" --privacy public

# Look up a Drive file without uploading
drive2yt find --drive-name "Kyoto Temple Rain.mp4"

# Check the metadata without uploading
drive2yt upload --drive-name "clip.mp4" --title "Test" --dry-run

Common category ids: 22 People & Blogs, 27 Education, 28 Science & Technology, 10 Music, 24 Entertainment, 26 Howto & Style.

A scheduled upload needs --privacy private plus --publish-at. YouTube flips it public at publish time. The publish time must be in the future and in ISO 8601 form, for example 2026-11-15T14:00:00Z.

How uploads work

The upload uses YouTube's resumable upload protocol in 8 MB chunks. On a 500, 502, 503, or 504 error, or a dropped connection, it waits with exponential backoff and retries, up to 10 times. The Drive download is also chunked. A downloaded file is deleted after a successful upload unless you pass --keep-download.

Development

git clone https://github.com/richardsondx/drive-to-youtube
cd drive-to-youtube
pip install -e ".[dev]"
pytest

No live Google credentials are needed for the tests; the YouTube calls are mocked.

License

MIT. See LICENSE.

About

Upload a video from Google Drive (or a local file) to YouTube from the command line. Resumable upload, metadata, thumbnail, playlist, schedule.

Topics

cligoogle-drivepythonyoutubeyoutube-data-api

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.