A simple Telegram bot that allows users to search for music on YouTube and download it as MP3 directly from Telegram.
Built with Python, python-telegram-bot, and yt-dlp.
- Search YouTube for songs or artists directly from Telegram.
- Browse search results with an inline pagination keyboard.
- Download selected songs as MP3 with title and artist info.
- Simple and lightweight — runs locally or on cloud platforms like Railway.
- Fully open-source and easy to set up.
- Start the bot with
/start. - Send a message with a song or artist name (e.g.,
Coldplay Viva La Vida). - Select the song you want from the results.
- The bot will download it and send the MP3 directly to you.
- Clone the repository:
git clone https://github.com/askoti/telegram-bot.git
cd telegram-bot- Create a virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate # Linux/macOS
venv\Scripts\activate # Windows
pip install -r requirements.txt- Create a .env file with your Telegram bot token:
TELEGRAM_TOKEN=your_bot_token_here- Run the bot:
python main.pyThis bot can be deployed on platforms like:
- Railway
- Render
- Heroku (classic)
Simply push your repo, add the .env environment variable with your token, and start the bot.
- Python 3.10+
- yt-dlp
- FFmpeg installed in the system path (for MP3 conversion)
- Some videos may be restricted due to region or login requirements — these will be skipped automatically.
- This is a demo version, safe to share publicly. Users must provide their own Telegram bot token.
Contributions are welcome! Feel free to open issues or submit pull requests to enhance features.