v3.3.10 run external program on completion no longer working #5014

Closed
opened 2026-02-21 17:37:24 -05:00 by deekerman · 15 comments
Owner

Originally created by @theryanmc on GitHub (Dec 18, 2016).

Ever since upgrading to 3.3.10 I can't get my filebot script to run on completion. The log shows that its being started, but it never appears to actually run.

Originally created by @theryanmc on GitHub (Dec 18, 2016). Ever since upgrading to 3.3.10 I can't get my filebot script to run on completion. The log shows that its being started, but it never appears to actually run.
Author
Owner

@ArionMiles commented on GitHub (Dec 20, 2016):

I'm on v3.3.4 and every update after that version, had the "Run external program after torrent completion" feature broken. Anyway, can you drop the script you're putting into the run external program box here and let us have a look?

@ArionMiles commented on GitHub (Dec 20, 2016): I'm on v3.3.4 and every update after that version, had the "Run external program after torrent completion" feature broken. Anyway, can you drop the script you're putting into the run external program box here and let us have a look?
Author
Owner

@theryanmc commented on GitHub (Dec 20, 2016):

I actually figured it out this morning. Had to do with x64 vs x86 issues with the script in question. Both filebot and qBitorrent updated on the same day, and while both worked independent of each other an issue with 64 bit was causing issues.

@theryanmc commented on GitHub (Dec 20, 2016): I actually figured it out this morning. Had to do with x64 vs x86 issues with the script in question. Both filebot and qBitorrent updated on the same day, and while both worked independent of each other an issue with 64 bit was causing issues.
Author
Owner

@ArionMiles commented on GitHub (Dec 20, 2016):

So basically I need to make sure I have 64-bit or 32-bit versions of filebot and qbit depending on my system architecture and that would fix it? Can you run it now on 3.3.10?

@ArionMiles commented on GitHub (Dec 20, 2016): So basically I need to make sure I have 64-bit or 32-bit versions of filebot and qbit depending on my system architecture and that would fix it? Can you run it now on 3.3.10?
Author
Owner

@theryanmc commented on GitHub (Dec 20, 2016):

Yeah, so there are actually three moving parts here. QBT, Filebot, and Java. Filebot uses java for the actual rename procedures. So make sure that all three match and you should be good. I run fine on v3.3.10 now (used to run fine on 3.3.7)

Here is my script in case it helps:
filebot -script fn:amc --output "E:/Movies" --action duplicate --conflict skip -non-strict --log-file amc.log --def excludeList=amc.excludes unsorted=y music=y artwork=y "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L" --def "seriesFormat=E:/Movies/{plex}" "movieFormat=E:/Movies/{plex}" clean=y artwork=n extras=n subtitles=en

@theryanmc commented on GitHub (Dec 20, 2016): Yeah, so there are actually three moving parts here. QBT, Filebot, and Java. Filebot uses java for the actual rename procedures. So make sure that all three match and you should be good. I run fine on v3.3.10 now (used to run fine on 3.3.7) Here is my script in case it helps: `filebot -script fn:amc --output "E:/Movies" --action duplicate --conflict skip -non-strict --log-file amc.log --def excludeList=amc.excludes unsorted=y music=y artwork=y "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L" --def "seriesFormat=E:/Movies/{plex}" "movieFormat=E:/Movies/{plex}" clean=y artwork=n extras=n subtitles=en`
Author
Owner

@zeule commented on GitHub (Dec 20, 2016):

@qbittorrent/qbittorrent-frequent-contributors we should probably write something to log if external program did not start properly.

@zeule commented on GitHub (Dec 20, 2016): @qbittorrent/qbittorrent-frequent-contributors we should probably write something to log if external program did not start properly.
Author
Owner

@ArionMiles commented on GitHub (Dec 21, 2016):

I was using 32-bit version of Qbittorrent while my JRE and Filebot were both 64-bit versions. I installed 64bit version of qBit but same thing persists on my end. Here's the script I'm running:

filebot -script fn:amc --output "E:\" --action move --conflict auto -non-strict --log-file amc.log --def unsorted=y subtitles=y clean=y "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L" "seriesFormat=E:\TV Shows\{n}\{'Season '+s}\{s00e00} - {t }" exec="@E:\New\args.txt"

@ArionMiles commented on GitHub (Dec 21, 2016): I was using 32-bit version of Qbittorrent while my JRE and Filebot were both 64-bit versions. I installed 64bit version of qBit but same thing persists on my end. Here's the script I'm running: `filebot -script fn:amc --output "E:\" --action move --conflict auto -non-strict --log-file amc.log --def unsorted=y subtitles=y clean=y "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L" "seriesFormat=E:\TV Shows\{n}\{'Season '+s}\{s00e00} - {t }" exec="@E:\New\args.txt"`
Author
Owner

@ArionMiles commented on GitHub (Dec 28, 2016):

Any solution yet?

@ArionMiles commented on GitHub (Dec 28, 2016): Any solution yet?
Author
Owner

@okeatime commented on GitHub (Dec 28, 2016):

@ArionMiles
Write a simple program to debug your code something like:

#include <string>
#include <fstream>

int main(int ac, char *av[])
{
	std::string fname = getenv("TEMP");
	fname += "/qbt.txt";
	std::ofstream of(fname, std::ios::out | std::ios::app);
	if(of.is_open()) {
		for(int i=0; i<ac; ++i)
			of << i << " " << av[i] << "\n";
		of.close();
	}
	return 0;
}

You can easily see what's wrong behind the scenes.

C:\>type %temp%\qbt.txt
0 filebot
1 -script
2 fn:amc
3 --output
4 E:" --action move --conflict auto -non-strict --log-file amc.log --def unsorted=y subtitles=y clean=y ut_dir=F:\Torrent\work\LibreOffice_5.2.3_Win_x86.msi ut_kind=multi ut_title=LibreOffice_5.2.3_Win_x86.msi ut_label=queue seriesFormat=E:\TV
5 Shows\{n}\{'Season
6 '+s}\{s00e00}
7 -
8 {t
9 } exec=@E:\New\args.txt

You accidentally escaped the closing quotation mark.
Write "E:\\" or E:\ instead of "E:\".

@okeatime commented on GitHub (Dec 28, 2016): @ArionMiles Write a simple program to debug your code something like: ``` #include <string> #include <fstream> int main(int ac, char *av[]) { std::string fname = getenv("TEMP"); fname += "/qbt.txt"; std::ofstream of(fname, std::ios::out | std::ios::app); if(of.is_open()) { for(int i=0; i<ac; ++i) of << i << " " << av[i] << "\n"; of.close(); } return 0; } ``` You can easily see what's wrong behind the scenes. ``` C:\>type %temp%\qbt.txt 0 filebot 1 -script 2 fn:amc 3 --output 4 E:" --action move --conflict auto -non-strict --log-file amc.log --def unsorted=y subtitles=y clean=y ut_dir=F:\Torrent\work\LibreOffice_5.2.3_Win_x86.msi ut_kind=multi ut_title=LibreOffice_5.2.3_Win_x86.msi ut_label=queue seriesFormat=E:\TV 5 Shows\{n}\{'Season 6 '+s}\{s00e00} 7 - 8 {t 9 } exec=@E:\New\args.txt ``` You accidentally escaped the closing quotation mark. Write `"E:\\"` or `E:\` instead of `"E:\"`.
Author
Owner

@ArionMiles commented on GitHub (Dec 28, 2016):

Then why would the same script run in 3.3.4 but not in later versions?

@ArionMiles commented on GitHub (Dec 28, 2016): Then why would the same script run in 3.3.4 but not in later versions?
Author
Owner

@ArionMiles commented on GitHub (Dec 31, 2016):

@okeatime Thanks! Your solution worked! I can now close #5712 issue opened by me.

@ArionMiles commented on GitHub (Dec 31, 2016): @okeatime Thanks! Your solution worked! I can now close #5712 issue opened by me.
Author
Owner

@Chocobo1 commented on GitHub (Dec 31, 2016):

@okeatime
Do you think qbt should sanitize the command by replacing \" to \\"?
e.g. regex search (?=[^\\]*)\\\" and replace by \\\\\".

@Chocobo1 commented on GitHub (Dec 31, 2016): @okeatime Do you think qbt should sanitize the command by replacing `\"` to `\\"`? e.g. regex search `(?=[^\\]*)\\\"` and replace by `\\\\\"`.
Author
Owner

@okeatime commented on GitHub (Jan 1, 2017):

@ArionMiles

Then why would the same script run in 3.3.4 but not in later versions?

Probably because of this https://github.com/qbittorrent/qBittorrent/pull/5296

@Chocobo1

Yes, I think qbt should do something like that.
The save path variable (%D) seems to always end with a \ on Windows.
If a user quote it, his code won't work properly.

@okeatime commented on GitHub (Jan 1, 2017): @ArionMiles >Then why would the same script run in 3.3.4 but not in later versions? Probably because of this https://github.com/qbittorrent/qBittorrent/pull/5296 @Chocobo1 Yes, I think qbt should do something like that. The save path variable (%D) seems to always end with a \\ on Windows. If a user quote it, his code won't work properly.
Author
Owner

@zeule commented on GitHub (Jan 11, 2017):

In any case, this is not a qBittorrent bug.

@zeule commented on GitHub (Jan 11, 2017): In any case, this is not a qBittorrent bug.
Author
Owner

@jgranger36 commented on GitHub (Mar 20, 2017):

this was definitely a difference in 32bit and 63 bit for me. when i upgraded qbittorrent i did 64bit and everything broke, including search and external program launch. installed the 32 bit of the same 3.1.11 version and it worked.

@jgranger36 commented on GitHub (Mar 20, 2017): this was definitely a difference in 32bit and 63 bit for me. when i upgraded qbittorrent i did 64bit and everything broke, including search and external program launch. installed the 32 bit of the same 3.1.11 version and it worked.
Author
Owner

@zeule commented on GitHub (Mar 21, 2017):

@Sgtpepper36: what OS are you using?

@zeule commented on GitHub (Mar 21, 2017): @Sgtpepper36: what OS are you using?
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#5014
No description provided.