☁️ Cloud-side companion for Mesin Cuan — polls Google Drive, uploads to YouTube, sends Telegram notifications.
Part of the Mesin Cuan two-step architecture:
Mesin Cuan (local) → renders videos → GDrive Queue
↓
Mesin Cuan Uploader (Koyeb)
polls GDrive every 5 min
↓
YouTube Upload
with paced scheduling
This separation prevents YouTube from detecting bulk uploads from a single IP — the uploader runs on a cloud IP, paced 60s between uploads.
- GDrive polling — checks
mesin_cuan/queue/{channel}/every 5 minutes - YouTube upload — resumable upload with metadata, tags, thumbnail, AI-content declaration
- Smart scheduling — respects
publish_attimestamps, skips videos not yet due - Telegram notifications — real-time alerts for upload success, failure, errors
- Daily summary — midnight UTC recap per channel with upload counts
- Health check — HTTP server on port 8080 for Koyeb/Uptime.com keep-alive
- Auto-retry — refresh expired OAuth tokens automatically
On your local machine (where Mesin Cuan runs):
python setup_auth.py --channel ch_id_horrorThis generates data/ch_id_horror/ch_id_horror_token.pickle — encode it to base64:
base64 -w0 data/ch_id_horror/ch_id_horror_token.pickleSet these environment variables:
# Required — base64-encoded OAuth pickle per channel
TOKEN_CH_ID_HORROR=<base64-encoded-token>
TOKEN_CH_ID_PSYCH=<base64-encoded-token>
TOKEN_CH_EN_HORROR=<base64-encoded-token>
TOKEN_CH_EN_PSYCH=<base64-encoded-token>
# Optional — Telegram notifications
TELEGRAM_BOT_TOKEN=<your-bot-token>
TELEGRAM_CHAT_ID=<your-chat-id>
# Port for health check
PORT=8080Point Uptime.com (or Koyeb's built-in health check) to https://your-app.koyeb.app/ — returns JSON with upload stats.
main.py
├── HealthCheckServer (port 8080) → Uptime.com keep-alive
├── process_queue() → runs every 5 min
│ ├── iterate CHANNELS
│ ├── _load_creds_from_env() → decode OAuth from env
│ ├── _find_folder() → locate GDrive folders
│ ├── _download_file() → pull video + metadata
│ ├── _upload_to_youtube() → resumable upload + thumbnail
│ └── _move_to_done() → archive to done/ folder
├── _check_and_send_daily_summary() → midnight UTC recap
└── _send_telegram() → HTML-formatted alerts
MIT — free to use, modify, and distribute.
See LICENSE for full text.
Companion to Mesin Cuan Viral Architect