/plex-observer

Plex observer is a bot discord created for people who have a plex server with limited resources. You can define a number of seats and once the bot is deployed it will let you know which people are connected and therefore which seats are left.

Primary LanguagePythonMIT LicenseMIT

Project Image

Plex Observer

Code style: black Poetry Python 3.11

Plex Observer is a Discord bot that monitors a Plex server and updates the bot's status based on the number of available slots on the server.

🚀 Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Installation

  1. Clone the repo
git clone https://github.com/GuiEpi/plex-observer.git
  1. Navigate to the project directory
cd plex-observer
  1. Set the Python version for the environment
poetry env use 3.11
  1. Install dependencies
poetry install

Note: The project uses Python 3.11 due to an issue with the multidict dependency in Python 3.12.

⚙️ Configuration

Plex Observer requires minimal configuration to function. You need to provide a Discord bot token and Plex credentials (either a username and password or a baseurl and token).

An minimal example configuration file is provided as example.config.ini. Simply replace <discord-bot-token>, <plex-username> and <plex-username> with yours and rename the file to config.ini.

Here's an example of a fully specified config.ini file:

[settings]
places = 10
interval = 10

[discord]
token = NDY3NzE1NTAbUjYwMzg2ODI2.DiuplA.T336twFYOlzcHqcU1xV5skYyHX0
token_dev = BuZbzE1NTAyJIUhdvYwMzg2ODI2.JaopjB.T529twFYOlzcHqcU1uEK78jx

[plex]
username = johndoe
password = kodi-stinks
baseurl = http://127.0.0.1:32400
token = XBHSMSJSDJ763JSm

🕹 Usage

To run Plex Observer, execute the following command:

poetry run python3 src/main.py

You can specify the environment (prod or dev) with the -e or --env argument:

poetry run python3 src/main.py --env dev

🐳 Docker Deployment

You can also deploy Plex Observer using Docker:

docker build -t plex-observer .
docker run -d plex-observer
  • -t plex-observer: This flag is used in the docker build command. The -t stands for "tag". It tags the image with the name plex-observer so you can easily refer to the image later.
  • -d: This flag is used in the docker run command. The -d stands for "detached". It means that Docker will run your container in the background and print the container ID.

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

📝 License

This project is licensed under the MIT License.