A WhatsApp bot that automatically detects Instagram links, downloads videos, and sends them back to users.
- Automatic Instagram link detection (Posts, Reels, Stories)
- Video downloading using yt-dlp
- Session persistence with encrypted credentials
- Automatic temporary file cleanup
- Cross-platform support (Windows/Linux)
- Node.js v20+
- yt-dlp 2025+
- FFmpeg (latest stable version)
- WhatsApp mobile app (for initial QR scan)
git clone https://github.com/yourusername/whatsapp-video-bot.git
cd whatsapp-video-botnpm installCreate .env file in root directory:
LOCATION=./temp/ # Always include trailing slashwinget install yt-dlpRestart your computer after installation
# Install yt-dlp
sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp
# Install FFmpeg
sudo apt update
sudo apt install ffmpeg- Start the bot:
node main.js-
Scan QR code using WhatsApp mobile app:
- Open WhatsApp → Settings → Linked Devices → Link a Device
-
Send Instagram link to bot:
https://www.instagram.com/reel/CxYzABC123/ -
Receive downloaded video within 1-2 minutes
Edit .env file:
# Required
LOCATION=./temp/
# Optional Proxy Configuration
# PROXY=http://yourproxy:8080
# USER_AGENT="Mozilla/5.0 ..."| OS | Status | Notes |
|---|---|---|
| Windows 10/11 | Verified | Requires winget |
| Ubuntu 22.04 | Verified | Needs manual updates |
| macOS | Untested | Community help needed |
-
"Command not found" errors
- Verify installation paths
- Reinstall yt-dlp/FFmpeg
-
Login session expires
- Delete
authfolder and restart bot
- Delete
-
Large file failures
NODE_OPTIONS=--max-old-space-size=4096We welcome contributions! Current priorities:
- Add Facebook support
- Implement YouTube Shorts download
- Improve error handling
- Add progress tracking
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
Important Notes
- First run requires QR login
- Terminate and restart after initial setup
- Temporary files auto-delete after sending