Page 1 of 1
SABnzbd Intergration
Posted: 07 Sep 2014, 18:35
by m3th1dz
Here is a script for processing completed downloads from SABnzbd+
When SABnzbd is finished downloading it moves the file to the show/movie folder and then deletes any files/folders left behind and sends pushover notification upon completion
http://pastebin.com/cmRVkhwY
Code: Select all
#!/bin/bash
# SABnzbd Post Processing Script - www.Filebot.net "AMC" Script
FILE_PATH=$1
FILE_NAME=$3
filebot -script \
fn:amc \
--output "/path/to/your/media" \
--log-file amc.log \
--action move \
--conflict override -non-strict \
--def music=n \
--def xbmc=127.0.0.1 \
--def plex=127.0.0.1 \
--def pushover= \
--def artwork=y \
--def subtitles=en \
--def clean=y \
--def "exts=jpg|nfo|srv|srr|nzb|sfv|idx|sub|txt|part01|part02|par1|par2" \
--def "terms=sample|trailer|etc" \
--def "ut_dir=$FILE_PATH" \
--def "ut_kind=multi" \
--def "ut_title=$FILE_NAME"
Re: SABnzbd Intergration
Posted: 22 Dec 2014, 14:14
by magiin83
I've had some issues with this script (though I've made some changes to it.
It seems I can't get the xbmc command to go through, and I've seen the error mentioned in a lot of different forums, but the way to solve it doesn't seem to be working for me.
The error is:
Code: Select all
/usr/bin/filebot: line 15: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
"-" is not a valid option
I've reset my locale on xbmc, doesn't fix it.
I've added --encoding UTF-=8 \ to the script, also doesn't fix it.
I'm not sure where else to go with this, but I also haven't seen any updated scripts that use SAB integration with XBMC... can anyone point me in the right direction if there is a more up-to-date one?
Here is my current script. I also don't know whether I need to include username/pass for xbmc and the port in order for the update to go through, but since I can't even make it that far, I'll worry about that next.
Code: Select all
#!/bin/bash
# SABnzbd Post Processing Script - www.Filebot.net "AMC" Script
FILE_PATH=$1
FILE_NAME=$3
filebot -script \
fn:amc \
--output "/mnt/user" \
--log-file amc.log \
--action move \
--conflict override -non-strict \
--def music=n \
--encoding UTF-=8 \
--def xbmc=192.168.1.17 \
--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=Movies/movieFormat=mnt/user/Movies/{n.replaceAll(/[:|]/, " - ").upperInitial().space('.')} ({y})/{n.replaceAll(/[:|]/, " - ").upperInitial().space('.')} ({y}){'-CD'+pi}.{vf}.{vc}.{ac}" \
--def "ut_dir=$FILE_PATH" \
--def "ut_kind=multi" \
--def "ut_title=$FILE_NAME"
Re: SABnzbd Intergration
Posted: 22 Dec 2014, 14:59
by rednoah
You might need to edit filebot.sh and see if you can make it work by taking out UTF-8 support. You might just be missing a language pack or locale support.
This is a highly system specific issue, yet you haven't mentioned any kind of system information.
Re: SABnzbd Intergration
Posted: 22 Dec 2014, 15:13
by magiin83
Sorry, UnRAID is the OS.
As for filebot.sh, I did edit it and removed the 2 lines regarding the locale, it now skips that error.
The only error I get now is this:
Which I'm really not sure where that is referred in the script, aside from the replace : with - in the folder/file name.
Re: SABnzbd Intergration
Posted: 22 Dec 2014, 15:22
by rednoah
Haha, those two unrelated error messages where mighty misleading then in combination!!
1.
The locale issue is probably your UnRAID having no support for locales. I'd report that issue to them.
2.
Learn how to use cmdline:
http://www.filebot.net/forums/viewtopic.php?f=4&t=1899
Re: SABnzbd Intergration
Posted: 22 Dec 2014, 15:28
by magiin83
Fair enough, I appreciate your help

I'll break down the script piece by piece and hopefully figure out where that "-" error is coming from
Re: SABnzbd Intergration
Posted: 22 Dec 2014, 15:39
by rednoah
The issue is obviously here where your Groovy quotes unquote your shell quotes:
Code: Select all
--def "movieFormat=Movies/movieFormat=mnt/user/Movies/{n.replaceAll(/[:|]/, " - ").upperInitial().space('.')} ({y})/{n.replaceAll(/[:|]/, " - ").upperInitial().space('.')} ({y}){'-CD'+pi}.{vf}.{vc}.{ac}"
Use ' single quotes instead.
Donation appreciated.
Re: SABnzbd Intergration
Posted: 22 Dec 2014, 16:32
by magiin83
Planning on donating right now

Fixed the issue a different way without the replace : with -, seems SABnzbd doesnt want to accept ' - ' or " - ".
Is there a way to define xbmc to only update that specific folder it just received notification on?
Perhaps as just:
--def xbmc=192.168.1.17 $FILE_NAME \ ? or something similar. Otherwise, it does a full library scan which takes forever.
Re: SABnzbd Intergration
Posted: 22 Dec 2014, 17:30
by rednoah
I don't think XBMC supports that.
Besides, with find you can get all recently modified paths within milliseconds even for very large libraries. If XBMC is then 1000x slower updating newly added files than it should be, then that's an XBMC issue.
@see
https://github.com/filebot/scripts/pull ... t-64526351