sabnzbd + filebot script issue

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
azilko
Posts: 9
Joined: 04 Feb 2017, 21:51

sabnzbd + filebot script issue

Post by azilko »

Sab will run this script below just find, but will throw an error as it's saying that it's looking for the file in a different folder (yet it'll move the file to the correct folder just fine).

Here's the script

Code: Select all

SET NZB_OUTPUT_FOLDER=%1
SET NZB_JOB_NAME=%3
SET NZB_CATEGORY=%5

filebot -script fn:amc --output "M:\_4K Movies" --action move -non-strict --log-file amc.log --def clean=y --def subtitles=en excludeList=amc.txt "ut_dir=%NZB_OUTPUT_FOLDER%" "ut_kind=multi" "ut_title=%NZB_JOB_NAME%" "ut_label=%NZB_CATEGORY%"
This script runs, fails, but the file is still moved to the correct folder. Here's the error,

Code: Select all

C:\Program Files\SABnzbd>SET NZB_OUTPUT_FOLDER="M:\_4K Movies\Filename"

C:\Program Files\SABnzbd>SET NZB_JOB_NAME="Filename"

C:\Program Files\SABnzbd>SET NZB_CATEGORY="movies_uhd"

C:\Program Files\SABnzbd>filebot -script fn:amc --output "M:\_4K Movies" --action move -non-strict --log-file amc.log --def clean=y --def subtitles=en excludeList=amc.txt "ut_dir="M:\_4K Movies\Filename"" "ut_kind=multi" "ut_title="Filename"" "ut_label="movies_uhd""
Locking C:\Users\Name\AppData\Roaming\FileBot\logs\amc.log
Run script [fn:amc] at [Fri Jan 17 13:08:08 PST 2020]
Parameter: clean = y
Parameter: subtitles = en
Parameter: excludeList = amc.txt
Parameter: ut_dir = M:\_4K
Argument[0]: File does not exist: C:\Program Files\SABnzbd\Movies\Filename
Argument[1]: File does not exist: C:\Program Files\SABnzbd\ut_kind=multi
Argument[2]: File does not exist: C:\Program Files\SABnzbd\ut_title=Filename
Argument[3]: File does not exist: C:\Program Files\SABnzbd\ut_label=movies_uhd
Illegal usage: use either script parameters [dir:M:\_4K] or file arguments [C:\Program Files\SABnzbd\Movies\Filename, C:\Program Files\SABnzbd\ut_kind=multi, C:\Program Files\SABnzbd\ut_title=Filename, C:\Program Files\SABnzbd\ut_label=movies_uhd] but not both
Failure (~~_~~)
The odd thing that I cannot figure out, is why is this script looking for the file in C:\Program Files\SABnzbd\Movies\? I do not have anything setup anywhere I can find that points to that folder, not have I ever used it for moving files into. In Sab, I have a holding folder that's completely different setup (which works fine). And again, this script is moving the file.

Any help is appreciated here. (BTW, to the mods, I've donated to support you for just this reason. Appreciate all you do)
User avatar
rednoah
The Source
Posts: 19011
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: sabnzbd + filebot script issue

Post by rednoah »

The error above strongly indicates that arguments aren't quoted correctly, thus messing up argument sequence, causing dangly arguments to be treated as relative input paths.


Since you are using "..." I can only assume that CMD is being chaotic-evil again, adding "..." automatically, effectively negating your "..." immediately, leading to a command that effectively isn't quoted at all. You can replace fn:amc with fn:sysenv (mirror command-line arguments) to see the arguments you are effectively passing into the filebot call.


:idea: Please read Cmdline and Argument Passing for details.
:idea: Please read the FAQ and How to Request Help.
Post Reply