Page 1 of 1

Unable to get execute plugin to run script

Posted: Sat Jan 01, 2022 9:35 pm
by deluge0001
OS: Ubuntu 20.04.03 LTS
Python version : 3.8.10 ( Ran python --version)
Deluge version: 2.0.5-0-202112151848-ubuntu20.04.1
libtorrent: 1.1.13.0

I have a simple script that says added, removed and completed based on the type of the event. Nothing fancy.
Image

Restarted Deluge and machine many times.

Ran the command deluge -L debug -l ~/Desktop/log.log in terminal to capture logs to see if it says anything but couldn't find. I can see that it is at least reading my configuration as per the below log:

Code: Select all

13:24:37 [DEBUG   ][deluge.config                     :434 ] Config /home/ram/.config/deluge/execute.conf version: 1.1 loaded: {'commands': [['771a43499fe24a5d9ac4396661f133f8a8d2b587', 'complete', 'spd-say Complete'], ['f23a7a7f72b08d153745da4b96272aaa8a3e81a9', 'added', 'spd-say Added'], ['bb747a8002b496eb24cf048185e39526b3ba38ab', 'removed', 'spd-say Removed']]}
13:24:37 [DEBUG   ][deluge_execute.core               :86  ] Execute core plugin enabled!
13:24:37 [INFO    ][deluge.pluginmanagerbase          :191 ] Plugin Execute enabled...
13:24:37 [DEBUG   ][deluge.core.rpcserver             :539 ] intevents: {}
13:24:37 [DEBUG   ][deluge.plugins.pluginbase         :53  ] Gtk3Plugin initialized..
13:24:37 [DEBUG   ][deluge_execute.gtkui              :49  ] Adding Execute Preferences page
13:24:37 [DEBUG   ][deluge_execute.gtkui              :122 ] on_get_commands: [['771a43499fe24a5d9ac4396661f133f8a8d2b587', 'complete', 'spd-say Complete'], ['f23a7a7f72b08d153745da4b96272aaa8a3e81a9', 'added', 'spd-say Added'], ['bb747a8002b496eb24cf048185e39526b3ba38ab', 'removed', 'spd-say Removed']]
Here is the link to the full log: https://pastebin.com/aug70q6S

Why isn't my execute plugin not running scripts?

NOTE: I went through this page (https://dev.deluge-torrent.org/wiki/Plugins/Execute) and even tried with the example given there(execute_script) but no success.

Re: Unable to get execute plugin to run script

Posted: Sat Jan 01, 2022 9:54 pm
by mhertz
Your full log states the script defined not found or missing executable bit. Define full path to script/command, and check is executable, and if still fails, try switching where located. The command probably not run through a shell in plugin(haven't checked), so no path-expansion.

Re: Unable to get execute plugin to run script

Posted: Sat Jan 01, 2022 11:13 pm
by deluge0001
mhertz wrote: Sat Jan 01, 2022 9:54 pm Your full log states the script defined not found or missing executable bit.
Thank You. I missed that part in the log.

Upon further research, what I have found is that execute plugin doesn't like arguments. I believe it is treating those arguments as part of the file path and always printing the message "Execute script not found or not executable" in the logs. Once I removed arguments to the script, it started working fine.

It is time to update execute_script example on this page https://dev.deluge-torrent.org/wiki/Plugins/Execute

Thanks.

Re: Unable to get execute plugin to run script

Posted: Sun Jan 02, 2022 12:20 am
by mhertz
Sorry, forgot that, as indeed no args allowed, and so instead you define all needed in script itself.

The example is fine as far as I can tell. The docs also states script support, and not arbitrary args mentioned as far as I see. Reason being that the plugin appends its own 3 args to your script and all examples count on them as being sys.argv[1-3] specifically, and so would be complicated to document that users need count there own args and multiply to then find the preceding ones to use which the plugin supplied, as no more just in place $1-3/%1-3%