A clean, fast, production-ready Telegram bot that converts YouTube videos into MP3.
This bot works in private chats and groups, supports command-based usage + inline buttons, and shows a clean preview card (thumbnail, title, duration) before downloading.
✅ Built for Termux (Android) + Python 3.12+
✅ Lightweight dependencies
✅ No aiogram • No Rust dependency
- Convert YouTube videos to MP3
- Group command support with reply-style response
- Private chat button-based download flow
- Preview card before download:
- Thumbnail image
- Video title
- Duration
- Inline Download MP3 button
- Clean temporary file handling
- Fast + stable performance
- Termux friendly
Send this command in a group:
/download_mp3 https://youtu.be/VIDEO_IDThe bot replies directly to the command message with:
- Thumbnail
- Title
- Duration
- Download MP3 button
- Start the bot
- Press Download MP3
- Send a YouTube video link
- Press Download MP3 from the preview
- Python 3.12+
- ffmpeg
- Telegram Bot Token
pkg update -y && pkg upgrade -y
pkg install -y python ffmpeg gitpip install -U pip
pip install pytelegrambotapi yt-dlp aiofilesClone the repository:
git clone https://github.com/algoanhaf/MP3.git
cd MP3python bot_mp3.pynohup python bot_mp3.py > bot.log 2>&1 &- If downloads fail, confirm
ffmpegis installed and accessible in PATH. - For Termux, allow storage if you need local file access:
termux-setup-storage
- Keep temp files in a dedicated folder and clean up after sending.
