How do I process only specific kinds of files?

How-to guides, frequently asked questions, not-so-obvious features, etc
Post Reply
User avatar
rednoah
The Source
Posts: 22820
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

How do I process only specific kinds of files?

Post by rednoah »

FileBot will always load all the media files from the selected folder (i.e. video files, subtitle files, image files, audio files, etc) but what if we only want to process video files and ignore all other files?



Option 1: FileBot Filter

Drop your folders into the Filter panel and let FileBot categorize files by file type, and then use the Send toRename or drag-n-drop to add only the selected files to the RenameOriginal Files list.

Screenshot



Option 2: Use Windows Explorer or Mac Finder

Rather than dropping folders as whole, you can select and drop only selected files instead. Search for the files you want (e.g. search for *.mkv in Windows Explorer or kind:video in Mac Finder) and then select all the files and drag-n-drop them into FileBot.

Screenshot




Option 3: Use Presets with Includes

Presets allow you to set a default folder from which files are loaded and file filter expressions that allow you to include or exclude files.

e.g. Includes: video files

Groovy: Select all

f.video
e.g. Includes: files that are not *.jpg or *.png files and do not match *sample* or *trailer* in the file name and do not match *Extras* or *Featurettes* in the file path:

Groovy: Select all

none{ ext =~ /jpg|png/ }{ fn.match(/sample|trailer/) }{ f =~ /Extras|Featurettes/ }
e.g. Includes: files that have not yet been processed, i.e. files that do not have xattr metadata and are not recorded in the local history yet:

Groovy: Select all

none{ historic.f || f.metadata }



Option 4: Start FileBot with --file-filter from Terminal

Power Users may use the --file-filter option to select specific files using a custom Groovy expression.

e.g. select only video files:

Shell: Select all

filebot -rename -r "/path/to/files" --file-filter "f.video"
e.g. select only episode files:

Shell: Select all

filebot -rename -r . --file-filter "f.episode" --db TheMovieDB::TV
e.g. select only movie files:

Shell: Select all

filebot -rename -r . --file-filter "none{ f.episode }" --db TheMovieDB
e.g. select only files that have not already been hardlinked:

Shell: Select all

filebot -rename -r /input --file-filter "f.linkCount == 1" --action hardlink --db xattr --output /output --format "{plex.id}"
:arrow: Please read How do I process specific files with specific command-line options? for details and examples.




Option 5: Start FileBot with file arguments from Terminal

Power Users on Linux or macOS may prefer to use standard Linux tools to select files and pass them on to FileBot.

e.g. find *.mkv files and pass them on to the filebot call as arguments:

Shell: Select all

find /path/to/files -type f -iname "*.mkv" -exec filebot -rename {} +
:idea: Please read the FAQ and How to Request Help.
Post Reply