Skip to content

Deluge client switch#2102

Merged
gazpachoking merged 16 commits intodevelopfrom
deluge_client_switch
Oct 17, 2018
Merged

Deluge client switch#2102
gazpachoking merged 16 commits intodevelopfrom
deluge_client_switch

Conversation

@gazpachoking
Copy link
Copy Markdown
Member

@gazpachoking gazpachoking commented Mar 16, 2018

Motivation for changes:

Stop requiring a deluge install to connect to deluge daemon. This allows easier configuration on flexget installs which connect to remote deluge daemons, as well as python 3 support in the deluge plugin.

Detailed changes:

To Do:

@JohnDoee
Copy link
Copy Markdown

JohnDoee/deluge-client#5 and other timeout issues might cause problems but will see if I can't get that working properly while adding auto-detection.

@JohnDoee
Copy link
Copy Markdown

JohnDoee commented Mar 17, 2018

I made something like get_localhost_auth already, the resolution should be very similar to the existing Deluge. Feel free to copy/paste etc.
https://github.com/JohnDoee/autotorrent/blob/develop/autotorrent/clients/deluge.py#L55-L96

@movalex
Copy link
Copy Markdown

movalex commented Apr 30, 2018

Tried this on MacOs 10.13 with no success.
Deluge.app 1.3.15 is installed (also tried macports version without luck)
First I've got this error:

2018-05-01 00:40 CRITICAL plugin                        Plugin `flexget.plugins.clients.deluge2` failed to import dependencies
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/flexget/plugin.py", line 396, in _load_plugins_from_dirs
    __import__(module_name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/flexget/plugins/clients/deluge2.py", line 15, in <module>
    from utils.pathscrub import pathscrub
ImportError: No module named utils.pathscrub

So I had to change import in deluge2.py:
from utils.pathscrub import pathscrub to from flexget.utils.pathscrub import pathscrub
as well as from utils.template import RenderError to from flexget.utils.template import RenderError

Then I've got this error.

2018-05-01 00:44 DEBUG    deluge        tv1             Error importing deluge: dynamic module does not define init function (init_openssl)
2018-05-01 00:44 CRITICAL task          tv1             Plugin `deluge` cannot be used because dependency `deluge` is missing.
2018-05-01 00:44 DEBUG    task          tv1             Deluge >=1.2 module and it's dependencies required. ImportError: dynamic module does not define init function (init_openssl)

EDIT
Uh, I forgot to disable app_deluge_find.py plugin. Now the error is following:

2018-05-01 01:14 DEBUG    deluge        tv1             Error importing deluge: No module named deluge.ui.client
2018-05-01 01:14 CRITICAL task          tv1             Plugin `deluge` cannot be used because dependency `deluge` is missing.
2018-05-01 01:14 DEBUG    task          tv1             Deluge >=1.2 module and it's dependencies required. ImportError: No module named deluge.ui.client
2018-05-01 01:14 WARNING  task          tv1             Aborting task (plugin: deluge)
2018-05-01 01:14 DEBUG    task_queue                    task tv1 aborted: TaskAbort(reason=Plugin `deluge` cannot be used because dependency `deluge` is missing., silent=False)

@movalex
Copy link
Copy Markdown

movalex commented May 11, 2018

Sorry, I realized I had to use deluge3 plugin in config. I've created a pull request with working solution.
Initially I had an error with Deluge 1.3.15 installed :

TypeError: __init__() got an unexpected keyword argument 'deluge_version'

So I had to omit deluge_version in DelugeRPCClient setup and everything worked like a charm.

@cvium
Copy link
Copy Markdown
Contributor

cvium commented May 12, 2018

I will try to clean the code a bit when I get time.

EDIT: I've been looking through the code and while there are things that could be nicer, I'm not entirely sure it's worth doing something about it right now. Ideally, I'd like it if we made a wrapper around DelugeRPCClient to get rid of the direct procedure calls in the plugin(s), but meh...

@gazpachoking
Copy link
Copy Markdown
Member Author

Ideally, I'd like it if we made a wrapper around DelugeRPCClient to get rid of the direct procedure calls in the plugin(s)

@cvium Not sure what you mean by this?

I think probably the one thing we should do is implement a very simple version of the get_localhost_auth, so as to not break everybodies setup who is relying on this when we release it.

@gazpachoking
Copy link
Copy Markdown
Member Author

Okay, I added a horrible version of get_localhost_auth. I only say it's horrible, because I'm sure it needs more error handling, and I haven't actually tested that it works.

@cvium
Copy link
Copy Markdown
Contributor

cvium commented May 19, 2018

@gazpachoking Just that deluge-client is very barebones and I don't think calling client.call('core.get_torrents_status', {}, ['name']) directly in the plugin is very nice. If the API changes, it's just easier to maintain if the Deluge plugins use something like client.get_torrents_status('name', 'path').

movalex and others added 2 commits May 19, 2018 08:56
since auth level is not used, this should be enough...
update get_localhost_auth
@gazpachoking
Copy link
Copy Markdown
Member Author

@cvium Not sure I think wrapping is worth it. What about if we just enable a nicer call format in the new client? I think this PR would essentially make the deluge-client calls the same as the native deluge client calls.

JohnDoee/deluge-client#19

@Superchicken
Copy link
Copy Markdown

Specifying a filter under from_deluge in config.yml does not filter the entries.

the self.get_torrents_status call on line 220 only sends one argument, it should send the filter as the second argument.

@gazpachoking gazpachoking changed the title [WIP] Deluge client switch Deluge client switch Oct 17, 2018
@gazpachoking gazpachoking merged commit c1d5c12 into develop Oct 17, 2018
cpoppema added a commit to cpoppema/docker-flexget that referenced this pull request Oct 20, 2018
kal444 pushed a commit to kal444/docker-flexget-lsio that referenced this pull request Dec 8, 2018
@gazpachoking gazpachoking deleted the deluge_client_switch branch January 28, 2019 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants