This repository documents and implements a fully automated video pipeline that connects a website, Google Drive, GitHub Actions, and YouTube to create a private/unlisted video hosting system with automatic website integration.
The system is designed to:
- Handle large video uploads efficiently
- Avoid server bandwidth costs
- Use YouTube as a backend streaming CDN
- Automatically embed uploaded videos on a website
Website Upload
↓
Google Drive (pending folder)
↓
GitHub Actions Automation
↓
YouTube (Private / Unlisted)
↓
Metadata Store (DB / JSON / API)
↓
Website Auto Embed
Each component is loosely coupled to ensure reliability and scalability.
/video-system
├── pending/ # New uploads from website
├── processing/ # Video currently being uploaded
├── uploaded/ # Successfully uploaded videos
└── failed/ # Failed uploads (retry/debug)
Drive folders act as a queue + visual status tracker.
- User uploads a video on the website
- Website uses Google OAuth 2.0 (
drive.filescope) - Video uploads directly from browser to Google Drive
- File is placed in the
pending/folder
- No server load
- Supports large files
- Upload resume supported
The pending/ folder represents videos waiting for processing.
Rule:
Automation only reads from
pending/
GitHub Actions acts as a serverless worker.
- Scan
pending/folder - Move file to
processing/ - Upload video to YouTube
- Generate metadata
- Notify website backend
- Move file to
uploaded/orfailed/
- Privacy:
privateorunlisted - OAuth 2.0 with refresh token
videoId- Upload timestamp
- Privacy status
Generated link:
https://www.youtube.com/watch?v=VIDEO_ID
After upload, automation generates a metadata record.
- video_id
- youtube_url
- original_filename
- drive_file_id
- upload_time
- status
This metadata is the brain of the system.
Automation sends metadata to website backend via API (POST request).
Website:
- Saves metadata in DB
- Automatically renders video player
<iframe src="https://www.youtube.com/embed/VIDEO_ID" allowfullscreen></iframe>User sees video on website, YouTube handles streaming.
- On success → move to
uploaded/ - On failure → move to
failed/
Folders = logs Metadata = truth
- No API keys in frontend
- OAuth tokens stored as GitHub Secrets
- Limited Drive scope (
drive.file) - Videos not public by default
- Website: Any (React / HTML / PHP / etc.)
- Storage Queue: Google Drive
- Automation: GitHub Actions
- Video CDN: YouTube
- Backend Metadata: API / DB / JSON
- Role-based access
- Paid video locking
- Analytics sync
- AI tagging & thumbnails
- Retry & rate-limit handling
This project is not just automation — it is the foundation of a private video distribution platform.
Simple components. Strong architecture. Zero unnecessary complexity.