An automation tool built using Node.js, Puppeteer, and Gemini AI, designed to download videos, generate YouTube-optimized metadata (title, description, hashtags), and upload them automatically — all without touching your mouse or keyboard!
-
🔽 Download Videos
- Fetches video URLs from your MongoDB database.
- Downloads videos into the
media/folder using APIHut API. - Just run:
npm run download
-
📤 Upload Videos to YouTube
- Automatically uploads videos from the
media/folder to YouTube. - Uses Gemini API to generate viral titles, descriptions, and hashtags.
- Fully automates the upload via Puppeteer: no manual interaction needed.
- Supports batch uploading and configuration via
settings.js. - To start upload:
npm run upload
- Automatically uploads videos from the
-
🧹 Flush Videos Folder
- Deletes all videos from the
videos/folder (cleanup helper). - Run:
npm run flush
- Deletes all videos from the
💡 For best YouTube reach, it's recommended to upload 1 video per day instead of bulk uploading all at once (though it's supported).
media/→ Downloaded videos (used for uploading)videos/→ Raw videos (must be moved tovideos/before uploading)settings.js→ Control visibility (public/private/unlisted), audience (made for kids or not), etc.
- Pulls videos from your MongoDB DB and downloads them via APIHut.
- Uses the filename as a base to generate metadata using Gemini API:
- Title
- Description
- Hashtags
- Opens a Chromium browser via Puppeteer.
- Uploads videos to YouTube with complete automation.
Create a .env file in your root directory and fill in the following:
GEMINI_API_KEY=your_gemini_api_key
YOUTUBE_ACCOUNT_EMAIL=your_email@gmail.com
YOUTUBE_ACCOUNT_PASSWORD=your_password
YOUTUBE_ACCOUNT_RECOVERY_EMAIL=your_recovery_email@gmail.com
MONGO_URI=your_mongo_connection_string
APIHUT_KEY=your_apihut_api_keyBuy Me a Pizza or Coffee 🥹