[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
OS or Distro: Windows

[Plugin Update] Execute plugin

Postby ult.nrg » Sun Oct 16, 2016 3:42 am

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.

Robin
Member
Member
Posts: 14
Joined: Sun Nov 20, 2016 1:16 pm
OS or Distro: Windows 10

Re: [Plugin Update] Execute plugin

Postby Robin » Mon Nov 21, 2016 7:18 pm

wow this looks really nice, going to test it!

Robin
Member
Member
Posts: 14
Joined: Sun Nov 20, 2016 1:16 pm
OS or Distro: Windows 10

Re: [Plugin Update] Execute plugin

Postby Robin » Mon Nov 21, 2016 7:25 pm

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
OS or Distro: Windows

Re: [Plugin Update] Execute plugin

Postby ult.nrg » Sat Nov 26, 2016 6:36 am

Just quickly checked, WebUI working here and has the new options (screenshot attached)
Attachments
webui execute.png
webui execute.png (82.79 KiB) Viewed 5965 times

doppel
New User
New User
Posts: 2
Joined: Tue Nov 29, 2016 7:13 pm
OS or Distro: linux

Re: [Plugin Update] Execute plugin

Postby doppel » Tue Nov 29, 2016 7:16 pm

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
OS or Distro: Windows

Re: [Plugin Update] Execute plugin

Postby ult.nrg » Wed Nov 30, 2016 10:26 am

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
OS or Distro: linux

Re: [Plugin Update] Execute plugin

Postby doppel » Thu Dec 01, 2016 12:27 pm

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
New User
New User
Posts: 9
Joined: Mon Jun 29, 2015 8:56 pm
OS or Distro: Linux

Re: [Plugin Update] Execute plugin

Postby romprod » Fri Jan 13, 2017 4:17 pm

Hi,

Has this been fixed yet?

lahan
New User
New User
Posts: 1
Joined: Tue Feb 28, 2017 11:29 pm
OS or Distro: Windows 10

Re: [Plugin Update] Execute plugin

Postby lahan » Tue Feb 28, 2017 11:44 pm

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!


Return to “Plugins”

Who is online

Users browsing this forum: Bing [Bot] and 14 guests