JohnDoee / deluge-client

A very lightweight pure-python Deluge RPC Client
MIT License
87 stars 14 forks source link

Auto-detect deluge version? #11

Closed gazpachoking closed 6 years ago

gazpachoking commented 6 years ago

I was thinking we could add a call to 'daemon.info' during the login process, before authenticating. It could catch the error on deluge 1.3, (daemon.info doesn't exist for that,) otherwise it gives the daemon version. This would mean the client could connect to either daemon version without user having to manually specify. I could test and make a PR if you like this idea.

Motivation: We are thinking about switching our deluge plugin in FlexGet to this library, and I'd prefer it worked without user having to specify our deluge version. https://github.com/Flexget/Flexget/pull/2102

JohnDoee commented 6 years ago

Sounds great, I'll test your suggestion and try to get it working.

gazpachoking commented 6 years ago

Hmm. I see what you mean about the timeout. If you send a deluge 1 formatted request to deluge 2, or vice versa, it never responds and just times out. Still trying to figure out if there is a good solution.

gazpachoking commented 6 years ago

I believe I got this working, but it isn't so elegant as I first hoped. Not sure if it can be cleaned up further.

JohnDoee commented 6 years ago

I think you'd have to make the client use non-blocking sockets to work around it and that seems like a lot of work to me for something I don't think the project really needs.

The only time I've hit the timeout problem has been while making mistakes during development and never in production.

If you solution works, then I'd happily accept it.