Page 1 of 1

Execute plugin: script per tracker?

Posted: Mon Sep 21, 2015 2:10 am
by spezticle
I'm trying to determine a way to make the execute plugin run a different script based on the torrent tracker.
Is there any way to identify torrents with the execute plugin by the tracker?

Thanks

Re: Execute plugin: script per tracker?

Posted: Mon Sep 21, 2015 9:43 am
by Cas
Afraid not you would need to run a deluge client script to connect to deluge and get that information. A hacky workaround could use the label plugin to put torrents in trackers specific folders.

Re: Execute plugin: script per tracker?

Posted: Mon Sep 21, 2015 5:51 pm
by AlxAlxV
A hacky workaround could use the label plugin to put torrents in trackers specific folders.
How can I do that ? Thanks !

Re: Execute plugin: script per tracker?

Posted: Mon Sep 21, 2015 9:45 pm
by Cas
In the label options

Re: Execute plugin: script per tracker?

Posted: Wed Sep 23, 2015 2:49 am
by spezticle
Oh man, the label idea works perfect.
My execute script looks at the completed path of the torrent and with an IF statement in bash, decides where to move the data.
This whole thing revolves around a finished torrent getting copied to a remove server and put into the proper folder for assimilation into the plexmediaserver upon finishing.

If anyone is curious, see my bash script below:
Also, this works with SCP because i'm using a ssh config file

Code: Select all

$ cat ~/.ssh/config
Host newserver
	Hostname newserver.example.com
	User deluge
	IdentityFile ~/.ssh/deluge-userkey.ssh
	Port 22

Code: Select all

#!/bin/bash
varID=$1
varTORRENTNAME=$2
varTORRENTPATH=$3
varTORRENT="$varTORRENTPATH/$varTORRENTNAME"
varLOGPATH='/home/deluge/.log'
varEXECLOG='execute.log'
varCMDLOG='command.log'
varHOSTNAME='newserver:'
fnSCP ()        {
                scp -q -r $varTORRENT $varHOSTNAME$varHOSTPATH &
                }
fnLOG ()        {
                varDATE="$(date +%Y-%m-%d\ %H:%M:%S)"
                echo -e "[$varDATE] ID: $varID" "\t" "Name: $varTORRENTPATH/$varTORRENTNAME"  >> $varLOGPATH/$varEXECLOG
                echo -e "[$varDATE] scp -q -r $varTORRENT $varHOSTNAME$varHOSTPATH &" >> $varLOGPATH/$varCMDLOG
                }

if      [[ $varTORRENT =~ ./tv/.* ]]; then
                varHOSTPATH='~/tv/'
                fnLOG
                fnSCP
elif    [[ $varTORRENT =~ ./movies/.* ]]; then
                varHOSTPATH='~/movies/'
                fnLOG
                fnSCP
else
        varHOSTPATH='~/'
        fnSCP
fi

Re: Execute plugin: script per tracker?

Posted: Wed Sep 23, 2015 5:48 am
by AlxAlxV
But its only the complete folder right ?
And if you can get both type from the same tracker ? How to do that ?

Re: Execute plugin: script per tracker?

Posted: Thu Sep 24, 2015 8:25 pm
by spezticle
I see no other way than either manually moving them to a different label or completed folder