Creating a media server plugin

Suggest, post, or discuss plugins for Deluge
Post Reply
Nooblazor
New User
New User
Posts: 8
Joined: Sun Apr 28, 2013 9:15 am

Creating a media server plugin

Post by Nooblazor »

So I've decided that I'll probably end up writing a fairly sizable plugin. This plugin is aimed at automated media server setups.
Currently I have a working setup which works as follows:

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.
Now when I go to code my plugin, I am wondering, is there a way for my plugin to interact with other plugins (e.g. AutoAdd) or do I need to add the code for the functionality I need into my plugin? I haven't looked into the question yet so I apologize if it seems silly or rudimentary.
I guess I'm simply looking for the most user friendly approach to making a media server plugin as my current setup is anything but that. It evolved quite a bit over time so it is not very user friendly.

I welcome any ideas you guys may have.
Nooblazor
New User
New User
Posts: 8
Joined: Sun Apr 28, 2013 9:15 am

Re: Creating a media server plugin

Post by Nooblazor »

Well I did a little bit of digging and found the answer to my question in the form of component.get()
I also added functionality to automatically map the network for future ease of use as well as to deal with dynamic ips using python-nmap (this feature will require nmap to be installed).
Post Reply