Page 1 of 2

[Plugin Update] Execute plugin

Posted: Sun Oct 16, 2016 3:42 am
by ult.nrg
Updated the execute plugin with some additional features.

Git: https://github.com/ultnrg/deluge-execute
Download: https://github.com/ultnrg/deluge-execut ... -py2.7.egg

Added features:
  • Abilty to process URLs
  • Added timer to run script xx seconds after event fires
  • Added TorrentCopied event (CopyCompleted plugin)
  • Added support for labels - only execute if label matches
  • Added parameter support, removed hard coded arguments
Parameters
<id> - torrent_id
<na> - torrent_name
<dl> - download_location
<lb> - label

Notes:
If path has spaces in it, make sure you wrap the path in double quotations. E.g. "C:\Program Files\Path\To\Script.bat"
Params can be added anywhere, not just at the end.

Example:
Label = movies
TorrentID = 123
"C:\My Downloads\<lb>\script.bat" <id> --> C:\My Downloads\movies\script.bat 123

Known issues:
Adding torrent trigger does not work, as I can't get from_state working.

Tested on Windows. Haven't done extensive testing so if you find bugs please let me know and submit the log file while in debug mode.

Not sure if this is the right place to post, so apologies if not. I couldn't find a thread for the execute plugin.

Re: [Plugin Update] Execute plugin

Posted: Mon Nov 21, 2016 7:18 pm
by Autocat
wow this looks really nice, going to test it!

Re: [Plugin Update] Execute plugin

Posted: Mon Nov 21, 2016 7:25 pm
by Autocat
When enabling the plugin, it does not show up in the webqui, only the normal gui. Is this something you are still working on?

Re: [Plugin Update] Execute plugin

Posted: Sat Nov 26, 2016 6:36 am
by ult.nrg
Just quickly checked, WebUI working here and has the new options (screenshot attached)

Re: [Plugin Update] Execute plugin

Posted: Tue Nov 29, 2016 7:16 pm
by doppel
ult.nrg wrote:Just quickly checked, WebUI working here and has the new options (screenshot attached)
I am able to see the new options in the WebUI, as indicated in the picture, but the values placed in them do not persist upon saving. In fact, I can't add or edit a new command at all, be it the new or existing fields. Perhaps I installed it wrong? I just installed this on top of the baked in execute plugin and restarted deluged and deluge-web services.

Thoughts?

Re: [Plugin Update] Execute plugin

Posted: Wed Nov 30, 2016 10:26 am
by ult.nrg
doppel wrote:I am able to see the new options in the WebUI, as indicated in the picture, but the values placed in them do not persist upon saving. In fact, I can't add or edit a new command at all, be it the new or existing fields. Perhaps I installed it wrong? I just installed this on top of the baked in execute plugin and restarted deluged and deluge-web services.

Thoughts?
Nothing wrong on your end, I didn't test it...looks like it's broken. I'll work on a fix in the next few days. :)

Re: [Plugin Update] Execute plugin

Posted: Thu Dec 01, 2016 12:27 pm
by doppel
ult.nrg wrote:
doppel wrote:I am able to see the new options in the WebUI, as indicated in the picture, but the values placed in them do not persist upon saving. In fact, I can't add or edit a new command at all, be it the new or existing fields. Perhaps I installed it wrong? I just installed this on top of the baked in execute plugin and restarted deluged and deluge-web services.

Thoughts?
Nothing wrong on your end, I didn't test it...looks like it's broken. I'll work on a fix in the next few days. :)
Here is the log error after attempting to add a new command:

Code: Select all

[ERROR   ] 07:25:34 rpcserver:304 Exception calling RPC request: add_command() takes exactly 6 arguments (3 given)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/deluge/core/rpcserver.py", line 299, in dispatch
    ret = self.factory.methods[method](*args, **kwargs)
TypeError: add_command() takes exactly 6 arguments (3 given)
Looks like the WebUI isn't actually sending the new args to the base methods. Hope this helps.

Re: [Plugin Update] Execute plugin

Posted: Fri Jan 13, 2017 4:17 pm
by romprod
Hi,

Has this been fixed yet?

Re: [Plugin Update] Execute plugin

Posted: Tue Feb 28, 2017 11:44 pm
by lahan
Hi, I'm new to python, but I was trying to work on this plugin to add some features that I wanted (in particular, to pass additional torrent details to the target executable). But, I can't get deluge to load the plugin properly, and I can't figure out why.

The .egg compiles fine without errors after modifying the core.py file, but then when I try to install or turn on the plugin, I get the following error:

Code: Select all

C:\Program Files (x86)\Deluge>deluge-debug.exe
[ERROR   ] 17:11:17 client:391 RPCError Message Received!
--------------------------------------------------------------------------------
RPCRequest: core.enable_plugin(Execute)
--------------------------------------------------------------------------------
  File "deluge\core\rpcserver.py", line 299, in dispatch
  File "deluge\core\core.py", line 538, in enable_plugin
  File "deluge\core\pluginmanager.py", line 82, in enable_plugin
  File "deluge\pluginmanagerbase.py", line 139, in enable_plugin
  File "pkg_resources/__init__.py", line 2515, in activate
  File "pkg_resources/__init__.py", line 2097, in declare_namespace
  File "pkg_resources/__init__.py", line 2046, in _handle_ns
  File "pkgutil.py", line 246, in load_module

ImportError: Bad magic number in C:\Program Files (x86)\Deluge\deluge-1.3.12-py2.6.egg\deluge\__init__.pyc
--------------------------------------------------------------------------------
Unhandled error in Deferred:
I believe the core.py file is the only file I modified. I built the egg with the command setup.py bdist_egg , running python 2.7.12

I read about the magic number error here: http://stackoverflow.com/questions/5143 ... mber-error .
But, I'm not sure how this applies, or why the import function is trying to use python 2.6 instead of python 2.7.

Any help is appreciated; thanks!

Re: [Plugin Update] Execute plugin

Posted: Tue Feb 27, 2018 12:35 am
by Timbiotic
Is it possible to rename this plugin? I cannot get it to work in the webui because it’s built in. I’m using a docker. It shows new features in gtkui but won’t take any of my settings.