Execute plugin: script per tracker?

Suggest, post, or discuss plugins for Deluge
Post Reply
spezticle
New User
New User
Posts: 4
Joined: Sun Sep 20, 2015 8:37 pm

Execute plugin: script per tracker?

Post 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
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Execute plugin: script per tracker?

Post 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.
AlxAlxV
Member
Member
Posts: 19
Joined: Tue Nov 12, 2013 12:36 pm

Re: Execute plugin: script per tracker?

Post by AlxAlxV »

A hacky workaround could use the label plugin to put torrents in trackers specific folders.
How can I do that ? Thanks !
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Execute plugin: script per tracker?

Post by Cas »

In the label options
spezticle
New User
New User
Posts: 4
Joined: Sun Sep 20, 2015 8:37 pm

Re: Execute plugin: script per tracker?

Post 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
AlxAlxV
Member
Member
Posts: 19
Joined: Tue Nov 12, 2013 12:36 pm

Re: Execute plugin: script per tracker?

Post by AlxAlxV »

But its only the complete folder right ?
And if you can get both type from the same tracker ? How to do that ?
spezticle
New User
New User
Posts: 4
Joined: Sun Sep 20, 2015 8:37 pm

Re: Execute plugin: script per tracker?

Post by spezticle »

I see no other way than either manually moving them to a different label or completed folder
Post Reply