Page 1 of 1

AMC auto-detection fine-tuning

Posted: 31 Oct 2016, 16:37
by toyebox
Firstly, thank you in advance as well as for what you have already done. Fantastic work here.

Background: I have a downloader box running FreeNAS. I have multiple jails, one containing Sabnzbd, Rtorrent and filebot. I am using the CLI (obviously, headless machine). I have decided to use filebot instead of using the automatic renaming and importing from couchpotato and sonarr.

The issue: I am using the AMC script to try and automate every import. I have scripts that are called from sabnzbd and rtorrent respectively (below). The problem is mainly with TV Shows. Here is an example. If i had the majority of the friends Series, but i was missing an episode or two, and i downloaded them via Sonarr.. AMC would import them incorrectly. It would assume it was from a different series, ie: friends (2002) as apposed to the correct friends series. I understand it's encouraged to use filters.. but that is kind of not applicable for an "automated downloading machine". I have tried renaming my entire collection with the AMC script, which continued to mismatch everything i already had matched. ( i will say, i used the GUI to match everything correctly the first time...)

I guess my question is, is there a correct way to label these episodes so it would automatically recognize the right series...

Code: Select all

#!/usr/local/bin/bash

# Input Parameters
FILE_PATH="$1"
FILE_NAME="$2"
FILE_LABEL="$3"

# Configuration
/usr/local/filebot/filebot.sh -script \
   fn:amc \
   --output "/mnt/storage" \
   --log-file /usr/local/filebot/logs/rtorrent.log \
   --action keeplink \
   -no-xattr \
   --conflict override -non-strict \
   --def excludeList=/usr/local/filebot/logs/rtorrent_exclude.txt \
   --def music=n \
   --def plex=192.168.1.6:xxxxxxxxx \
   --def artwork=y \
   --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_label=$FILE_LABEL" \
   --def "ut_title=$FILE_NAME"

exit $7
Thank you!

Edit: I might have figured out one way, by manually running them all through the GUI and appending the air dates to the file names.. Before, My friends series would split into three separate folders. Now, i think it detects it all correctly.. I need to do more testing to verify.

Re: AMC support

Posted: 31 Oct 2016, 17:18
by rednoah
Without the filenames or logs I can't even contemplate what it may or may not be doing or why it may or may not be working.

Rule of Thumb:
Friends.1x01.mp4 => probably gonna work (unless there's another more popular show called Friends that isn't the Friends you want)
Frds1011080p.mp4 => probably not gonna work

e.g.

Code: Select all

$ filebot -rename * --action test -non-strict
Rename episodes using [TheTVDB]
Auto-detected query: [Friends]
Fetching episode data for [Friends]
Fetching episode data for [Friends (2002)]
Fetching episode data for [Friends (1979)]
Fetching episode data for [Last Friends]
Fetching episode data for [SuperFriends (1980)]
[TEST] Rename [Friends.1x01.mp4] to [Friends - 1x01 - The One Where Monica Gets A Roommate.mp4]
Depending on your download habits, simple --filter expressions can make a big difference.

e.g. only consider episodes that are either recently aired, or that are part of shows that have at least a couple of ratings (i.e. consider new shows but ignore all the clutter that nobody cares about):

Code: Select all

--filter "age < 180 || info.RatingCount >= 10"

Re: AMC auto-detection fine-tuning

Posted: 01 Nov 2016, 18:47
by toyebox
Thanks for responding. Here is an example run of renaming Friends. If you look at it, you will see 8lit renamed to three separate friends shows. I don't mind renaming all my shows manually at first and using the cli for importing new shows. I was just curious why it's doing this is all.

http://pastebin.com/vqQPJ6T6

Re: AMC auto-detection fine-tuning

Posted: 01 Nov 2016, 19:00
by rednoah
I can't reproduce that behaviour with the latest revision. I guess it's fixed or it fixed itself.

Re: AMC auto-detection fine-tuning

Posted: 01 Nov 2016, 19:39
by toyebox
Put is a script I wrote to utilize the CLI. Note, I use the AMC script locally but I downloaded it not even 2 days ago. Do you see anything wrong with it? While I have your attention, is it possible to set custom rules for ignoring specific words? I noticed a couple episodes were ignored because they had trailer in the name. I looked at the script but it looks like the preset words are always called regardless of whatever custom ignored words are set.

Code: Select all

#!/usr/local/bin/bash

EXIST=false

while [[ "$EXIST" != "true" ]]
do
        read -p "Choose an OUTPUT directory(leave blank for /mnt/storage *note there is no trailing slash*):" answer
        case $answer in
                "") OUTPUT="/mnt/storage";;
                * ) OUTPUT=$answer;;
        esac

        if [ ! -d "$OUTPUT" ]; then
                echo "$OUTPUT is not a directory!"
        else
                EXIST=true
        fi
done

EXIST=false

while [[ "$EXIST" != "true" ]]
do
        read -p "Choose an INPUT directory:" answer

        if [ ! -d "$answer" ]; then
                echo "$answer is not a directory!"
        else
                EXIST=true
                INPUT=$answer
        fi
done

echo "Is the media Movies, Series, or mixed?"
select abc in "Movies" "Series";
do
        case $abc in
                "Movies") LABEL="Movie"; break;;
                "Series") LABEL="Series"; break;;
        esac
done

echo "We will use the OUTPUT directory of: $OUTPUT with the INPUT directory: $INPUT and the media type: $LABEL"
# Configuration
/usr/local/filebot/filebot.sh -script \
   scripts/amc.groovy \
   --output "$OUTPUT" \
   --log-file /usr/local/filebot/logs/manual.log \
   --action move \
   -no-xattr \
   --conflict override -non-strict \
   --def minFileSize=0 \
   --def music=n \
   --def artwork=y \
   --def clean=y \
   --def seriesFormat="TV Shows/{n}/{'Season '+s}/{n} - {s00e00} - {t}" \
   --def "ut_dir=$INPUT" \
   --def "ut_kind=multi" \
   --def "ut_label=$LABEL"

exit $7

Re: AMC auto-detection fine-tuning

Posted: 01 Nov 2016, 20:46
by rednoah
1.
I was refering to the latest revision of FileBot: viewtopic.php?f=7&t=1609


2.
Some patterns are excluded:
https://app.filebot.net/data/exclude-blacklist.txt

There is nothing you can do about that, but I can fine-tune the patterns and push updates if you tell me the exact paths that cause false positives.

The amc script has it's own set of exclude patterns which are a lot less strict and easier to modify yourself:
https://github.com/filebot/scripts/blob ... roovy#L224

Re: AMC auto-detection fine-tuning

Posted: 01 Nov 2016, 21:05
by toyebox
Thanks. Are you using the beta version? Is the portable version the same as what you were trying? Sorry to be a pain. Does my script look fine?

Re: AMC auto-detection fine-tuning

Posted: 01 Nov 2016, 21:54
by rednoah
1.
Yes.

2.
I'm using the latest revision. FileBot_4.7.3_B6 is fairly recent so that should be pretty much the same.

3.
Looks good to me, but I'm not a shell interpreter, nor am I looking at the output as it's running, so I really have no idea. :lol: