[Plugin Update] Execute plugin

Suggest, post, or discuss plugins for Deluge
ult.nrg
Member
Member
Posts: 10
Joined: Thu Sep 01, 2016 6:41 am

[Plugin Update] Execute plugin

Post 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.
Autocat
Member
Member
Posts: 19
Joined: Sun Nov 20, 2016 1:16 pm

Re: [Plugin Update] Execute plugin

Post by Autocat »

wow this looks really nice, going to test it!
Autocat
Member
Member
Posts: 19
Joined: Sun Nov 20, 2016 1:16 pm

Re: [Plugin Update] Execute plugin

Post 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?
ult.nrg
Member
Member
Posts: 10
Joined: Thu Sep 01, 2016 6:41 am

Re: [Plugin Update] Execute plugin

Post by ult.nrg »

Just quickly checked, WebUI working here and has the new options (screenshot attached)
Attachments
webui execute.png
webui execute.png (82.79 KiB) Viewed 20747 times
doppel
New User
New User
Posts: 2
Joined: Tue Nov 29, 2016 7:13 pm

Re: [Plugin Update] Execute plugin

Post 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?
ult.nrg
Member
Member
Posts: 10
Joined: Thu Sep 01, 2016 6:41 am

Re: [Plugin Update] Execute plugin

Post 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. :)
doppel
New User
New User
Posts: 2
Joined: Tue Nov 29, 2016 7:13 pm

Re: [Plugin Update] Execute plugin

Post 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.
romprod
Member
Member
Posts: 13
Joined: Mon Jun 29, 2015 8:56 pm

Re: [Plugin Update] Execute plugin

Post by romprod »

Hi,

Has this been fixed yet?
lahan

Re: [Plugin Update] Execute plugin

Post 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!
Timbiotic
New User
New User
Posts: 2
Joined: Sat Feb 24, 2018 8:13 pm

Re: [Plugin Update] Execute plugin

Post 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.
Post Reply