I use execute and label default plugins.
The script will correctly guess the label of the torrent. As you can see below, the script will correctly log the variables, I use for input file and output dir. The exact command, that is produced in the log file, will copy what I want where I want. It seems, though, in the script, the cp command will not trigger?? What might be the problem?
The problem script - complete (it is invoked ny another script, wrapper,
Code: Select all
#!/bin/bash
torrentid="$1"
torrentname="$2"
torrentpath="$3"
LABEL=$(/home/***/Desktop/getLabel.py $torrentid)
# echo $torrentname $torrentpath "was downloaded" >> /home/****/lastxfer.txt
# American Idol 11
if [ $LABEL == "americanidol" ]; then
copyname="'"$torrentpath"/"$torrentname"'"
echo cp $copyname "'/home/***/Desktop'" >> /home/****/lastxfer.txt
# sleep 10
cp $copyname "'/home/***/Desktop'"
# gnome-terminal --execute '/home/deckoff/Desktop/CPSCRIPT' $copyname '/home/***/Desktop'
fi
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()
Code: Select all
#! /bin/bash
/home/****/Desktop/DS/complete "$1" "$2" "$3" &