As we know, deluge cant delete folders that have files added by other way than thru download by torrent. Like subtitles, you downloaded a show and then added in that folder the subtitles founded on other site. Deluge will delete only the files from torrent and the folder will remain with the files you added.
So, lets use the plugin Execute, this plugin let us use a command when something happen to a torrent, eg, added, completed, removed.
We will use when torrent removed (the remove can be made manual or by another plugin like AutoRemovePlus)
Code: Select all
echo $(/home/pi/scripts/copytoplex/remove.py $torrentid $torrentname) > /dev/null
please change the path for remove.py with your file location
and file 2:
Code: Select all
import sys, os, fnmatch, re, shutil, logging
logger = logging.getLogger('copytoplex')
hdlr = logging.FileHandler('/home/pi/scripts/copytoplex/remove.log')
formatter = logging.Formatter('%(asctime)s %(message)s')
torrentid = sys.argv
torrentname = sys.argv
def rem_files(torrentname, torrentpath):
as you can see in the script, my downloaded files are in /mnt/hdd/downloading , so, change this with your folder of downloaded files and also, change the path of this files in the script.
In plugin Execute, select when torrent removed and put the path to the remove.sh file, mine is /home/pi/scripts/copytoplex/remove.sh
Notice that you have to restart deluge daemon otherwise the execute plugin will not call the remove.sh script.
A remove.log file will be created containing the torrent name that have been removed.
Now, with the AutoRemovePlus, Execute plugins and this simple script, you can forgot about your torrents..
Also, see this tool to copy your cleaned content to Plex library :