qbittorrent / qBittorrent

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

Perform a check when adding an incompatible list URL #13061

Open AnonymousWP opened 4 years ago

AnonymousWP commented 4 years ago

Please provide the following information

In advance, sorry if this has been reported already (I've searched before, but couldn't find a similar issue that was opened/closed).

qBittorrent version and Operating System

qBittorrent version: 4.2.5 Operating System: Windows 10 1909, build 18363.900

What is the problem

It'd be nice if the trackers addition dialog would perform a check when inputting an incompatible URL. When inputting a URL, this causes qBittorrent to load infinitely, which leads to a freeze very shortly after that. Probably the result of a too much input. A force shut down of qBittorrent doesn't help, as the list won't be removed after you start it again. The only solution was to uninstall qBittorrent and removing its torrents, which is time consuming (having to look up magnet link + re-add torrent + let qBittorrent perform a check if files are already there).

What is the expected behavior

It'd be nice if there'd be a check in place that checks if the URL you've put, is compatible or not. It's also not known what compatible list URLs are. An information icon with a small description would be nice.

Steps to reproduce

  1. Select a torrent in qBittorrent
  2. Go to trackers at the bottom
  3. Right mouse click
  4. Add a new tracker
  5. Paste this URL at the bottom text box: https://github.com/ngosang/trackerslist/blob/master/trackers_all.txt
  6. Click the icon next to it
  7. Will endlessly load and freeze

Extra info(if any)

Video in a ZIP file: Freezing issue qBittorrent.zip

NOTE: I could only reproduce this issue when downloading a file on my external hard drive (not on my SSD). Probably due to the fact that SSDs have a significant better performance when performing smaller, multiple tasks.

FranciscoPombal commented 4 years ago

EDIT: read the next comment and please ignore this one. It was written under the assumption that you had pasted https://github.com/ngosang/trackerslist/blob/master/trackers_all.txt into the trackers list as if it were a tracker URL. Then I watched the video and understood what you really meant.

5. Paste this URL at the bottom text box: https://github.com/ngosang/trackerslist/blob/master/trackers_all.txt

The "add new tracker" dialog is for adding actual tracker URLs which qBittorrent will attempt to announce to. You're not supposed to paste a URL to a text file containing tracker URLS there; you're supposed to paste the actual tracker URLs:

udp://tracker.coppersurfer.tk:6969/announce
udp://tracker.leechers-paradise.org:6969/announce
... etc ...

~Support for URLs containing lists of trackers (and possibly auto-update of such lists) has already been requested, I believe.~ EDIT: not relevant for this situation; it was referring to Tools->Preferences->Bittorrent->Automatically add these trackers to new downloads

I don't know off the top of my head how much validation is performed, but technically https://github.com/ngosang/trackerslist/blob/master/trackers_all.txt is a valid URL, and since tracker URLs can be arbitrary valid URLs (although typically they are are of the form {http(s),udp}://tracker_hostname:port/announce), there is no reason why it should be rejected.

One thing is strange though: this should not result in a freeze anyway, either with an HDD or SSD (and the type of storage medium really should not matter here). qBittorrent should simply try to announce to the URL, and if it fails (which would be the case), just label it Not working.

FranciscoPombal commented 4 years ago

Ok I just watched the video. Looks like you're trying to use the "utorrent compatible list" function. It did not work because https://github.com/ngosang/trackerslist/blob/master/trackers_all.txt is a link to an HTML page. As you can see in the video, each HTML line was taken to be a URL, which will obviously not work. You can also see that no validation is performed, which is certainly not ideal. Use https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt instead (which is the URL to the raw text file), and it will work.

I will consider this one a feature request for the URL validation.

AnonymousWP commented 4 years ago

Ok I just watched the video. Looks like you're trying to use the "utorrent compatible list" function. It did not work because https://github.com/ngosang/trackerslist/blob/master/trackers_all.txt is a link to an HTML page. As you can see in the video, each HTML line was taken to be a URL, which will obviously not work. You can also see that no validation is performed, which is certainly not ideal. Use https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt instead (which is the URL to the raw text file), and it will work.

I will consider this one a feature request for the URL validation.

@FranciscoPombal

Of course, I know why it doesn't work. The reason why I'm filing this issue is purely because of that there's no check in place. It should inform me that the URL I've put, isn't valid and therefore won't be pasted (which caused a permanent freeze, which led to the fact that I had to re-install and remove the torrent file). That's why I was filing this issue as well; so an update will contain that an URL validation is made when inputting an invalid URL.