Execute plugin: script per tracker?

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

Execute plugin: script per tracker?

Postby spezticle » Mon Sep 21, 2015 2:10 am

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: 3466
Joined: Mon Dec 07, 2009 6:04 am
OS or Distro: Ubuntu 16.04
Location: Scotland

Re: Execute plugin: script per tracker?

Postby Cas » Mon Sep 21, 2015 9:43 am

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
OS or Distro: Raspbian

Re: Execute plugin: script per tracker?

Postby AlxAlxV » Mon Sep 21, 2015 5:51 pm

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: 3466
Joined: Mon Dec 07, 2009 6:04 am
OS or Distro: Ubuntu 16.04
Location: Scotland

Re: Execute plugin: script per tracker?

Postby Cas » Mon Sep 21, 2015 9:45 pm

In the label options

spezticle
New User
New User
Posts: 4
Joined: Sun Sep 20, 2015 8:37 pm
OS or Distro: ubuntu

Re: Execute plugin: script per tracker?

Postby spezticle » Wed Sep 23, 2015 2:49 am

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
OS or Distro: Raspbian

Re: Execute plugin: script per tracker?

Postby AlxAlxV » Wed Sep 23, 2015 5:48 am

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
OS or Distro: ubuntu

Re: Execute plugin: script per tracker?

Postby spezticle » Thu Sep 24, 2015 8:25 pm

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


Return to “Plugins”

Who is online

Users browsing this forum: No registered users and 4 guests