Skip to content

Commit

Permalink
updated to (BETA) v0.6
Browse files Browse the repository at this point in the history
Many updates and bug fixes. Removed some unneeded functions and expanded on a few. Changed to token credentials.
  • Loading branch information
kalebbroo committed Apr 30, 2023
1 parent 72e763e commit 65ea545
Show file tree
Hide file tree
Showing 4 changed files with 461 additions and 340 deletions.
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use the official Python base image
FROM python:3.11.2

# Install FFmpeg
RUN apt-get update && \
apt-get install -y ffmpeg

# Set the working directory
WORKDIR /app

# Copy the requirements file into the container
COPY requirements.txt .

# Install the dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy the entire project into the container
COPY . .

# Expose the port the bot will use (optional)
EXPOSE 32400

# Run the bot script
CMD ["python", "plex_music_bot.py"]

54 changes: 42 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Plex Music Bot (BETA) v0.5
# Plex Music Bot (BETA) v0.6
This Discord bot allows users to play audio from their Plex library and YouTube videos in a voice channel.
![Now Playing!](images/embed.PNG)

Expand All @@ -23,16 +23,14 @@ This Discord bot allows users to play audio from their Plex library and YouTube

- `!playlist`: List all available playlists and play songs from the chosen playlist by selecting its number.
(This is one of the most powerful commands because you can setup playlists in Plex then quickly start playing them.)
(Some issues I have with this command are songs repeating until they get skipped not sure why yet. I may make it so they get shuffled)

- `!show_queue`: Display the current song queue with song titles and artists.
- `!queue`: Display the current song queue with song titles and artists.

- `!shuffle`: Randomly shuffle the current song queue.

- `!artist <artist name>`: Queue all songs by the specified artist from your Plex library.

- `!skip`: Skip the current song and play the next song in the queue.
(I am having a strange issue where it will skip the song but then the next song after that gets added to the bottom of the queue)

- `!youtube <YouTube URL or search query>`: Play audio from a YouTube video using its URL, or search for a video or playlist and play the first result.
(Youtube search is very slow and buggy. providing a link is the best option. Playlists are currently broken dont try to play them.)
Expand All @@ -44,9 +42,10 @@ This Discord bot allows users to play audio from their Plex library and YouTube
- `!help <command>`: Show more detailed information on a specific command.

# Prerequisites
Python 3.11 or higher
Python 3.11.2 or higher
A Discord bot token
A Plex server with valid credentials
(I have moved to using a plex token and base-url for cridentials. I have left the option to login using username and password you just have to uncomment it.)

# Installation
Clone this repository or download it as a ZIP file and extract it.
Expand All @@ -55,22 +54,40 @@ git clone https://github.com/kalebbroo/plex_music_bot.git

Change the working directory to the project folder.

Add your cridentials to the config.py or set them up how you like.

cd your-repo

(only do the below steps if you are using a virtual environment)
Create a virtual environment and activate it.
python -m venv venv
source venv/bin/activate # For Windows: venv\Scripts\activate

# Docker Installation (recommended)
- Install Docker on your system by following the instructions from the official Docker documentation.

# Install the required dependencies.
- Clone this repository or download it as a ZIP file and extract it:

git clone https://github.com/kalebbroo/plex_music_bot.git
Change the working directory to the project folder:

- cd plex_music_bot

- Build the Docker image:
Copy code
docker build -t plex_music_bot .

- Run the Docker container

docker run -d --name plex_music_bot

1. Install ffmpeg. Depending on your operating system, you may be able to install ffmpeg using your package manager. For example, on Ubuntu or Debian, you can run 'sudo apt-get install ffmpeg' to install ffmpeg. On macOS, you can use Homebrew by running 'brew install ffmpeg'.
# Install the required dependencies.

2. Install the Python dependencies by running pip install -r requirements.txt.
pip install -r requirements.txt

3. Enter your credentials into config.py or set them as environment variables.
Install ffmpeg. Depending on your operating system, you may be able to install ffmpeg using your package manager. For example, on Ubuntu or Debian, you can run 'sudo apt-get install ffmpeg' to install ffmpeg. On macOS, you can use Homebrew by running 'brew install ffmpeg'.

Enter your cridentials into config.py or use environment variables.

# Environment Variables
(This is optional if you use the config.py you dont need to do this)
Expand Down Expand Up @@ -126,9 +143,22 @@ Restart the bot by stopping the current instance and running it again.

python plex_music_bot.py

Using Docker:
Rebuild the Docker image:

docker build -t plex_music_bot .
Stop the running container:

docker stop plex_music_bot
Remove the stopped container:

docker rm plex_music_bot
Run the updated Docker container:

docker run -d --name plex_music_bot

# Contributing
Feel free to submit issues, feature requests, or pull requests to contribute to this project.

# Join the Discord and test the bot

https://discord.gg/CmrFZgZVEE
# Join the Discord for Support
https://discord.gg/CmrFZgZVEE
Loading

0 comments on commit 65ea545

Please sign in to comment.