Skip to content

Plex_Debrid (Standalone)

slunat edited this page Feb 19, 2024 · 2 revisions

Plex_Debrid can either be installed on its own container or on the Plex container. It doesn't require any direct access to Plex or its files, so can be put on its onw container if preferred. The following guide will walk you through setting it up on its own container.

Installation

You will not require a powerful container for this as its only going to be executing a script. I would recommend setting up a minimum of the following.

Unprivileged Container

Template: Debian 12 (Bookworm)

CPU: 1 CPU

Memory: 512MB

Storage: 2GB

Preperation

  1. Before powering on the container, go to Options > Features and enable the FUSE option. Then boot up the container.
  2. Enter the container console.
  3. Get the container up to date by running apt-get update && apt-get upgrade -y
  4. Install Screen by running apt install screen
  5. Install git by running apt install git
  6. Install Fuse by running apt-get install fuse
  7. Check if python3 is present by running python3 --version. If it is not present, install it by running apt install python3
  8. Check if pip is installed by running python3 -m pip --version. If it is not present, install it by running apt install python3-pip
  9. If you are running python3.11 or later, you will need to remove the EXTERNALLY-MANAGED file to allow you to run pip commands. To do so, first enter the python directory by running cd /usr/lib/python3.11. THen enter rm EXTERNALLY-MANAGED to remove the file.
  10. Enter cd to return back to the root directory.

Setup

  1. Grab the Plex_Debrid files by running git clone https://github.com/itsToggle/plex_debrid
  2. Run pip install -r ./plex_debrid/requirements.txtto install the required files
  3. Create a new screen session called "plexdebrid" by entering screen -S plexdebrid. This will place you in the virtual terminal, so you can execute the script in a seperate session.
  4. Run python3 ./plex_debrid/main.py to start the script.
  5. Proceed with the initial setup by following the setup instructions as required.
  6. Once you have configured everything, before choosing the "1) Run" option, select option "2:) Settings" and go to "5) UI Settings". Set the value for "1) Show menu on startup" to "false". This will skip the main menu screen and allow the script to just start the run process as soon as it is executed, rather than waiting at the menu.
  7. Return to the main menu screen and select option "1) Run" to run the script.
  8. Press ctrl + a and then press d to exit out of the virtual terminal. You can return to the terminal any time by running screen -r plexdebrid If you need to manually edit the config file, this is stored in the root directory and can be edited by running nano settings.json

Setting it to automatically run

  1. Once you are out of the virtual plexdebrid terminal, enter mkdir scripts && cd scripts to create and enter a directory called scripts.
  2. Enter nano plexdebrid.sh to create and open the editor for the startup script we will be using.
  3. Enter the below two lines into the file. This will open a screen session called plexdebrid in the background and execute the script inside of it. You can then return to the script at anytime by entering screen -r plexdebrid

#!/bin/bash

screen -dmS plexdebrid python3 ./plex_debrid/main.py

  1. press ctrl + x, they y to save the file.
  2. Enter chmod +x plexdebrid.sh to make the script executable.
  3. Enter crontab -e to edit the crontab file. Select option 1 when prompted for an editor.
  4. A the bottom of the file, add the line @reboot scripts/plexdebrid.sh to make the script execute every time the container boots up.
  5. Press ctrl + x, then y to save the changes to your cron file.

Updating Components

Plex_Debrid

  1. Open the terminal enter cd plex_debrid to go to the plex_debrid directory.
  2. Run git pull to grab the latest files
  3. Run pip install -r ./requirements.txt to make sure all required dependencies are installed.
  4. Restart the container. You can verify you are on the correct version by running plex_debrid --version