A Telegram bot that extracts audio from video files and converts it into your preferred audio format (MP3, WAV, OGG, M4A, or FLAC).
Send a video, pick a format, and get your audio file back — ready to download.
- 🎬 Extracts audio directly from video files sent in Telegram
- 🔄 Converts audio to MP3, WAV, OGG, M4A, or FLAC
- ⏱ Validates video duration (must be under 5 minutes)
- 📦 Validates file size (must be under 300 MB)
- ⚡ Fast processing powered by FFmpeg
- 🧹 Automatic cleanup of temporary files after each conversion
- Python 3.10+
- python-telegram-bot (v21.4)
- FFmpeg for audio extraction and conversion
Before running the bot, make sure you have:
- Python 3.10 or higher installed
- FFmpeg installed and available in your system's
PATH - A Telegram Bot Token (get one from @BotFather)
Ubuntu / Debian
sudo apt update
sudo apt install ffmpegmacOS (Homebrew)
brew install ffmpegWindows
Download from ffmpeg.org and add it to your PATH.
-
Clone the repository
git clone https://github.com/erec2smith/DeepSound.git cd DeepSound -
Create a virtual environment (recommended)
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set your bot token
Open
deepsound.pyand replace the placeholder with your actual token:BOT_TOKEN = "YOUR_BOT_TOKEN_HERE"
💡 For production use, it's recommended to load the token from an environment variable instead of hardcoding it.
-
Run the bot
python deepsound_bot.py
- Start a chat with your bot on Telegram and send
/start - Send a video file (as a video or document)
- The bot validates its duration and size
- Choose your desired audio format from the inline buttons
- Receive your converted audio file, ready to download
| Setting | Default | Description |
|---|---|---|
MAX_DURATION_SECONDS |
300s | Maximum allowed video duration |
MAX_FILE_SIZE_BYTES |
300 MB | Maximum allowed video file size |
FORMATS |
mp3, wav, ogg, m4a, flac | Supported output formats |
These constants can be adjusted directly in deepsound.py.
deepsound-bot/
├── deepsound.py # Main bot logic
├── images/
└── README.md
Contributions, issues, and feature requests are welcome! Feel free to check the issues page or open a pull request.
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
Adem Mzoughi Software Developer
- GitHub: @adem-mzoughi
⭐ If you find this project useful, consider giving it a star on GitHub!
