nickheyer / DiscoFlix

A simple media-requesting, Radarr/Sonarr-interfacing, movie and tv show-listing Chat Bot web-app for your media server.
48 stars 4 forks source link
discord emby-server javascript media plex python radarr sonarr telegram

DiscoFlix

image

The ideal way for you and your users to request media via Discord.

Compatible with Radarr & Sonarr. Includes a REST API.


Peek 2023-04-07 20-39



General Requirements

Running the discord bot requires a discord developer account, and a bot created/invited (via your developer account) to your chosen discord server.

As this application is intended to interface with Sonarr and Radarr, you will need one or both installed. If you are installing to a machine that is not also hosting your Radarr/Sonarr, you must be able to access Radarr/Sonarr from the host (locally or remotely).


Installation (Recommended Method)

Linux (Fully Automated)

wget https://raw.githubusercontent.com/nickheyer/DiscoFlix/main/auto_install_update.sh
sudo ./auto_install_update.sh

Installation Using Docker CLI (All Operating Systems)

Download Docker Image

To get the latest version of Discoflix, run:

docker image pull nickheyer/discoflix:latest

Run Docker Container

To run Discoflix in a container, use the following command. Make sure to mount a volume to /app/data in the container so that your data persists across container restarts. Here's how to do it:

Example:

docker run -d -p 5454:5454 --name discoflix -v /opt/discoflix/data:/app/data nickheyer/discoflix

On Other Platforms:
You can replace /opt/discoflix/data with an appropriate path on your local system. For Windows and macOS, specify the full path you want to use for data storage. This allows DiscoFlix's database to remain on your pc even if you delete or update your container!

The server within the docker container can be accessed locally at http://127.0.0.1:5454

Installation Using Docker-Compose

Prep

First, get the compose file:

mkdir -p /opt/discoflix/data && cd /opt/discoflix
wget https://raw.githubusercontent.com/nickheyer/DiscoFlix/main/docker-compose.yml

Start the Container Using Docker Compose

With Docker Compose installed on your system, you can start Discoflix by running:

docker-compose -f /opt/discoflix/docker-compose.yml up -d

This will pull the latest Discoflix image and run it, mounting the volume specified in the docker-compose.yml file. This will use the default /opt/discoflix/data, so modify this path if needed.

The server within the docker container can be accessed locally at http://127.0.0.1:5454

To stop the service, use:

docker-compose -f /opt/discoflix/docker-compose.yml down


Installation From Source (Not Recommended)

Prerequisites, Dependencies, and Requirements

NOTE: Installation from source using Windows has been deprecated with the introduction of web-socket functionality, gevent, and other integral parts of this application that are not currently supported by Microsoft.

  1. Python - Download and install Python here. Make sure that you choose "Add Python to environmental variables" during installation.
  2. Git - Download and install Git here

Next Steps

  1. Change directory to preferred install location

    cd /where/you/want/this/installed
  2. Clone DiscoFlix

git clone https://github.com/nickheyer/DiscoFlix
  1. Change directory to DiscoFlix

    cd ./DiscoFlix
  2. Install Requirements

    pip install -r requirements.txt
  3. Run Migrations

    python manage.py migrate
  4. Run DiscoFlix

    sh ./run.sh


General Instructions

Accessing The Web-UI

Peek 2023-04-07 20-49

You will need to get the IP address of the computer hosting DiscoFlix. On Windows, you would typically type ipconfig on the host machine and look for your ipv4.

If you are hosting DiscoFlix (using Docker) on the same machine that you are hosting Radarr & Sonarr, you might not be able to access your Radarr & Sonarr using http://localhost:<port>, as that would be referencing the localhost of the docker container itself. Instead, use http://host.docker.internal:<port> - consider this the localhost of the machine hosting the docker container. In some cases, this may not be an issue.

If you would like to access DiscoFlix remotely, as in not on the same network as the host machine, you will need to do some port forwarding to expose port 5454 to the internet. Run into trouble? Feel free to join the Discord!


Configuration

Peek 2023-04-07 19-50

DiscoFlix requires a small amount of configuration before you can begin making requests. Discord Token + Radarr and/or Sonarr URL and Token, depending on your use case. If you plan to only use Radarr, disable the Sonarr switch in your configuration menu. Same goes for only using Sonarr.


To get your Discord Token, go to the "bot" tab in your developer portal. You may need to click "reset Token" and/or enter authentication code if you have 2FA enabled. Make sure to enable all Privileged Gateway Intents)

Peek 2023-05-22 22-06

If you haven't already, now is also a good time to invite the bot to the server or servers you would like to monitor, you can do that via the Discord Developer Portal. Admin access is the only level we have tested. Anything less may result in errors.

Peek 2023-04-07 20-01



Usage

Add Yourself As An Admin

Peek 2023-04-07 20-10

Test That The Bot Is Running

Type the following into a discord chat message that the bot can see:

!df test

Peek 2023-04-07 20-15

Your First Request

Test that the bot is able to access Radarr/Sonarr by making your first test request. Let's use "Dark Phoenix" as an example.

!df movie Dark Phoenix

Peek 2023-04-07 20-21

We can also test our Sonarr requests. Let's try "Cyberpunk Edgerunners".

!df show Cyberpunk Edgerunners

Peek 2023-04-07 20-23

Looks like we already have that on our server, or it's already being monitored!

Available Commands

To see the commands available to you, type !df help. DiscoFlix should respond with a table containing some or all of the below commands.

Command Aliases Description Usage
Test test Confirm bot is on and listening !df test
Help help Display all authorized commands. !df help
Echo echo Confirm bot is handling input as intended. !df echo <text to echo>
Error error, err, raise Confirm bot is handling errors as intended !df error [-s]
Log log, add-log Confirm bot is logging information to console as intended !df log <text to log>
Movie movie, add-movie Request a movie !df movie <title>
Show show, add-show, tv-show, add-tv-show, tv, tvshow Request a tv-show !df show <title>
User user, add-user, add Add a user !df user <user_to_add>

The above commands assume that your command prefix is set to the default !df. Adjust accordingly.

Keep in mind that you will need to mark yourself as "server owner" in the user control panel to use the debug commands.


API

Run in Postman

Or just view the docs.


Further Notes


Authors

Contributing

Contributions are always welcome!

Email nick@heyer.app for ways to get started.