Page 1 of 1

Execute plugin not working

Posted: Sun Feb 02, 2020 5:18 pm
by iconoclasthero
I've looked at all the simple things and I haven't been able to find out why this isn't working:

Code: Select all

$ deluged --version
deluged 2.0.3-2-201906121747-ubuntu18.04.1
libtorrent: 1.1.5.0
Python: 3.6.9
OS: Linux 5.3.0-28-generic

$ deluge-gtk --version
deluge-gtk 2.0.3-2-201906121747-ubuntu18.04.1
libtorrent: 1.1.5.0
Python: 3.6.9
OS: Linux 5.3.0-28-generic

$ which torrent-complete 
/usr/local/bin/torrent-complete

$ ll /usr/local/bin/torrent-complete 
-rwxr-xr-x 1 root root 1092 Feb  2 11:35 /usr/local/bin/torrent-complete*

$ pwd
/library/music/00-incoming/deluged-incoming

$ cat /usr/local/bin/torrent-complete
#!/bin/bash
export DISPLAY=:0
# Input Parameters
torrentid="$1"
torrentname="$2"
torrentpath="$3"
torrentfilepath="$3/$2"

echo "Torrent Details: " "$torrentname" "$torrentpath" "$torrentid" >> /dev/shm/cache/torrent-complete.log

notify-send "Deluge:"  "A trrent has completed, proceeding to execute script."

if [[ $torrentpath == "/library/music/00-incoming/deluged-incoming" ]] ; then
	notify-send "Deluge:"  "A music torrent has completed.  Attempting to launch picard."
	picard /library/music/00-incoming/deluge-incoming
else
    :
fi

$ torrent-complete id name path

$ cat /dev/shm/cache/torrent-complete.log 
Torrent Details:  name path id
Image

The three lines are respectively:

Code: Select all

/usr/local/bin/torrent-complete
/usr/bin/notify-send "torrent completed" "$2"
/usr/bin/notify-send "Torrent added:" "$2"
Nothing happens when I add a torrent or upon torrent completion. Nothing is added to the log and notify-send doesn't pop a notification on my desktop (but it does when I manually test it as above).

What am I missing?

Re: Execute plugin not working

Posted: Mon Feb 17, 2020 2:58 pm
by ScottC
Just checking, Did you restart deluge after enabling the execute plugin. I was having the same issue, nothing happening on torrent complete. Once I restarted deluge, it started working.

Re: Execute plugin not working

Posted: Thu Feb 20, 2020 1:59 pm
by iconoclasthero
Many many times...rebooted, upgraded the kernel a couple of times...

Re: Execute plugin not working

Posted: Sat Nov 27, 2021 4:53 pm
by idic
Did you ever get this working?

I just rebuilt a new VM with v2.0.3 and reused the logic from my previous version 1 script. It works manually but I'm not even seeing the variables getting passed to new the script.

Re: Execute plugin not working

Posted: Sat Nov 27, 2021 5:38 pm
by mhertz
[...] but I'm not even seeing the variables getting passed to new the script

Did you test this from a script, e.g echoing $1-3 into text file for verification? There was a commit fixing windows support after deluge 2.0.3 released, but I see you're using Linux from your profile - you could try that updated newest version of plugin, from deluge develop branch, if verifying that it doesn't output vars correctly, just in case(place in your deluge profile dir and restart deluged):

https://paste.c-net.org/BrittanyMargate

(When searching back in my posts to find that link, saw a user stating it fixed his issue on raspbian and deluge 2.0.3 btw, so seemingly not 100% only windows related)

Re: Execute plugin not working

Posted: Sat Nov 27, 2021 7:00 pm
by idic
Thanks mhertz.

Yes, when i tested from my script and run it as

Code: Select all

./move.sh 5153 "Raspberry_pie_recipe.rar" /opt/deluge/Downloads
it showed the variables in my log file. However, straight from the plugin it didn't.

I've grabbed v1.4 (thanks again) and will give that a go on my linux machine.

Re: Execute plugin not working

Posted: Mon Nov 29, 2021 5:37 pm
by idic
That did the trick for me mhertz. Thanks. You rock!

Re: Execute plugin not working

Posted: Mon Nov 29, 2021 6:08 pm
by mhertz
I appreciate your kind post mate, thanks likewise :) and for reporting back.