Execute Plugin and Labels

General support for problems installing or using Deluge
darkcircuituk
New User
New User
Posts: 3
Joined: Fri Feb 27, 2015 12:29 pm
OS or Distro: Ubuntu

Execute Plugin and Labels

Postby darkcircuituk » Fri Feb 27, 2015 12:56 pm

Hey all,
I'm a big fan of Deluge, I run it on 4 different machines and it has worked flawlessly up till now. In Ubuntu I am trying to get the deluge Execute plugin to talk nicely with filebot and although the vast majority of the script works great, I am hitting a problem when trying to get the label I specified with the label plugin. Does anyone have any knowledge on how to get the label within a bash script? I blindly hoped that argument 4 might be the label but nope; I have put my script below in-case it helps.

Code: Select all

#!/bin/bash
TORRENT_ID=$1
TORRENT_NAME=$2
TORRENT_PATH=$3
TORRENT_LABEL=$4

filebot -script fn:amc --output "/media/NAS" --log-file filebot.log --action test --conflict override -non-strict --def music=y artwork=n clean=y "seriesFormat=Videos/TV Shows/{n.replace(':','- ')}/Season {s}/{'S'+s.pad(2)}{'E'+e.pad(2)} - {t.replace(':','- ')}"  "ut_dir=$TORRENT_PATH/$TORRENT_NAME" "ut_kind=multi" "ut_title=$TORRENT_NAME" "ut_label=$TORRENT_LABEL"


Thanks for any help

darkcircuituk
New User
New User
Posts: 3
Joined: Fri Feb 27, 2015 12:29 pm
OS or Distro: Ubuntu

Re: Execute Plugin and Labels

Postby darkcircuituk » Fri Mar 06, 2015 10:30 am

No-one has pulled out labels from deluge in a post processing script?

noze2000
New User
New User
Posts: 1
Joined: Sun Mar 15, 2015 3:21 pm
OS or Distro: MACOS

Re: Execute Plugin and Labels

Postby noze2000 » Sun Mar 15, 2015 3:25 pm

+1 on this.

Sync'ing from my download (seed)box to my local NAS works great.
But I would like to not have a constand xtra opy of my downloads (need to unpack for media center Sickrage/(plex) which means that i need two copies if I am to stop a constant syncing from seedbox to local machine).

This would help a lot

darkcircuituk
New User
New User
Posts: 3
Joined: Fri Feb 27, 2015 12:29 pm
OS or Distro: Ubuntu

Re: Execute Plugin and Labels

Postby darkcircuituk » Mon Mar 23, 2015 10:18 am

I did a bit of digging and found a script in a 2 year old thread that claims it can retrieve the label from a torrent, but I haven't been able to get it working. In the hope that someone can help, or that you have more luck with it than me, here it is:

getLabel.py

Code: Select all

#!/usr/bin/python

import sys
from deluge.ui.client import client
from twisted.internet import reactor

# Set up the logger to print out errors
from deluge.log import setupLogger
setupLogger()

d = client.connect()

torrent_id = sys.argv[1]

def on_connect_success(result):
    def on_get_torrent_status(torrent):
        print torrent["label"]
        client.disconnect()
        reactor.stop()

    client.core.get_torrent_status(torrent_id, ["label"]).addCallback(on_get_torrent_status)

d.addCallback(on_connect_success)

def on_connect_fail(result):
        print result
        reactor.stop()

d.addErrback(on_connect_fail)

reactor.run()


postprocessingscript:

Code: Select all

LABEL=$(/home/***/MyScripts/getLabel.py $torrentid)

sndo37
New User
New User
Posts: 9
Joined: Mon Aug 10, 2015 1:34 am
OS or Distro: Windows 10

Re: Execute Plugin and Labels

Postby sndo37 » Tue Aug 11, 2015 1:49 pm

Another +1 on this. Deluge is fantastic, and the plugins are great, but I would LOVE to have to option to copy completed on a per-label basis.

Not sure if anyone is still working on the basic label plugin, but adding a "Copy" option (in addition to the pre-existing "Move" option) would save a ton of headaches for me, and probably others too:)

Weenyhead
New User
New User
Posts: 1
Joined: Fri May 19, 2017 6:14 pm
OS or Distro: Linux

Re: Execute Plugin and Labels

Postby Weenyhead » Fri May 19, 2017 6:26 pm

Little late to this party, but in case someone finds this page like I did, here's the solution I came up with:

Set a different "move to location" (directory) for each label.
Then in your execute script you can check that directory (the path variable).

example:

Code: Select all

#!/bin/bash

torrentid=$1
torrentname=$2
torrentpath=$3

if [ $torrentpath == "/home/vpn/Downloads/complete/tv" ] ; then
    # do something to tv downloads
elif [ $torrentpath == "/home/vpn/Downloads/complete/movie" ] ; then
    # do something to movie downloads
else
    # do something with all other downloads
fi


Hope that helps :)


Return to “Support”

Who is online

Users browsing this forum: Bing [Bot] and 19 guests