[SCRIPT] Plex Script

Suggest, post, or discuss plugins for Deluge
Nooblazor
New User
New User
Posts: 8
Joined: Sun Apr 28, 2013 9:15 am
OS or Distro: Linux Mint 14 Xfce

[SCRIPT] Plex Script

Postby Nooblazor » Tue Jan 14, 2014 3:25 am

I have coded a couple of scripts that are great for running an automated media server using Plex (https://plex.tv/).

Pre-requisites:
1. You need to have pickledb installed

Code: Select all

pip install pickledb

2. You need the LabelPlus plugin (http://forum.deluge-torrent.org/viewtopic.php?f=9&t=42629).
3. Execute plugin configured to run started.py on torrent start and completed.py on torrent finish.
3. If you want to use either growl or pushover notifications you will need gntp and/or pushnotify respectively

Code: Select all

pip install gntp pushnotify

4. For growl: You need to set up watch directories using the AutoAdd plugin named after the growl hosts on your LAN (e.g. TOM-PC, PAT-LAPTOP etc.) or simply use fill out the default_host in the script options where all the notifications will go.
5. For pushover: You need to setup your account on their site (https://pushover.net/).
6. Fill out the information at the top of each script.

What these scripts do:

1. When a torrent is placed in a folder which is watched by the AutoAdd plugin, it is automatically added and labeled using the LabelPlus plugin.
2. Next, one of my python scripts fires thanks to the torrent_added event with the help of the Execute plugin. This script does a number of things:
  • Based on the folder name from which the torrent was added (e.g. Sam, Frank, Joe etc.), it will send a growl notification to said computer on the network.
  • It also has the ability to push notifications to iOS and Android devices through various apps such as pushover prowl and nma.
  • Next it adds the torrent hash and the user who added the torrent to a database.
3. Now when the torrent finishes downloading it is moved based on the LabelPlus specifications.
4. Then another script is fired with the help of the Execute plugin which serves the following functions:
  • Looks up the torrent in the database and removes it.
  • Sends a growl notification to the user's computer on the network.
  • Extracts the contents of the torrent if need be (I use code I modified from the Extractor plugin).
  • Then it looks up the label of the torrent and if it matches one of the provided labels (e.g. Movies, TV), it proceeds to invoke the Plex Media Scanner to update the library.
  • Finally, it sends a notification to the user's mobile device.

In any case, the scripts are pretty well documented so you should have no trouble following. They should work on any OS but they have only been tested (extensively) on an Ubuntu based linux distro.
It's hard to think of what else I should explain so just post here if you have any questions.

Lastly, credit to http://forum.deluge-torrent.org/viewtopic.php?f=9&p=172841 for the idea as well as the author of the extractor plugin (I took the core of that plugin and adapted it for the unpacking functionality).
Attachments
plexScript.zip
Scripts for running an automated plex media server
(18.95 KiB) Downloaded 933 times

kevinman117
New User
New User
Posts: 3
Joined: Thu Feb 20, 2014 2:29 am
OS or Distro: Mac OS X Mavericks

Re: [SCRIPT] Plex Script

Postby kevinman117 » Mon Mar 24, 2014 1:23 am

I have some problem with pms not executing after a torrent finished downloading. I don't know what causes the problem because the logging on completed.py does not work. The script also does not generate the pickledb. Please advise.

BillyPrefect
New User
New User
Posts: 3
Joined: Fri Apr 22, 2016 1:01 am
OS or Distro: FreeNAS/FreeBSD

Re: [SCRIPT] Plex Script

Postby BillyPrefect » Fri Apr 22, 2016 1:42 am

Does this seed the torrent ? Is there any set seeding time or ratio ?


Return to “Plugins”

Who is online

Users browsing this forum: No registered users and 1 guest