erickok / transdroid

Manage your torrents from your Android device
GNU General Public License v3.0
1.28k stars 201 forks source link

magnet link space handling #618

Open Bijiont opened 1 year ago

Bijiont commented 1 year ago

Clicking magnet links from websites any %20 in the filename are ignored resulting in torrent filename with no spaces in Qbittorrent. Behavior only happens from web, clicking the item from Transdroid search doesn't produce the issue.

Example: magnet:?xt=urn:btih:XWONC453ILPKFUTYPR7JRQYH3IGK5YAB&dn=%5BSubsPlease%5D%20Made%20in%20Abyss%20-%20Retsujitsu%20no%20Ougonkyou%20-%2001%20%28720p%29%20%5BD21BAA11%5D.mkv&xl=209942958&tr=http%3A%2F%2Fnyaa.tracker.wf%3A7777%2Fannounce&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2F9.rarbg.to%3A2710%2Fannounce&tr=udp%3A%2F%2F9.rarbg.me%3A2710%2Fannounce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.internetwarriors.net%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.cyberia.is%3A6969%2Fannounce&tr=udp%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker3.itzmx.com%3A6961%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce&tr=udp%3A%2F%2Ftracker.tiny-vps.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fretracker.lanta-net.ru%3A2710%2Fannounce&tr=http%3A%2F%2Fopen.acgnxtracker.com%3A80%2Fannounce&tr=wss%3A%2F%2Ftracker.openwebtorrent.com

Qbittorrent 4.4.3.1 on Windows 10. Transdroid configured with Windows OS in optional.

bwitt commented 1 year ago

In my experience it's just the title that doesn't have spaces; the actual file inside which is being written to has spaces. Is that how it is for you? or does the actual file on disk not have spaces?

qBittorrent 4.3.9 on Linux

bwitt commented 1 year ago

It appears to be stripping the whitespace here: https://github.com/erickok/transdroid/blob/aadddd0d3ac926bb376e956e2d2451f7d91ff638/app/src/main/java/org/transdroid/daemon/task/AddByMagnetUrlTask.java#L35

bwitt commented 1 year ago

Was added here https://github.com/erickok/transdroid/pull/551

bwitt commented 1 year ago

~maybe we could replace only ` (actual space) instead of\s(any whitespace chars including%20`)~ no that doesn't work

Bijiont commented 1 year ago

In my experience it's just the title that doesn't have spaces; the actual file inside which is being written to has spaces. Is that how it is for you? or does the actual file on disk not have spaces?

qBittorrent 4.3.9 on Linux

That is correct, the spaces only appear in QB under the "Name" section. I am not sure if this is the same as Title as mentioned.

I understand this may fall into "can't please everyone", I didn't see it was something added.

bwitt commented 1 year ago

Do magnet links always need %20 for space or is it somehow possible for them to have literal spaces in them?

Bijiont commented 1 year ago

Do magnet links always need %20 for space or is it somehow possible for them to have literal spaces in them?

Unsure, all magnet links I have used all contain %20 for spaces.

MyGitHub5 commented 1 year ago

%20 Should be Space and it's remove

Please Fix This...

MyGitHub5 commented 5 months ago

Up