YouTube Upload Automation
MoneyPrinter can automatically upload generated videos to YouTube using the YouTube Data API v3.Overview
YouTube upload requires:- Google Cloud Project with YouTube Data API enabled
- OAuth 2.0 credentials (
client_secret.json) - First-time authentication to authorize the app
- Enable automation in video generation settings
Setup
1. Create Google Cloud Project
Go to Google Cloud Console
Visit console.cloud.google.com
Enable YouTube Data API v3
- Navigate to APIs & Services → Library
- Search for “YouTube Data API v3”
- Click Enable
Configure OAuth consent screen
Navigate to APIs & Services → OAuth consent screen:
- User Type: External
- App name: MoneyPrinter
- User support email: Your email
- Developer contact: Your email
- Click Save and Continue
- Add scope:
https://www.googleapis.com/auth/youtube.upload - Add scope:
https://www.googleapis.com/auth/youtube - Add scope:
https://www.googleapis.com/auth/youtubepartner
- Add your Google account email
- Click Save and Continue
2. Install Credentials
Rename and place the downloaded file:3. First-Time Authentication
Run a test generation with YouTube upload enabled:- Log in to your Google account
- Review requested permissions
- Click Allow
- Browser will show “The authentication flow has completed”
Backend/main.py-oauth2.json for future uploads.
How It Works
Authentication Flow
MoneyPrinter uses OAuth 2.0 with stored credentials:Backend/youtube.py
Required Scopes
Backend/youtube.py
Upload Process
The pipeline callsupload_video when automateYoutubeUpload is enabled:
Backend/pipeline.py
Upload Implementation
Backend/youtube.py
Resumable Upload
Large video files use resumable upload with retry logic:Backend/youtube.py
Video Metadata
Generated by AI
Title, description, and keywords are auto-generated:Backend/gpt.py
Video Categories
YouTube category IDs:| ID | Category |
|---|---|
| 1 | Film & Animation |
| 2 | Autos & Vehicles |
| 10 | Music |
| 15 | Pets & Animals |
| 17 | Sports |
| 19 | Travel & Events |
| 20 | Gaming |
| 22 | People & Blogs |
| 23 | Comedy |
| 24 | Entertainment |
| 25 | News & Politics |
| 26 | Howto & Style |
| 27 | Education |
| 28 | Science & Technology (default) |
Backend/pipeline.py:
Privacy Status
Options:private: Only you can see the videounlisted: Anyone with the link can see itpublic: Everyone can see it
Enable/Disable Upload
Via UI
Toggle “Automate YouTube Upload” checkbox in Advanced Options.Via API
Default Behavior
Ifclient_secret.json is missing, upload is skipped with a warning:
Troubleshooting
OAuth consent screen not approved
OAuth consent screen not approved
Error:Solution:
- Go to OAuth consent screen in Google Cloud Console
- Under Test users, add your Google account
- Or submit app for verification (takes days)
Invalid client secret
Invalid client secret
Error:Solution:
- Re-download credentials from Google Cloud Console
- Ensure file is named exactly
client_secret.json - Place in
Backend/directory
Quota exceeded
Quota exceeded
Error:Cause: YouTube Data API has daily quotas:
- Free tier: 10,000 units/day
- Video upload: ~1,600 units
- ~6 uploads/day on free tier
- Wait 24 hours for quota reset
- Request quota increase in Google Cloud Console
- Use multiple Google Cloud projects
Upload fails with 401 error
Upload fails with 401 error
Error:Solution:Delete the OAuth token and re-authenticate:Run next upload to trigger re-authentication.
Browser auth doesn't open
Browser auth doesn't open
Running on a server without a display?Solution: Use OAuth out-of-band flow (requires code changes):
Backend/youtube.py
Advanced Configuration
Custom Thumbnails
MoneyPrinter doesn’t currently generate thumbnails, but you can add support:Backend/youtube.py
Playlists
Add uploaded videos to a playlist:Backend/youtube.py
Scheduled Publishing
Set a publish time:Next Steps
Generating Videos
Complete video generation guide
Background Music
Add music to your videos
Pipeline
Video generation pipeline details
Troubleshooting
Common issues and solutions