This project is a WhatsApp bot that allows users to download audio and video from YouTube links using the WhatsApp Business API Sandbox by Meta. The bot can also register user interest and send emails with user details.
- Download audio or video from YouTube links.
- Ensure the file size does not exceed 50MB.
- Register user interest and send details via email.
- Hosted in a Docker container for easy deployment.
- Docker and Docker Compose installed.
- Meta for Developers account.
- WhatsApp Business API Sandbox setup.
git clone https://github.com/stz1981/mediawhatsbot.git
cd mediawhatsbot
- Go to the Meta for Developers website.
- Sign in with your Facebook account.
- Create a new app by navigating to "My Apps" and clicking "Create App".
- Choose the "Business" type and follow the prompts to create your app.
- Add the WhatsApp product to your app and follow the setup instructions.
- Note down your Temporary Access Token, Phone Number ID, and WhatsApp Business Account ID.
Update the docker-compose.yaml
file with your credentials:
environment:
- FLASK_ENV=development
- SECRET_KEY=your_secret_key
- ACCESS_TOKEN=your_temporary_access_token
- PHONE_NUMBER_ID=your_phone_number_id
- [email protected]
- EMAIL_PASS=your_email_password
docker-compose up --build
Send a WhatsApp message to your sandbox number to start interacting with the bot. The bot will guide you through downloading audio or video from YouTube links and registering your interest.
whatsapp-bot/
├── app/
│ ├── bot.py
│ ├── requirements.txt
│ └── Dockerfile
├── docker-compose.yaml
└── volumes/
├── Audio/
└── Video/
This script handles the bot logic, including downloading media, sending WhatsApp messages, and registering user interest.
Lists the required Python packages.
Defines the Docker image, including installing ffmpeg
and ffprobe
.
Configures the Docker services and environment variables.
Feel free to submit issues or pull requests if you have any improvements or bug fixes.
This project is licensed under the MIT License.
Happy coding! 🚀