How to --file-filter archives

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Kelsig
Posts: 5
Joined: 16 Jul 2022, 11:07

How to --file-filter archives

Post by Kelsig »

Hey, currently, for movies, I have qbittorrent launch this script on torrent completion:

Code: Select all

	filebot -rename -r "$path" --db TheMovieDB -non-strict --file-filter "none{ ext =~ /jpg|png/ }{ fn.match(/sample|trailer/) }{ f =~ /Extras|Featurettes/ }" --format '/mnt/c/bin/movie_preset_withsubs.groovy' --conflict INDEX --action DUPLICATE --output "/mnt/$drive/"
But one thing I can't figure out is how to exclude archives as well without just restricting the renaming to video files. Because archives are always .r00 -> .rn I can't simply exclude a single extension.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to --file-filter archives

Post by rednoah »

0.
What does the log say when you process .r00 files? Please read How to Request Help.



1.
You don't need to ignore archive files, because filebot -rename --db TheMovieDB will only process video / subtitle files (and Companion Files; not sure if relevant in this case) so .r00 and friends will not be processed since they're not video files.



2.
If you wanted to ignore archive files (e.g. Plain File Mode) then you can always specify a regular expression pattern that matches all the extensions you want to exclude:

Code: Select all

r[0-9]+

:idea: You're already using ext =~ /jpg|png/ to ignore some file extensions, so you just need to modify that regular expression pattern you already have a little bit:

Code: Select all

ext =~ /jpg|png|r[0-9]+/
:idea: Please read the FAQ and How to Request Help.
Kelsig
Posts: 5
Joined: 16 Jul 2022, 11:07

Re: How to --file-filter archives

Post by Kelsig »

rednoah wrote: 19 Jul 2022, 19:08 0.
What does the log say when you process .r00 files? Please read How to Request Help.



1.
You don't need to ignore archive files, because filebot -rename --db TheMovieDB will only process video / subtitle files (and Companion Files; not sure if relevant in this case) so .r00 and friends will not be processed since they're not video files.



2.
If you wanted to ignore archive files (e.g. Plain File Mode) then you can always specify a regular expression pattern that matches all the extensions you want to exclude:

Code: Select all

r[0-9]+

:idea: You're already using ext =~ /jpg|png/ to ignore some file extensions, so you just need to modify that regular expression pattern you already have a little bit:

Code: Select all

ext =~ /jpg|png|r[0-9]+/
0. Sorry that didn't even occur to me as I thought everything was working as intended, here. https://pastebin.com/pXhnEbmY.

1. Is the way I have it in the CLI wrong? Because it renames everything I don't explicitly exclude. Or is having the file-filter setting overriding that?

2. Your idea works, though. https://pastebin.com/vQE72SSX Thanks
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to --file-filter archives

Post by rednoah »

0. & 1.
I see. Seems like you're extracting files into the same folder, with the archive having the same name as the video file, and so the generic Companion Files behaviour does indeed kick in to process arbitrary files, but only because they're derived-by-name (i.e. same file name or prefix) and processed as a group with the primary video file.


2.
In this case you do indeed need to explicitly exclude archive files from processing. Alternatively, extracting archives into folders with the archive name (so that video file and archive don't end up in the same folder) would also work.
:idea: Please read the FAQ and How to Request Help.
Post Reply