This repository contains the source code for a music bot built using Python, Pyrogram, and Pydub. The bot is designed to download audio from YouTube links and send them as playable audio files on Telegram.
- YouTube Link Processing: Accepts YouTube links and extracts audio for download.
- Audio Conversion: Converts downloaded audio to MP3 format for easy playback.
- Telegram Integration: Sends the converted audio file to the Telegram chat.
- Send a YouTube link to the bot using the
/download
command. - The bot will process the link, download the audio, and send it back to the chat.
- Enjoy your music!
- Pyrogram
- Pydub
- Pytube3
git clone https://github.com/MrMehulkhanna/youtube-to-mp3 && cd youtube-to-mp3
vi .env
Press I
on the keyboard for editing env
PressCtrl+C
when you're done with editing env and :wq
to save the env
source venv/bin/activate
python youtube-to-mp3.py
it asks "Enter phone number or bot token: "put bot_token only
Install tmux to keep running your bot when you close the terminal by
sudo apt install tmux && tmux
For getting out from tmux session : Press bash Ctrl+b
and bash then d
Feel free to contribute to this project by creating issues, suggesting enhancements, or submitting pull requests.