qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
26.07k stars 3.84k forks source link

qBittorrent-nox v4.2.5 does not detect bad torrent files or advise user torrent file is invalid. #12650

Open sunrisepi opened 4 years ago

sunrisepi commented 4 years ago

Please provide the following information

qBittorrent version and Operating System

qBittorrent-nox v4.2.5, raspbian (buster)

If on linux, libtorrent-rasterbar and Qt version

What is the problem

Noticing an issue with qBittorrent-nox v4.2.5 in raspbian (buster build). It does not detect invalid/corrupt torrent files. Please advise?

What is the expected behavior

qBittorrent-nox v4.2.5 should detect bad torrent file and advise user

Steps to reproduce

After some more research, it seems qBittorrent-nox does not report that the torrent file is invalid. I figured this out after comparing to 2 other bittorrent clients.

Now if I try qBittorrent v4.2.2 in Windows, it detects the bad torrent file:

Now checking transmission v2.9.2 (14714) in raspbian (buster/Linux), it also detects the bad torrent file:

Extra info(if any)

It's a bit disappointing to see qBittorrent-nox not working as expected, after all the effort to compile and install it. Is this a known issue with not detecting bad torrent files? How do we fix this? Thanks.

FranciscoPombal commented 4 years ago

I managed to reproduce this on 4.2.5. Looks like a bug both in the plugin and in qBittorrent.

On the plugin side, the Download link and description page URLs both point to the description page. This is wrong, at least for this plugin.

On the qBittorrent side, when using the GUI, qBittorrent manages to get the magnet link correctly (somehow), while it silently fails to do so with the WebUI.

Even after the plugin is fixed, this silent failure should also be fixed.

@Piccirello @glassez

Piccirello commented 4 years ago

The web UI/API's silent failure bubbles back up to #10960. We just don't have good, standardized error handling for our API endpoints.

sunrisepi commented 4 years ago

Thanks for the info. When a version update/bugfix is released, I'll see if that fixes the issue. In the meantime, I'll be more watchful of the torrents I add, since qBittorrent itself cannot advise me if the torrent is invalid.

FranciscoPombal commented 4 years ago

I'll be more watchful of the torrents I add, since qBittorrent itself cannot advise me if the torrent is invalid.

It can, except on the WebUI/API where there is some kind of bug.

sunrisepi commented 4 years ago

Thanks. Unfortunately I am using qBittorrent via WebUI on my raspberry pi (which is running headless), so I'm not sure how to avoid the issue until the bug is fixed. :relaxed:

Piccirello commented 4 years ago

On the qBittorrent side, when using the GUI, qBittorrent manages to get the magnet link correctly (somehow), while it silently fails to do so with the WebUI.

@FranciscoPombal I've been trying to look into this issue. Did the GUI in fact get the correct magnet link, or did it just throw an error because the link was invalid? The GUI and Web UI now seem to use identical logic (AFAICT) for downloading links.

FranciscoPombal commented 4 years ago

@Piccirello The GUI somehow gets the correct magnet. Could it be that the GUI and WebAPI use different parts of the plugin API for this action?

FranciscoPombal commented 4 years ago

@Piccirello https://github.com/qbittorrent/qBittorrent/issues/12532#issuecomment-619659586

Anteus commented 3 years ago

This is how the WebUI /torrent/add work: https://github.com/qbittorrent/qBittorrent/blob/fda6def384d2ab7ff31595f54d53548a3f0eee8d/src/webui/api/torrentscontroller.cpp#L668

And this is how it works in the normal UI: https://github.com/qbittorrent/qBittorrent/blob/fda6def384d2ab7ff31595f54d53548a3f0eee8d/src/gui/search/searchjobwidget.cpp#L286

Could maybe add something like this to the TorrentsController::addAction?

        SearchDownloadHandler *downloadHandler = m_searchHandler->manager()->downloadTorrent(siteUrl, torrentUrl);
        connect(downloadHandler, &SearchDownloadHandler::downloadFinished, this, &SearchJobWidget::addTorrentToSession);
        connect(downloadHandler, &SearchDownloadHandler::downloadFinished, downloadHandler, &SearchDownloadHandler::deleteLater);

In the UI you also just get the description page link if you right click on a search result and copy download link.

Some linked issues https://github.com/qbittorrent/qBittorrent/issues/11150 https://github.com/qbittorrent/search-plugins/issues/160