qbittorrent / qBittorrent

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

qbittorrent-nox - download via the magnet link generated by the search tool in the web-app not working #14635

Closed 6a closed 3 years ago

6a commented 3 years ago

qBittorrent version and Operating System

qBittorrent v4.3.4.1 Web UI on Firefox 87.0 (qbittorrent-nox on Ubuntu 20.04.2 LTS)

If on linux, libtorrent-rasterbar and Qt version

I don't know how to check, sorry

What is the problem

For your reference, the magnet link generated when trying to download a copy of Ubuntu 18 from The Pirate Bay looks like this:

magnet%3A%3Fxt%3Durn%3Abtih%3ACF7DA7AB4D4E6125567BD979994F13BB1F23DDDD%26dn%3DLinux%2BUbuntu%2B18.04.02%26tr%3Dudp%253A%252F%252Ftracker.coppersurfer.tk%253A6969%252Fannounce%26tr%3Dudp%253A%252F%252Ftracker.leechers-paradise.org%253A6969%252Fannounce%26tr%3Dudp%253A%252F%252Ftracker.opentrackr.org%253A1337%252Fannounce%26tr%3Dudp%253A%252F%252Ftracker.openbittorrent.com%253A80%252Fannounce%26tr%3Dudp%253A%252F%252Fexodus.desync.com%253A6969%252Fannounce%26tr%3Dudp%253A%252F%252F9.rarbg.me%253A2710%252Fannounce%26tr%3Dudp%253A%252F%252F9.rarbg.to%253A2710%252Fannounce%26tr%3Dudp%253A%252F%252Ftracker.tiny-vps.com%253A6969%252Fannounce%26tr%3Dudp%253A%252F%252Fretracker.lanta-net.ru%253A2710%252Fannounce%26tr%3Dudp%253A%252F%252Fopen.demonii.si%253A1337%252Fannounce

But the magnet link generated when you Right click > Copy > Download Link looks like this:

magnet:?xt=urn:btih:CF7DA7AB4D4E6125567BD979994F13BB1F23DDDD&dn=Linux+Ubuntu+18.04.02&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80%2Fannounce&tr=udp%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=udp%3A%2F%2F9.rarbg.me%3A2710%2Fannounce&tr=udp%3A%2F%2F9.rarbg.to%3A2710%2Fannounce&tr=udp%3A%2F%2Ftracker.tiny-vps.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fretracker.lanta-net.ru%3A2710%2Fannounce&tr=udp%3A%2F%2Fopen.demonii.si%3A1337%2Fannounce

What is the expected behavior

The torrent is added onto the list in the transfers tab

Steps to reproduce

  1. Enter the Search Tab
  2. Search for Ubuntu 18 on The Pirate Bay
  3. Right click on a result and select Download - note that the magnet link in the box is encoded
  4. Press Download
  5. Return to the Transfers tab - note that the torrent has not been added

Extra info(if any)

It was working find a few days ago? Perhaps something was broken recently.

If you need anything else, let me know.

thalieht commented 3 years ago

Same in 4.3.3

xnoreq commented 3 years ago

This is still broken as the magnet links are now encoded multiple times but decoded only once.

xnoreq commented 3 years ago

https://github.com/qbittorrent/qBittorrent/blame/5beb1b2cd06e5655ad921052b05c9201ba42a7a2/src/webui/www/private/scripts/mocha-init.js#L123

Why does this add another call to encodeURIComponent? Shouldn't this be decodeURIComponent? But even with that fix the commit should be reconsidered, as it breaks "|" in URLs.

xavier2k6 commented 3 years ago

Fix will be in next release.