"Run external program on torrent completion" is not working

If you run qBittorrent in / with Docker.
Post Reply
bszabo
Newbie
Newbie
Posts: 1
Joined: Sat Feb 04, 2023 5:50 pm

"Run external program on torrent completion" is not working

Post by bszabo »

I have qBittorrent set up in a docker container running on RPi, here's my compose information:

Code: Select all

---
version: "2.1"
services:
  qbittorrent:
    image: lscr.io/linuxserver/qbittorrent
    container_name: qbittorrent
    environment:
      - PUID=[myUID]
      - PGID=[myGID]
      - TZ=Europe/Stockholm
      - WEBUI_PORT=8080
    volumes:
      - [myConfigFolder]:/config
      - [myMoviesFodler]:/movies
      - [myTVShowsFolder]:/tv_shows
    ports:
      - 6881:6881
      - 6881:6881/udp
      - 8080:8080
    restart: unless-stopped
And I want to run a bash script when a torrent is completed, here's a script that I'm using for testing:
\config\custom-scripts\test.sh

Code: Select all

#!\bin\bash
echo "Torrent name: $1, Content path: $2, Rooth path: $3, Save path: $4" > testNames.txt
I set its permission to 755 and if I run it from the container's terminal it runs just fine.

But when I set up in the qBittorrent to run it after a torrent completed, nothing happens.
I set up the command like this:

Code: Select all

bash /config/custom-scripts/test.sh "%N" "%F" "%R" "%D"
Based on the logs (see below) it seems like that there was an attempt to execute the script but something doesn't work, since the file is not created as it should be.

Code: Select all

(N) 2023-02-04T19:06:45 - Torrent: [torrentName], running external program, command: bash /config/custom-scripts/test.sh "[torrentName]" "/movies/[torrentName]" "/movies/[torrentName]" "/movies"
Any idea what is wrong or some way to debug it and find out what goes wrong?
Guibuu
Newbie
Newbie
Posts: 1
Joined: Thu Feb 23, 2023 7:46 pm

Re: "Run external program on torrent completion" is not working

Post by Guibuu »

I have the same problem.

I've tried with qbittorrentofficial/qbittorrent-nox and linuxserver/qbittorrent with the same results.

1. I bound in the container the /test folder and gave it the correct permissions.
2. In qBittorrent > Options > Run external program on torrent finished I write touch /test/"%N".txt
3. I download some torrent, for example LibreOffice_7.5.0_Win_x86-64_helppack_en-GB.msi
4. When the torrent finishes, in /test appears the file _8L2JY~H.TXT, so I think qBittorrent is passing the parameters incorrectly.
zargas
Newbie
Newbie
Posts: 2
Joined: Thu Mar 23, 2023 12:03 pm

Re: "Run external program on torrent completion" is not working

Post by zargas »

Hi,
I have exactelly the same issue with the option "Run external program", nothing works ! :'( :'( :'(

I don't now how to run script on torrent finish !

Are you still stuck at this step ?

I use qBittorrent v4.5.2 Web UI (64-bit) docker on Unraid.
zargas
Newbie
Newbie
Posts: 2
Joined: Thu Mar 23, 2023 12:03 pm

Re: "Run external program on torrent completion" is not working

Post by zargas »

zargas wrote: Thu Mar 23, 2023 12:08 pm Hi,
I have exactelly the same issue with the option "Run external program", nothing works ! :'( :'( :'(

I don't now how to run script on torrent finish !

Are you still stuck at this step ?

I use qBittorrent v4.5.2 Web UI (64-bit) docker on Unraid.
For me, the script was run, but it was a wrong permission on a folder. I changed the owner and it seem's to work, now let's go for the true script !
xupetas
Newbie
Newbie
Posts: 1
Joined: Sun Apr 09, 2023 2:29 pm

Re: "Run external program on torrent completion" is not working

Post by xupetas »

Hi,

Same issue here:

Here it did not run:

qbittorrent.log.bak1619:(N) 2023-03-16T20:07:45 - Added new torrent. Torrent: "The Evaluation"
qbittorrent.log.bak1629:(N) 2023-03-16T23:49:10 - Enqueued torrent move. Torrent: "The Evaluation". Source: "/mnt/slice/slice0/torrents.tmp". Destination: "/mnt/slice/slice1/staging"
qbittorrent.log.bak1629:(N) 2023-03-16T23:49:19 - Torrent reached the share ratio limit. Removed torrent. Torrent: "The Evaluation".
qbittorrent.log.bak1629:(N) 2023-03-16T23:51:24 - Removed torrent. Torrent: "The Evaluation"

Here it did:

qbittorrent.log:(N) 2023-04-09T11:14:52 - Running external program. Torrent: "Erica Duchess My Spirit Told Me (2022) [1080p] [WEBRip] [YTS.MX]". Command: `/usr/bin/bash /pub/p2p/qbittorrent/external.sh '/mnt/slice/slice1/staging/Erica Duchess My Spirit Told Me (2022) [1080p] [WEBRip] [YTS.MX]' 'RSS' 'Erica Duchess My Spirit Told Me (2022) [1080p] [WEBRip] [YTS.MX]' 81c8841bacd54ee96169d924080e6b9f46f92cee`

What am i missing?
Post Reply