Use filebot to share movie base on language?

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

Use filebot to share movie base on language?

Post by MickeMM »

Hello

Does filebot read mkv file so it can move english and swedish language to folder and skip rest?

I use this code, works perfect. But i never watch movie that dosen't have english and swedish language.

Code: Select all

/bin/bash /filebot-portable/filebot.sh -script fn:amc --output "$CONFIG_OUTPUT" --action duplicate -non-strict --conflict auto --log-file amc.log --def clean=y --def excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL" --def ignore="fylla_disken|uppackat" --def movieFormat=""$CONFIG_OUTPUT"{any{/Animation/ in genres ? 'omkodat/animerat/Movies/"$(date "+%Y")"/"$(date "+%W")"' : genres =~ /Documentary/? 'dokumentar/erase' : 'omkodat/film/Movies/"$(date "+%Y")"/"$(date "+%W")"'}{'dokumentar/radera'}}/{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: Use filebot to share movie base on language?

Post by rednoah »

Yes, you can process different movies in different ways based on arbitrary movie or media properties, so you just need to modify your custom format and implement the desired beahviour:

Code: Select all

{ audioLanguages =~ /eng|swe/ ? '/path/to/Movies' : '/path/to/Trash' }

e.g.

Code: Select all

{
	any{
		audioLanguages =~ /eng|swe/ ? 'English and Swedish'
		: 'Other Language'
	}
	{ 'No Language' }
}
/
{
	any{
		genres =~ /Animation/ ? 'Animation/Movies' + today.format('/yyyy/ww')
		: genres =~ /Documentary/ ? 'Documentary/Movies'
		: 'Other Genre/Movies' + today.format('/yyyy/ww')
	}
	{ 'No Genre/Movies' }
}
/
{ plex.tail }

:idea: This custom format is complex, so you'll want to maintain it in an external text file, and not in-line on the command-line. Use the @file syntax for reading command-line arguments from external text files:

Code: Select all

--def movieFormat=@/path/to/MovieFormat.groovy



:idea: If you want to not process files that are not English/Swedish then you can use the --file-filter option. See How to process only specific kinds of files? for details.
:idea: Please read the FAQ and How to Request Help.
MickeMM
Posts: 44
Joined: 03 Apr 2019, 10:52

Re: Use filebot to share movie base on language?

Post by MickeMM »

Thank you SO MUCH!
I will try it when i come home from the sea.
And again, thank you!

Edit: Something like this?
--def movie=eng,swe

I cant test it now, just did a simple search :)
MickeMM
Posts: 44
Joined: 03 Apr 2019, 10:52

Re: Use filebot to share movie base on language?

Post by MickeMM »

Looks like this work.

Code: Select all

/bin/bash /filebot-portable/filebot.sh -script fn:amc [b]--filter 'f.languages && !(lang =~ /eng|swe/)'[/b] --output "$CONFIG_OUTPUT" --action duplicate -non-strict --conflict auto --log-file /filebot-log/amc.log --def clean=y --def excludeList="/filebot-log/.excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL" --def ignore="fylla_disken|uppackat" --def movieFormat=""$CONFIG_OUTPUT"{any{/Animation/ in genres ? 'omkodat/animerat/Movies/"$(date "+%Y")"/"$(date "+%W")"' : genres =~ /Documentary/? 'dokumentar/radera' : 'omkodat/film/Movies/"$(date "+%Y")"/"$(date "+%W")"'}{'dokumentar/radera'}}/{plex.tail}" seriesFormat=""$CONFIG_OUTPUT"serie/{plex}"
I diden't get the groovy to work.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Use filebot to share movie base on language?

Post by rednoah »

1.
--def movie=eng,swe means nothing. What are you trying to express? --def movie is not an option, so adding it does nothing.



2.
--filter does not do what you think it does:
viewtopic.php?t=2127

:!: --filter 'f.languages && !(lang =~ /eng|swe/)' means nothing and probably just fails, thus excludes all movie / episode matches, thus forces the amc script to never match anything.



3.
The solution in my previous post seems to not have made it into your latest filebot command example:
viewtopic.php?p=59342#p59342

:arrow: Please integrate it into your command, and run tests. Then modify it to your needs as necessary, and run tests.

:arrow: If you encounter any problems, just paste the command and console output and tell us where it's not doing what you want it to do.



EDIT:

Don't worry about things if you can't run tests at the moment. Nobody can write perfectly working code for a not-previously-solved problems without doing many trial & error tests along the way. ;)
:idea: Please read the FAQ and How to Request Help.
Post Reply