A feature rich and blazingly fast Discord bot for playing music from YouTube.
Installation • Features • Support • Contribution • Cloud Deployment • Testing • Commands • Environment Variables
demo.mp4
- Search Songs: Search for songs on YouTube.
- Play Songs: Play songs or playlists directly by title or URL.
- Queue Management: Add, remove, or view songs in the queue.
- Volume Control: Adjust the playback volume.
- Playback Control: Pause, resume, skip, loop and shuffle songs.
- Favourites: Mark songs as favourites and view or play them later.
- Bot Management: For bot owners to manage the bot's life cycle, performance and data.
-
Ensure you have Python 3.12 and Git installed.
-
Clone the repository:
git clone https://github.com/SenZmaKi/YTMusicBot.git cd YTMusicBot
-
Create a virtual environment:
python -m venv .venv
-
Activate the virtual environment:
- Windows
.venv\Scripts\activate
- Linux/Mac
source .venv/bin/activate
-
Install the required dependencies:
pip install -r requirements.txt
-
Install FFmpeg
-
Windows
winget install Gyan.FFmpeg
-
Mac
brew install ffmpeg
-
Linux
Use your distro's package manager
-
-
Configure random songs:
python -m ytmusicbot.youtube --configure-random-songs
-
Optionally you can use custom random songs.
- Create a
custom_random_songs_config.json
file in the project root directory with the following format:
[ { "artist": "Sauti Sol", "playlist_url": "https://www.youtube.com/watch?v=Or2sMfOcTtw&list=RDEMGKSEWOD6zbF-FHc_dLYrPg&start_radio=1" }, { "artist": "Cigarettes After Sex", "playlist_url": "https://www.youtube.com/watch?v=Or2sMfOcTtw&list=RDEMGKSEWOD6zbF-FHc_dLYrPg&start_radio=1" } ]
-
Then run
python -m ytmusicbot.youtube --configure-random-songs
- Create a
-
-
Run the bot:
python -m ytmusicbot.discord
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a detailed description of the changes.
- You can support the development of YTMusicBot through donations on GitHub Sponsors.
- You can also leave a star on the github for more discord degens to know about it.
- YTMusicBot is open to pull requests, so if you have ideas for improvements, feel free to contribute!
The cloud deployment scripts are located in the YTMusicBot/cloud
directory.
The install.sh
script installs the bot and its dependencies.
-
Create a
.env
file with your configuration then runcurl https://raw.githubusercontent.com/SenZmaKi/YTMusicBot/master/cloud/install.sh | bash
The kill.sh
script terminates the background bot process.
The run.sh
script starts the bot.
The nohup.sh
script runs the bot in the background.
-
Install development requirements:
pip install -r dev-requirements.txt
-
Run tests:
pytest