English language only in movie (speaking language)

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
MickeMM
Posts: 44
Joined: 03 Apr 2019, 10:52

English language only in movie (speaking language)

Post by MickeMM »

Hello!

I use this code and everything works great, thanks for helping me before!
Now i want to skip all movie with other languange except english. How should my code be for that?
In animation and serie swedish and english is okej.

Code: Select all

filebot.sh -script fn:amc --output "$CONFIG_OUTPUT" --action duplicate --conflict auto -non-strict --log-file amc.log --def excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL" --def ignore="dansk_tex|fylla_disken|uppackat" --def movieFormat=""$CONFIG_OUTPUT"{any{/Animation/ in genres ? 'animerat/Movies' : genres =~ /Documentary/? 'dokumentar/radera' : 'film/Movies'}{'film/Movies'}}/{plex.tail}" seriesFormat=""$CONFIG_OUTPUT"serie/{plex}" &&
Regards
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: English language only in movie (speaking language)

Post by rednoah »

Selecting only specific movies for processing only works if the files have already been processed and xattr tagged. Since we can't know which file is which movie the first time around.


e.g. find examples for --db xattr and --filter here:
viewtopic.php?t=4788
:idea: Please read the FAQ and How to Request Help.
rv23
Posts: 64
Joined: 19 Jul 2020, 15:05

Re: English language only in movie (speaking language)

Post by rv23 »

As I don't believe filebot can tell if a file has English Audio/Subtitle without "looking" at it, if it's acceptable to you I think at least 2 (I'm sure there are more) way's to tackle this.
1. In a previous step you could separate out the English movies from the non-English, so they are in different locations which effectively would allow you to process the English specifically with the code you have (assuming that's the code you want to run on the English)
2. The Format could be modified to rename (or whatever it is you want to do) only if the Audio/Subtitle contains English, and if not then effectively do nothing ({fn}). It's a bit silly, but it works and this is a tactic I use for other things (like looking for corrupt video, if it's corrupt I rename it to the output folder, if it's not then I rename it to .. itself {fn}, which effectively does nothing as far as I know).
3. I *think* --filter could be used to select only the files with English Audio/Subtitles. I believe --filter uses the same effective syntax as the Format, so I expect you could query the audio/subtitle tracks for English.. I use --filter to find extra's in a folder to rename, I believe the filter code needs to evaluate to true for it to "select" the file.

Code: Select all

--filter "((f.isVideo() || f.isSubtitle()) && ( f.getParentFile().getName() =~ /(?i)\b(extra[s]?|bonus)\b/ || f.name =~ /(?i:Sample|\b(NCOP|NCED)\d{0,3}\b|Clean\s*(ED|OP|Ending|Opening)|Creditless\s*(ED|OP|Ending|Opening)|Textless\s*(ED|OP|Ending|Opening)|\b(BD|Menu)\b\s*\b(BD|Menu)\b|Character\b.*\bPV\b.*\bCollection\b|ON\sAIR\sMaterials}Previews|PMV|\bPV\b|PV\d+)|Trailer|Extras|Featurettes|Extra.Episodes|Bonus.Features|Music.Video|Scrapbook|Behind.the.Scenes|Extended.Scenes|Deleted.Scenes|Mini.Series|s\d{2}c\d{2}|S\d+EXTRA|\d+xEXTRA|\b(OP|ED)\b(\d+)?|Formula.1.\d{4}(?=\b|_)/ ))"
Unfortunately I'm fairly bad with the groovy-like code within the Format/filter etc blocks, so I'm not a good source for an exact example of what you are looking for. I've been using the groovy script functionality for this kind of stuff because I can figure out vanilla Groovy, but the fiddly bits on the groovy-like code is quite maddening to me :)
Post Reply