qBittorrent icon indicating copy to clipboard operation
qBittorrent copied to clipboard

[WebUI] Plugins do not execute the "download_torrent" function

Open LightDestory opened this issue 2 years ago • 10 comments

qBittorrent & operating system versions

qBittorrent: 4.5.0 x64 Operating system: Windows 11 Home Insider Preview (Latest Beta channel) (10.0.22xxx) Qt: 5.15.7 libtorrent-rasterbar: 1.2.18.0

What is the problem?

When trying to download something using search plugins with WebUI the "download_torrent" implementation is not executed.

The plugins can search but when double clicking on a entry nothing happens, moreover if clicking on "right-click->download" it will pop up the "add torrent" form suggesting the "link" property bypassing the "download_torrent" implementation.

Steps to reproduce

  1. Use official or unofficial plugins
  2. Try to download something using them with the usual QT GUI
  3. Try to download something using them with the WebUI

Additional context

This issue has been reported on my repository of unofficial plugins but the same issue is present using the official ones.

Log(s) & preferences file(s)

No response

LightDestory avatar Jan 02 '23 22:01 LightDestory

This issue has been reported here and here

LightDestory avatar Jan 02 '23 22:01 LightDestory

I am having the same issue.

n8petersen avatar Jan 28 '23 20:01 n8petersen

@LightDestory is this ticket still reproducible on 4.6.0 ?

luzpaz avatar Oct 31 '23 10:10 luzpaz

@luzpaz Yes, I tried with Qbit 4.6.1, still same issue

LightDestory avatar Nov 22 '23 23:11 LightDestory

Hello, I still have the issue in Qbit 4.6.2

MarcBresson avatar Dec 24 '23 16:12 MarcBresson

after a little bit of investigation, I think that webUI never actually calls the nova2dl.py script.

Indeed, even after having modified it's content (to hardcode a value) and relaunched the container (making sure __pycache__ was removed in between and recompile when the search tab was clicked on), it still throws the URL instead of the content of the torrent file.

https://github.com/qbittorrent/qBittorrent/blob/ad22237a2f50f9a636ed39bfc3f70e32c0e439ea/src/base/search/searchdownloadhandler.cpp#L50

MarcBresson avatar Jan 08 '24 21:01 MarcBresson

I have noticed that behaviour too. Adding torrents from private trackers via the search engine will result in errors like "expected value (list, dict, int or string) in bencoded string". My guess is that it's trying to download the file outside of the nova2dl script, which will fail since plugins from private trackers rely on some kind of login function provided by the user.

ghost avatar Feb 12 '24 20:02 ghost

@MarcBresson care to make a PR ?

luzpaz avatar Mar 09 '24 23:03 luzpaz

Hey, I'm sorry but I have not enough skills (nor debug tools) in C++ to create such a bugfix. I just wanted to provide more context for this bug so that it can be fixed faster :)

MarcBresson avatar Mar 12 '24 20:03 MarcBresson

Any progress addressing such issue?

I do not have much confidence on C++ to be able to open a PR for this, qbit is a very huge and complex project for me.

Regards, LightDestory

LightDestory avatar May 06 '24 13:05 LightDestory

Any progress addressing such issue?

#20824 adds WebAPI endpoint for downloading .torrent files using search plugins. After it is merged, it remains for someone to change the WebUI so that it uses this method instead of directly downloading .torrent files.

glassez avatar May 11 '24 07:05 glassez

#20824 adds WebAPI endpoint for downloading .torrent files using search plugins. After it is merged, it remains for someone to change the WebUI so that it uses this method instead of directly downloading .torrent files.

@skomerko @Piccirello

xavier2k6 avatar Aug 15 '24 17:08 xavier2k6