External program not running if torrent name/folder has ampersands #11689

Open
opened 2026-02-21 21:48:50 -05:00 by deekerman · 4 comments
Owner

Originally created by @RivenSkaye on GitHub (Feb 2, 2021).

qBittorrent version and Operating System

qBT 4.3.1 on Windows 10 (10.0.1xxxx)

If on linux, libtorrent-rasterbar and Qt version

N/A

What is the problem

External command/program is not being run properly if the torrent name and/or content directory contain ampersands (&).
Copy-pasting the line from the log file into either the Run dialog or into CMD.exe works just fine, the command itself is just sending some info about the torrent to a script
C:\Utilities\mkpls.cmd "%F" "%L" %C (the script internally runs a few commands to create a playlist file based on the category and the amount of files in the torrent). Works on most, if not all torrents except for torrents where the name contains an ampersand. Can provide the torrent and content folder name if needed, it downloads just fine.

What is the expected behavior

Command runs as it would through either CMD.exe or the Run dialog

Steps to reproduce

Download any torrent that produces ampersands in its content path and set up the client to pass that on to a script.
Not quoting causes the expected problems of the string being parsed as several commands, quoting causes silent failure.

Extra info(if any)

Have not had any other issues with regards to content folder names, but I can imagine certain special characters can cause platform-specific issues. This is not yet certain.

Originally created by @RivenSkaye on GitHub (Feb 2, 2021). ### qBittorrent version and Operating System qBT 4.3.1 on Windows 10 (10.0.1xxxx) ### If on linux, libtorrent-rasterbar and Qt version N/A ### What is the problem External command/program is not being run properly if the torrent name and/or content directory contain ampersands (&). Copy-pasting the line from the log file into either the Run dialog or into CMD.exe works just fine, the command itself is just sending some info about the torrent to a script `C:\Utilities\mkpls.cmd "%F" "%L" %C` (the script internally runs a few commands to create a playlist file based on the category and the amount of files in the torrent). Works on most, if not all torrents **except** for torrents where the name contains an ampersand. Can provide the torrent and content folder name if needed, it downloads just fine. ### What is the expected behavior Command runs as it would through either CMD.exe or the Run dialog ### Steps to reproduce Download any torrent that produces ampersands in its content path and set up the client to pass that on to a script. Not quoting causes the _expected_ problems of the string being parsed as several commands, quoting causes silent failure. ### Extra info(if any) Have not had any other issues with regards to content folder names, but I can imagine certain special characters can cause platform-specific issues. This is not yet certain.
Author
Owner

@luzpaz commented on GitHub (Jun 11, 2023):

Related to #18457

@luzpaz commented on GitHub (Jun 11, 2023): Related to #18457
Author
Owner

@RivenSkaye commented on GitHub (Jun 11, 2023):

This is not related as far as I can tell, since this seems to be a problem with parsing and escaling text so an external runner can properly process it. Which has nothing to do with actions taken when qBT itself errors

@RivenSkaye commented on GitHub (Jun 11, 2023): This is not related as far as I can tell, since this seems to be a problem with parsing and escaling text so an _external_ runner can properly process it. Which has nothing to do with actions taken when qBT itself errors
Author
Owner

@luzpaz commented on GitHub (Aug 10, 2023):

@Chocobo1 is this issue impacted by a427b9228d ?

@luzpaz commented on GitHub (Aug 10, 2023): @Chocobo1 is this issue impacted by a427b9228d8e3c7d45ce2c1e560ba307eb6c475d ?
Author
Owner

@Chocobo1 commented on GitHub (Aug 10, 2023):

@Chocobo1 is this issue impacted by github.com/qbittorrent/qBittorrent@a427b9228d ?

That is not related.

@Chocobo1 commented on GitHub (Aug 10, 2023): >@Chocobo1 is this issue impacted by https://github.com/qbittorrent/qBittorrent/commit/a427b9228d8e3c7d45ce2c1e560ba307eb6c475d ? That is not related.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#11689
No description provided.