Skip to content

A simple media-requesting, Radarr/Sonarr-interfacing, movie and tv show-listing Chat Bot web-app for your media server.

Notifications You must be signed in to change notification settings

nickheyer/DiscoFlix

Repository files navigation

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)

curl https://raw.githubusercontent.com/nickheyer/DiscoFlix/main/auto_install_update.sh -o auto_install_update.sh && sudo bash auto_install_update.sh

Other Operating Systems (Windows, Mac, etc.)

Download Docker Image (Recommended - x86_64 Architecture)
docker image pull nickheyer/discoflix:latest
OR Download Docker Image (ARM64, aarch64 Architecture, ie: Raspberry-Pi, Mac M1, etc.)
docker image pull nickheyer/discoflix_rpi:latest
Run Docker Container
docker run -d -p 5454:5454 --name discoflix nickheyer/discoflix
The server within the docker container can be accessed locally at http://127.0.0.1:5454


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
  1. Clone DiscoFlix
git clone https://github.com/nickheyer/DiscoFlix
  1. Change directory to DiscoFlix
cd ./DiscoFlix
  1. Install Requirements
pip install -r requirements.txt
  1. Run Migrations
python manage.py migrate
  1. 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

  • For any other comments or questions, feel free to reach me on discord via NicholasHeyer#4212
  • Feel free to join the Discord!

Authors

Contributing

Contributions are always welcome!

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