Passing "qBit parameter" to python script via "Run external program on torrent completion" doesn't work #10670

Open
opened 2026-02-21 20:54:00 -05:00 by deekerman · 0 comments
Owner

Originally created by @Accelerox on GitHub (Jul 5, 2020).

qBittorrent version and Operating System

qBittorrent v4.3.0alpha1 Web UI (64-bit)
Ubuntu 20.04 LTS

libtorrent-rasterbar and Qt version

libtorrent-rasterbar10/focal,now 1.2.6+git20200425.a9968916ca-1ppa1~20.04 amd64
Qt version 5.12.8

Issue

When passing a parameter to a python script via "Run external program on torrent completion" the script doesn´t execute.

Tried solutions

Passing parameter as "%N" instead of %N
Restarting qBit
Reinstalling qBit
Restarting Ubuntu

Steps to reproduce

Execute following command at complete "/path/complete_script.py %N > /path/logs"

complete_script.py:

#!/usr/bin/env python3
import sys, subprocess

parameters = sys.argv
name = parameters[1]

print("The name of the torrent is " + name)

subprocess.run(["touch", "IHaveExecuted"])

Expected outcome

The file "logs" contains following text: The name of the torrent is {name} and a file named IHaveExecuted has been created.

Originally created by @Accelerox on GitHub (Jul 5, 2020). ### qBittorrent version and Operating System qBittorrent v4.3.0alpha1 Web UI (64-bit) Ubuntu 20.04 LTS ### libtorrent-rasterbar and Qt version libtorrent-rasterbar10/focal,now 1.2.6+git20200425.a9968916ca-1ppa1~20.04 amd64 Qt version 5.12.8 ### Issue When passing a parameter to a python script via "Run external program on torrent completion" the script doesn´t execute. ### Tried solutions Passing parameter as "%N" instead of %N Restarting qBit Reinstalling qBit Restarting Ubuntu ### Steps to reproduce Execute following command at complete "/path/complete_script.py %N > /path/logs" complete_script.py: >#!/usr/bin/env python3 >import sys, subprocess > >parameters = sys.argv >name = parameters[1] > >print("The name of the torrent is " + name) > >subprocess.run(["touch", "IHaveExecuted"]) ### Expected outcome The file "logs" contains following text: The name of the torrent is {name} and a file named IHaveExecuted has been created.
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#10670
No description provided.