Skip to content

Commit 65ea545

Browse files
committed
updated to (BETA) v0.6
Many updates and bug fixes. Removed some unneeded functions and expanded on a few. Changed to token credentials.
1 parent 72e763e commit 65ea545

File tree

4 files changed

+461
-340
lines changed

4 files changed

+461
-340
lines changed

Dockerfile

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Use the official Python base image
2+
FROM python:3.11.2
3+
4+
# Install FFmpeg
5+
RUN apt-get update && \
6+
apt-get install -y ffmpeg
7+
8+
# Set the working directory
9+
WORKDIR /app
10+
11+
# Copy the requirements file into the container
12+
COPY requirements.txt .
13+
14+
# Install the dependencies
15+
RUN pip install --no-cache-dir -r requirements.txt
16+
17+
# Copy the entire project into the container
18+
COPY . .
19+
20+
# Expose the port the bot will use (optional)
21+
EXPOSE 32400
22+
23+
# Run the bot script
24+
CMD ["python", "plex_music_bot.py"]
25+

README.md

+42-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Plex Music Bot (BETA) v0.5
1+
# Plex Music Bot (BETA) v0.6
22
This Discord bot allows users to play audio from their Plex library and YouTube videos in a voice channel.
33
![Now Playing!](images/embed.PNG)
44

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

2424
- `!playlist`: List all available playlists and play songs from the chosen playlist by selecting its number.
2525
(This is one of the most powerful commands because you can setup playlists in Plex then quickly start playing them.)
26-
(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)
2726

28-
- `!show_queue`: Display the current song queue with song titles and artists.
27+
- `!queue`: Display the current song queue with song titles and artists.
2928

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

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

3433
- `!skip`: Skip the current song and play the next song in the queue.
35-
(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)
3634

3735
- `!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.
3836
(Youtube search is very slow and buggy. providing a link is the best option. Playlists are currently broken dont try to play them.)
@@ -44,9 +42,10 @@ This Discord bot allows users to play audio from their Plex library and YouTube
4442
- `!help <command>`: Show more detailed information on a specific command.
4543

4644
# Prerequisites
47-
Python 3.11 or higher
45+
Python 3.11.2 or higher
4846
A Discord bot token
4947
A Plex server with valid credentials
48+
(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.)
5049

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

5655
Change the working directory to the project folder.
5756

57+
Add your cridentials to the config.py or set them up how you like.
58+
5859
cd your-repo
5960

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

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

66-
# Install the required dependencies.
69+
- Clone this repository or download it as a ZIP file and extract it:
70+
71+
git clone https://github.com/kalebbroo/plex_music_bot.git
72+
Change the working directory to the project folder:
73+
74+
- cd plex_music_bot
75+
76+
- Build the Docker image:
77+
Copy code
78+
docker build -t plex_music_bot .
79+
80+
- Run the Docker container
81+
82+
docker run -d --name plex_music_bot
6783

68-
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'.
84+
# Install the required dependencies.
6985

70-
2. Install the Python dependencies by running pip install -r requirements.txt.
86+
pip install -r requirements.txt
7187

72-
3. Enter your credentials into config.py or set them as environment variables.
88+
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'.
7389

90+
Enter your cridentials into config.py or use environment variables.
7491

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

127144
python plex_music_bot.py
128145

146+
Using Docker:
147+
Rebuild the Docker image:
148+
149+
docker build -t plex_music_bot .
150+
Stop the running container:
151+
152+
docker stop plex_music_bot
153+
Remove the stopped container:
154+
155+
docker rm plex_music_bot
156+
Run the updated Docker container:
157+
158+
docker run -d --name plex_music_bot
159+
129160
# Contributing
130161
Feel free to submit issues, feature requests, or pull requests to contribute to this project.
131162

132-
# Join the Discord and test the bot
133-
134-
https://discord.gg/CmrFZgZVEE
163+
# Join the Discord for Support
164+
https://discord.gg/CmrFZgZVEE

0 commit comments

Comments
 (0)