SABNZBD Script - Illegal usage: bad file arguments or ut_dir/ut_file parameters

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
SpiderBob
Posts: 2
Joined: 15 Oct 2016, 16:36

SABNZBD Script - Illegal usage: bad file arguments or ut_dir/ut_file parameters

Post by SpiderBob »

I've been banging my head on this problem off and on for several days with little progress, so I'm hoping that you can help me and that maybe it will be something obvious. It may be something on the SABNZBD side, if that's the case I'll go ask over there.

I've successfully set up SABNZBD to pull my NZBs, download them, and pass them to my script, but I get back an error each time. Here's the script:

Code: Select all

#!/bin/bash

# SABnzbd Post Processing Script - www.Filebot.net "AMC" Script

FILE_PATH=$1
FILE_NAME=$3

/Users/Gabriel/Applications/FileBot_4.7.2-brew.app/Contents/MacOS/FileBotAppLauncher -script \
   fn:amc \
   --output "/Users/Gabriel/Desktop/Media" \
   --log-file amc.log \
   --action move \
   --conflict override -non-strict \
   --def music=n \
   --encoding UTF-=8 \
   --def clean=y \
   --def "exts=jpg|nfo|srv|srr|nzb|sfv|idx|sub|txt|part01|part02|par1|par2|info|com|db|md5|1|jpeg|url|lnk|html|ini|bat|com|exe|scr|sample" \
   --def movieFormat="/Volumes/Movies/{n} ({y})" seriesFormat="/Volumes/Storage/TV Shows/{n}/Season {s}/{s00e00} - {t}" 
   --def "ut_dir=$FILE_PATH" \
   --def "ut_kind=multi" \
   --def "ut_title=$FILE_NAME" \

and here's the output:

Code: Select all

Locking /Users/Gabriel/.filebot/logs/amc.log
Run script [fn:amc] at [Sat Oct 15 11:26:34 CDT 2016]
Parameter: music = n
Parameter: clean = y
Parameter: exts = jpg|nfo|srv|srr|nzb|sfv|idx|sub|txt|part01|part02|par1|par2|info|com|db|md5|1|jpeg|url|lnk|html|ini|bat|com|exe|scr|sample
Parameter: movieFormat = /Volumes/Movies/{n} ({y})
Parameter: seriesFormat = /Volumes/Storage/TV Shows/{n}/Season {s}/{s00e00} - {t}
Illegal usage: bad file arguments or ut_dir/ut_file parameters
Failure (°_°)

/Users/Gabriel/Desktop/Scripts/postprocess.sh: line 20: --def: command not found
The script is borrowed and edited slightly from this viewtopic.php?t=1957. In editing it, I've already worked past having my output directory in the downloads folder (which seemed to be a problem) and pointing directly to the launcher instead of just using "filebot." It looks like the problem is between:

Code: Select all

FILE_PATH=$1
FILE_NAME=$3
and

Code: Select all

   --def "ut_dir=$FILE_PATH" \
   --def "ut_kind=multi" \
   --def "ut_title=$FILE_NAME" \
Here is the system information:

OS X 10.10.5
FileBot 4.7.2 (r4178)
JNA Native: 4.0.1
MediaInfo: 0.7.87
7-Zip-JBinding: 9.20
Chromaprint: 1.1.0
Extended Attributes: OK
Script Bundle: 2016-10-09 (r410)
Groovy: 2.4.7
JRE: Java(TM) SE Runtime Environment 1.8.0_102
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 2 Core / 1 GB Max Memory / 85 MB Used Memory
OS: Mac OS X (x86_64)

I purchased Filebot from the App store on Oct 21, 2014, but for all the scripting I've done, I've installed Filebot via Homebrew and Cask. I've previously set it up multiple times for Transmission, so I'm sure this is just something I don't understand about SABNZBD and its parameters. If that's the case, again, I'll take my post over to their forums :)
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: SABNZBD Script - Illegal usage: bad file arguments or ut_dir/ut_file parameters

Post by rednoah »

You're not passing in any input because your command-line is broken. Check the line before the ut_* options.

@see https://www.gnu.org/software/bash/manua ... -Character

I recommend using these scripts here as a template: https://github.com/filebot/plugins/tree/master/bash
:idea: Please read the FAQ and How to Request Help.
SpiderBob
Posts: 2
Joined: 15 Oct 2016, 16:36

Re: SABNZBD Script - Illegal usage: bad file arguments or ut_dir/ut_file parameters

Post by SpiderBob »

Thank you sir, escaping that line did the trick! Now onward to adding other options into the script to get all my artwork and subtitles downloaded :) For those looking at this in the future, my script now looks like this:

Code: Select all

#!/bin/bash

# SABnzbd Post Processing Script - www.Filebot.net "AMC" Script

FILE_PATH=$1
FILE_NAME=$3

/Users/Gabriel/Applications/FileBot_4.7.2-brew.app/Contents/MacOS/FileBotAppLauncher -script \
   fn:amc \
   --output "/Users/Gabriel/Desktop/Media" \
   --log-file amc.log \
   --action move \
   --conflict override -non-strict \
   --def music=n \
   --encoding UTF-=8 \
   --def clean=y \
   --def "exts=jpg|nfo|srv|srr|nzb|sfv|idx|sub|txt|part01|part02|par1|par2|info|com|db|md5|1|jpeg|url|lnk|html|ini|bat|com|exe|scr|sample" \
   --def movieFormat="/Volumes/Movies/{n} ({y})" seriesFormat="/Volumes/Storage/TV Shows/{n}/Season {s}/{n} - {s00e00} - {t}" \
   --def "ut_dir=$FILE_PATH" \
   --def "ut_kind=multi" \
   --def "ut_title=$FILE_NAME" \
notice the backslash between the series format and the ut_dir info.

Thanks again!
Post Reply