idlesign / deluge-webapi

Plugin for Deluge WebUI providing sane JSON API
https://github.com/idlesign/deluge-webapi
BSD 3-Clause "New" or "Revised" License
120 stars 27 forks source link

Deluge 2 support. 2.0 beta 1 supported? #14

Closed goldenpipes closed 5 years ago

goldenpipes commented 6 years ago

Title says it all.

idlesign commented 6 years ago

Not tested. Give it a try.

goldenpipes commented 6 years ago

doesn't seem to be working at least not with the program im trying to use. not sure if its because deluge changed something though.

idlesign commented 6 years ago

Thank you for the report, yet without log or debug info, we can't tell for sure.

goldenpipes commented 6 years ago

ill get back on this soon

idlesign commented 5 years ago

According to https://github.com/idlesign/deluge-webapi/issues/21#issuecomment-501567509 we're not compatible.

v1ru535 commented 5 years ago

Sorry I can't provide logs with this docker: linuxserver/deluge No option to overload command for debug logging. So, I tried to kill the process and restart it in debug mode directly from the container but it doesn't work. :/

edit: I also tried https://deluge-webapi.readthedocs.io/en/latest/quickstart.html#debug

edit2: Just this in log:

 [INFO    ][deluge.pluginmanagerbase      :189 ] Plugin Label enabled...
 [INFO    ][deluge.pluginmanagerbase      :189 ] Plugin Blocklist enabled...
 [WARNING ][deluge.pluginmanagerbase      :132 ] Cannot enable non-existant plugin WebAPI

But this is from the old plugin installation in"plugins/.python-eggs/WebAPI-0.3.2-py2.7.egg-tmp/webapi/data/webapi.js", I think.

At import we have this in the plugin folder: "[object FileList]" So, I tried to put the egg directly on but it doesn't change anything.

This docker is not good for debugging but I give a try :/

balthazar commented 5 years ago

On 2.0.3 and getting the same behavior, can't upload through the form or I get an [object FileList] filename. Manually adding the .egg in ./plugins doesn't seem to work as the plugin doesn't appear in the list even after rebooting the processes. Logs from either deluged or deluge-web do not output anything meaningful either

lastb0isct commented 5 years ago

Getting the same issue here with Docker. No way to upload the .egg as it comes up with object filelist

STaRDoGG commented 5 years ago

Anything on this yet? I ran into this last night.

idlesign commented 5 years ago

Anything on this yet? I ran into this last night.

Nothing so far. I quit using Deluge, so it may be a long time before I dedicate a spare time to the issue. Pull requests are more than welcome.

STaRDoGG commented 5 years ago

@idlesign out of curiosity what torrent soft do ya use now that you don't use Deluge?

idlesign commented 5 years ago

Transmission. I find it more lightweight and having sane HTTP API out of box, so it fits my NAS well.

Tuumke commented 5 years ago

Getting the same issue here with Docker. No way to upload the .egg as it comes up with object filelist

+1

Coolfeather2 commented 5 years ago

This plugin is used for organizr, so it would be nice to get it working https://github.com/causefx/Organizr

razer86 commented 5 years ago

Deluge 2 is now using Python3

I recompiled to an egg within the Deluge2 container, was able to install the plugin, but it will not enable.

Tuumke commented 5 years ago

Any news on this? When will the plugin be available for install again?

Tuumke commented 5 years ago

@idlesign any response would be appreciated?! It's been quiet for a long time now...

idlesign commented 5 years ago

@Tuumke Sorry, nothing to add to https://github.com/idlesign/deluge-webapi/issues/14#issuecomment-507906530 for now.

ivanfilippov commented 5 years ago

I took a stab at this.

It works for me in both standalone deluge and in the binhex/arch-delugevpn docker image, and I've tested all four of the API endpoints the egg implements. Would anyone be able to try it out and give feedback? The egg is here.

This is the (unrelated) issue I'm coming from: https://github.com/binhex/arch-delugevpn/issues/100

I'm having issues getting plugins installed via WebUI (I think it's a deluge issue, but I'm still looking into it). If you can install it via that, go for it, otherwise install it into plugins directory directly.

Make sure to clear out any references to the previous egg before trying this:

rm -rf /config/plugins/WebAPI*
rm -rf /home/nobody/.cache/Python-Eggs/WebAPI*

Then restart deluged/deluge-web, log in to the WebUI and enable the WebAPI plugin via the Preferences menu.

Let me know how it goes!

Coolfeather2 commented 5 years ago

I'll give it a go this afternoon

razer86 commented 5 years ago

@ivanfilippov I had to rename the egg to 3.6 due to the linuxserver docker having python3.6 After that the plugin showed up in Deluge, Organizr can communicate with the API, but its not getting details through (see pic - https://www.dropbox.com/s/wz1d0w7x6fcx6nz/deluge_organizr.PNG?dl=0)

Edit: Was about to fork and recompile using 3.6 but noticed you had already done that!! Using the 3.6 egg has the same result however

ivanfilippov commented 5 years ago

Thanks for testing @razer86!

I just retested against Deluge 2.0.3 (under python 3.7) with this egg and it does return the torrent data (see screenshot below). I'm guessing that Organizr requests more fields from the API (your screenshot shows 6 columns, and the API returns 4 by default) and I didn't account for code changes required for the field filter. image

I'm not an Organizr user so I'll have to deploy it and see if I can figure it out.

ivanfilippov commented 5 years ago

Ok got it: image

I was a bit off on my prediction: Organizr is sending the field filter as a string to WebAPI (ref #1, ref #2), but WebAPI expects it to be a JSON list type (which converts nicely into a Python list type). Basically, Organizr is sending this API request:

{"id": 1, "method": "webapi.get_torrents", "params": [null, "comment, download_payload_rate, eta, hash, ..."]}

but instead needs to send this (note the quotes and square brackets):

{"id": 1, "method": "webapi.get_torrents", "params": [null, ["comment","download_payload_rate", "eta", "hash", ...]]}

The fix could be made on the Organizr side, but I just made WebAPI check what kind of data it receives and act accordingly. It's working in my tests, please test again and let me know how it goes for you.

WebAPI-0.4.3-py3.6.egg

WebAPI-0.4.3-py3.7.egg

Coolfeather2 commented 5 years ago

works amazing

ivanfilippov commented 5 years ago

Thanks for testing @Coolfeather2!

Once @razer86 is able to test the latest changes and provide feedback I'll put in a pull request.

razer86 commented 5 years ago

@ivanfilippov Just had a sec to test the new egg now. Working perfecting for Organizr. Name, State, Size, Downloaded, Uploaded and Percent all have correct values This is using the 3.6 egg as the linuxserver/deluge container is still using python3.6

idlesign commented 5 years ago

Ivan has made a good job. Everyone is advised to get 0.4.0 from https://github.com/idlesign/deluge-webapi/tree/master/dist