[Plain File Mode] Add missing file extensions

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

[Plain File Mode] Add missing file extensions

Post by rednoah »

Plain File Mode allows use to rewrite file names and add missing file extensions. In this example, we use MediaInfo Bindings to guess the media file type from the media file content.


GUI:

Use the following custom format in Plain File Mode to keep the current file name and then add the media file extension at the end. You may create a custom preset for recurring tasks.

Format: Select all

{ fn }{ '.' + media.FormatExtensions.tokenize().first() }
Screenshot



CLI:

Shell: Select all

filebot -rename -r /input --output /output --db file --format "{ fn }{ '.' + media.FormatExtensions.tokenize().first() }" --file-filter "none{ ext }"

Console Output: Select all

[MOVE] from [sample] to [sample.mkv]


-r ... select files from the /input folder and subfolders recursively

--format ... generate new file names based on the current file name and then use MediaInfo Bindings to guess the media file type from the file content:

Format: Select all

{ fn }{ '.' + media.FormatExtensions.tokenize().first() }
--file-filter ... select files that currently do not have a file extension:

Groovy: Select all

none{ ext }
:idea: Please read the FAQ and How to Request Help.
Post Reply