Skip to content

Configuration

Stefan Cosma edited this page May 31, 2023 · 22 revisions

Before running Plexorcist for the first time, make sure this setting is enabled in your Plex installation. You can find it in Settings/Library.

Screenshot 2023-04-20 at 12 25 26 PM

After making sure the setting is enabled you can run the bellow command to configure Plexorcist:

./plexorcist.py --config

This will prompt you for the required values in the plexorcist.ini config file. Bellow you'll find how you can obtain each value, for each of the required keys.

Alternatively, if you're comfortable with the command line, you can edit the plexorcist.ini file directly. You could do something like this:

nano plexorcist.ini

The default file looks like this:

[plex]
hostname = localhost
port = 32400
token = <your_plex_token_here>
libraries = Movies, 1
ifttt_webhook = <your_ifttt_webhook_url_here>
pushbullet_key = <your_pushbullet_api_key_here>
whitelist = Series 1, Movie 1
older_than = 1d 4h 30m

[i18n]
whitelisted = {} is whitelisted!
removed = {} watched videos were removed and {} GB reclaimed:
notification = Notification sent!
ifttt_error = IFTTT Webhook URL not set!
no_videos = No videos to delete!

hostname

Required Type
yes string

If you're running Plexorcist on the same machine as Plex than you can leave this as localhost or change it to the appropriate hostname.

port

Required Type
yes int

The default port is 32400, but you can change it according to your installation.

token

Required Type
yes string

You can follow this guide or follow the bellow steps:

  1. In the Plex web interface, open the page of any piece of media (this represents the last child of that media, whether it's a show or a movie). Next to the Edit button you should see three dots. Clicking on those should open a menu like bellow.

Screenshot 2023-04-20 at 12 10 09 PM

  1. Click on Get Info and then in the modal that pops up, in the bottom left click on View XML. This will open the media metadata in the form of XML, in a new tab. From the URL of that tab you can extract the X-Plex-Token which coincidentally is the last parameter in the URL.
  2. You can now replace <your_plex_token_here> with the X-Plex-Token value.

libraries

Required Type
yes string / int list

This should be a comma separated list of library names and / or ids. You can use it in any form you're comfortable with. Possible values:

libraries = Movies, 1
libraries = Movies, TV Shows
libraries = 0, 1, 2 

If you're going to use ids you'll need to know the library id. You can find the id of a library by opening the Plex web interface. Open the library or libraries you want to use Plexorcist on, and from the url you can extract the library id. Find the source parameter and add it to the libraries list.

ifttt_webhook

Required Type
no url

Setting this config key is optional, so you don't have to add it. I wanted a way to get notified if the script ran and what items were deleted from Plex. You can find more info, on how to use IFTTT webhooks, here.

A valid ifttt_webhook would look something like this:

https://maker.ifttt.com/trigger/<name_of_your_hook>/with/key/<key_generated_by_IFTTT>

pushbullet_key

Required Type
no string

Setting this config key is optional, so you don't have to add it. I wanted a way to get notified if the script ran and what items were deleted from Plex. You can read more about the Pushbullet API here.

You can generate a new Pushbullet API key, from your account settings here.

whitelist

Required Type
no string list

You can add as many Movies and TV Shows you want, in the whitelist, and they will be ignored by Plexorcist.

older_than

Required Type
no string or int

Plexorcist gives you the ability to delete only videos older than a set time. The value for this parameter can be either 0 or something like 1d 3h 4m.

If the value is set to 0, then videos will be deleted every time Plexorcist is run.

If the value is set to, for eg. 1d, it will delete videos older than 1 day. It supports any combination and you can have all of them or just some.

<number>d - number of days
<number>h - number of hours
<number>m - number of minutes

i18n

You can change the strings to another language or if you're feeling extra fancy use these ones.


If you followed this guide correctly, you should be able to run Plexorcist by following this guide.

Clone this wiki locally