Skip to content

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.

Notifications You must be signed in to change notification settings

MrMehulkhanna/youtube-to-mp3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

[Bot Image]

youtube-to-mp3

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.

Features:

  • 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.

Instructions:

  1. Send a YouTube link to the bot using the /download command.
  2. The bot will process the link, download the audio, and send it back to the chat.
  3. Enjoy your music!

Requirements:

  • Pyrogram
  • Pydub
  • Pytube3

Setup:

1. Clone the repository:

git clone https://github.com/MrMehulkhanna/youtube-to-mp3 && cd youtube-to-mp3

2. Edit the environment variables:

vi .env

Press I on the keyboard for editing env PressCtrl+C when you're done with editing env and :wqto save the env

3. All dependencies already installed:

source venv/bin/activate

4.Run the bot script:

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

Contribution:

Feel free to contribute to this project by creating issues, suggesting enhancements, or submitting pull requests.

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published