Filebot picks up featurettes instead of movie file

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Catmal
Posts: 7
Joined: 18 Jul 2018, 12:06

Filebot picks up featurettes instead of movie file

Post by Catmal »

Is it possible to have the amc script to pick the biggest file in the folder looked up?

Say I have a folder with actual movie file and featurettes. Sometimes filebot renames a featurette file as actual movie while ignoring actual movie file.

Actual movie file is always the biggest one hence i thought that if it's possible to make the script pick that would solve the issue. But if there's another way would be ok too.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot picks up featurettes instead of movie file

Post by rednoah »

Per folder, not in particular. But you can probably use --def minFileSize to exclude everything that isn't a full-featured movie based on file size alone.
:idea: Please read the FAQ and How to Request Help.
Catmal
Posts: 7
Joined: 18 Jul 2018, 12:06

Re: Filebot picks up featurettes instead of movie file

Post by Catmal »

The problem with that is that there are featurette files which are bigger than movie files (I mean for different movies). For a movie I might have a featurette file of say 2,3GB. For another movie I might have the actual movie file of 1,9GB. That's why I was thinking to pick up the biggest, not to set an absolute minimum size. But I seem to understand it isn't possible.

A way around could be this. Featurette files are in a subfolder (featurettes). Is it possible to have the script to ignore subfolders?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot picks up featurettes instead of movie file

Post by rednoah »

If you know which files to process, then you can just pass those in directly, i.e. don't pass in a folder, pass in files.

This might be useful:
viewtopic.php?f=3&t=4222
:idea: Please read the FAQ and How to Request Help.
Catmal
Posts: 7
Joined: 18 Jul 2018, 12:06

Re: Filebot picks up featurettes instead of movie file

Post by Catmal »

Structure is like this:

Movies to process/Mission Impossible/Mission Impossible.mkv
Movies to process/Mission Impossible/Featurettes/Mission Impossible Behind The Scenes.mkv
Movies to process/The Interview/The Interview.mkv
and so on...

Each movie has its own folder. If I'm understanding well, solution above doesn't fit.

To be clear, right now I'm using

Code: Select all

move "/Movies To process"
Hence it looks all files in that folder and subfolders.
Last edited by Catmal on 27 Jul 2018, 02:22, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot picks up featurettes instead of movie file

Post by rednoah »

1.
Isn't anything with "Featurettes" in the folder already excluded by default? If not, then you can just set --def ignore="Featurettes|Interview". You might need to add additional blacklisted words depending on your files.


2.
This command will print the largest file for each folder structure:

Code: Select all

filebot -mediainfo -r . --file-filter 'folder.files.every{ it.length() <= f.length()}' --format {f}
➔ You can use -exec to pass those file paths as arguments to a second filebot amc call.
:idea: Please read the FAQ and How to Request Help.
Catmal
Posts: 7
Joined: 18 Jul 2018, 12:06

Re: Filebot picks up featurettes instead of movie file

Post by Catmal »

I actually did a mistake on last reply on folder structure. Fixed now..

Anyway as featurette files to ignore are always inside "Featurettes" folders, setting --def ignore="Featurettes" should solve the issue. As wrong files are choosen randomly I can't reproduce it at the moment. If problem still there I will post again. Thanks for now!
cheaters
Posts: 214
Joined: 09 Oct 2016, 02:01

Re: Filebot picks up featurettes instead of movie file

Post by cheaters »

Just adding this to clarify for anyone that comes along. The files aren't randomly skipped/included for renaming. They are skipped/included for renaming depending on their size and length. That size and length is a hard number that rednoah has chosen in collaboration with Mr. Turner.
rednoah wrote: 05 May 2020, 07:31 FileBot r7515 changes the file size limit to 180 MB (larger files are never clutter) and adds an additional video length limit of 40 min (longer videos are never clutter).
rednoah wrote: 05 May 2020, 07:31 Do you have any thoughts on the new limits? What file size / video length should we use for our "this file is definitely not an extra" litmus test?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot picks up featurettes instead of movie file

Post by rednoah »

I forget this even exists. I guess the current numbers work well for most use cases. :D


Checking the code... for FileBot 4.9.2 (and possibly earlier) the default limits are 150 MB and 30 minutes respectively but are also configurable via system properties now:

Code: Select all

filebot -script fn:properties --def net.filebot.media.clutter.size=150 net.filebot.media.clutter.length=PT30M

The clutter pattern is hard-coded however and cannot be configured:

Code: Select all

(?<=[!\\-\\(\\[])(?:Sample|Trailer)|(?:Sample|Trailer)(?=[\\-\\)\\]])|(?<=[.\\-]|^)(?:s|t|Sample|Trailer)$|(?:NCED|NCOP|(?:OP|ED)\\p{Digit}\\p{Alpha})|(?:Extras|Trailers|Featurettes|Interviews|Scenes|Shorts)$|Behind.the.Scenes|Deleted.and.Extended.Scenes|Deleted.Scenes
:idea: If a file matches these patterns, then it's going to get excluded, unless it's large enough or long enough as per limits discussed above, as to avoid false positives on auto-excluded extras.


:idea: TL;DR Files are excluded primarily based on file path (e.g. keyword "Behind the Scenes" is excluded) but large or long video files are always included regardless.



EDIT:

:arrow: Clutter File Size Limits
:idea: Please read the FAQ and How to Request Help.
cheaters
Posts: 214
Joined: 09 Oct 2016, 02:01

Re: Filebot picks up featurettes instead of movie file

Post by cheaters »

Is there anyway I can use

Code: Select all

--def ignore="behindthescenes|deleted|featurettes|interview"
in the GUI with my format:

Code: Select all

{plex.derive{' {imdb-'}{imdbid}{'}'}{' ['+allOf{tags}{audio.language}{vf}{vs}{vc}{crc32}.join(' ')}{']'}}{if (dc > 1) '.'+di}
Does

Code: Select all

--def ignore="…"
skip files or folders. Case sensitive?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot picks up featurettes instead of movie file

Post by rednoah »

1.
--def ignore is a amc script option so it has no effect on the GUI nor typical CLI calls.


2.
You can use scriptable file filters in Presets though, akin to --file-filter on the command-line:
Image
:idea: Please read the FAQ and How to Request Help.
cheaters
Posts: 214
Joined: 09 Oct 2016, 02:01

Re: Filebot picks up featurettes instead of movie file

Post by cheaters »

Your hardcoding suggests you have settled on supporting Plex's subdirectory method of organizing local files for trailers and extras versus their inline method?

:?: You may want to capitalize "the" in your hardcoding? "Behind The Scenes"
Organized in Subdirectories
You can organize your local extras into specific subdirectories inside the main directory named for the movie. Extras will be detected and used if named and stored as follows:

Code: Select all

Movies/MovieName (Release Date)/Extra_Directory_Type/Descriptive_name.ext
Where Extra_Directory_Type is one of:

Code: Select all

Behind The Scenes
Deleted Scenes
Featurettes
Interviews
Scenes
Shorts
Trailers
Other
It is recommended that you provide some sort of descriptive name for the extras filenames.

Code: Select all

/Movies
   /Avatar (2009)
      Avatar (2009).mkv
      /Behind The Scenes
         Performance Capture.mkv
      /Deleted Scenes
         Bar Fight.mp4
         Lost Sister.mkv
      /Interviews
         Sigourney Weaver.mp4
         Stephen Lang.mp4
      /Scenes
         Arrival.mp4
      /Trailers
          Teaser Trailer.mp4
          Theatrical Trailer #1.mp4
          Theatrical Trailer #2.mp4
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot picks up featurettes instead of movie file

Post by rednoah »

Well, these patterns have evolved with user input, and I guess there's a few Plex users among them. FileBot only "supports" these kinds of files in the sense that it knows that it doesn't support them at all, and thus wisely excludes them from processing by default.
:idea: Please read the FAQ and How to Request Help.
cheaters
Posts: 214
Joined: 09 Oct 2016, 02:01

Re: Filebot picks up featurettes instead of movie file

Post by cheaters »

I think if you have created an amc script for Plex people would assume that it would support Plex conventions. I think it's great to have that script. Makes it so easy for the user.

That being said, I understand that creating and maintaining support for all of those platforms and their ever changing naming structures, their platform evolution, could become an unwanted burden.
cheaters
Posts: 214
Joined: 09 Oct 2016, 02:01

Re: Filebot picks up featurettes instead of movie file

Post by cheaters »

rednoah wrote: 12 Oct 2020, 20:22 1.
--def ignore is a amc script option so it has no effect on the GUI nor typical CLI calls.


2.
You can use scriptable file filters in Presets though, akin to --file-filter on the command-line:
This is what I was thinking before I wrote. I am guessing the "!" excludes?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot picks up featurettes instead of movie file

Post by rednoah »

! means not. It's just Groovy code as always.

e.g. select *.mp4 files

Code: Select all

ext =~ /mp4/
e.g. select everything but *.srt files

Code: Select all

!(ext =~ /srt/)
:idea: Please read the FAQ and How to Request Help.
Post Reply