Different behaviour between GUI and CLI

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Koni
Posts: 3
Joined: 23 Apr 2020, 07:51

Different behaviour between GUI and CLI

Post by Koni »

Hello there,
I have an issue to identify TV shows using CLI while it works fine with GUI.

Using Filebot Gui
1) In rename mode, I use Load button to select "C:\test\malc" folder
2) I set match preferences to "Strict", "French" language and "Airdate" order
3) Right click on match then, fetch data from theTVDB

All episodes are identified fine without any question / popup

Using CLI
I use following command line :

Code: Select all

filebot ^
C:\test\malc ^
-script ^
fn:amc ^
--output ^
C:\test\out ^
--action ^
move ^
--order ^
airdate ^
--conflict ^
skip ^
--lang ^
fr ^
--def ^
clean=y ^
skipExtract=y ^
minLengthMS=0 ^
minFileSize=0 ^
unsorted=n ^
seriesFormat="{n}/{'Saison '+s}/{n} - {s00e00} - {t.replaceAll(/[:]/, \"-\").replaceAll(/[`]/, \"'\")}" ^
--log ^
all ^
--log-file ^
C:\test\filebot.log
Here is the result :

Code: Select all

C:\test>runfilebot.bat

C:\test>filebot C:\test\malc -script fn:amc --output C:\test\out --action move --order airdate --conflict skip --lang fr --def clean=y skipExtract=y minLengthMS=0 minFileSize=0 unsorted=n seriesFormat="{n}/{'Saison '+s}/{n} - {s00e00} - {t.replaceAll(/[:]/, \"-\").replaceAll(/[`]/, \"'\")}" --log all --log-file C:\test\filebot.log
Run script [fn:amc] at [Thu Apr 23 10:04:42 CEST 2020]
Parameter: clean = y
Parameter: skipExtract = y
Parameter: minLengthMS = 0
Parameter: minFileSize = 0
Parameter: unsorted = n
Parameter: seriesFormat = {n}/{'Saison '+s}/{n} - {s00e00} - {t.replaceAll(/[:]/, "-").replaceAll(/[`]/, "'")}
Argument[0]: C:\test\malc
Input: C:\test\malc\Malcolm in the Middle S01E01 Pilot Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv
Input: C:\test\malc\Malcolm in the Middle S01E02 Red Dress Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv
Input: C:\test\malc\Malcolm in the Middle S01E03 Home Alone 4 Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv
Input: C:\test\malc\Malcolm in the Middle S01E04 Shame Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv
Input: C:\test\malc\Malcolm in the Middle S01E05 Malcolm Babysits Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv
Input: C:\test\malc\Malcolm in the Middle S01E06 Sleepover Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv
Input: C:\test\malc\Malcolm in the Middle S01E07 Francis Escapes Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv
Input: C:\test\malc\Malcolm in the Middle S01E08 Krelboyne Picnic Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv
Input: C:\test\malc\Malcolm in the Middle S01E09 Lois vs Evil Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv
Input: C:\test\malc\Malcolm in the Middle S01E10 Stock Car Races Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv
Input: C:\test\malc\Malcolm in the Middle S01E11 Funeral Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv
Input: C:\test\malc\Malcolm in the Middle S01E12 Cheerleader Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv
Input: C:\test\malc\Malcolm in the Middle S01E13 Rollerskates Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv
Input: C:\test\malc\Malcolm in the Middle S01E14 The Bots and the Bees Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv
Input: C:\test\malc\Malcolm in the Middle S01E15 Smunday Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv
Input: C:\test\malc\Malcolm in the Middle S01E16 Water Park 1 Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv
Group: {Series=malcolm in the middle} => [Malcolm in the Middle S01E01 Pilot Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv, Malcolm in the Middle S01E02 Red Dress Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv, Malcolm in the Middle S01E03 Home Alone 4 Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv, Malcolm in the Middle S01E04 Shame Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv, Malcolm in the Middle S01E05 Malcolm Babysits Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv, Malcolm in the Middle S01E06 Sleepover Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv, Malcolm in the Middle S01E07 Francis Escapes Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv, Malcolm in the Middle S01E08 Krelboyne Picnic Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv, Malcolm in the Middle S01E09 Lois vs Evil Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv, Malcolm in the Middle S01E10 Stock Car Races Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv, Malcolm in the Middle S01E11 Funeral Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv, Malcolm in the Middle S01E12 Cheerleader Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv, Malcolm in the Middle S01E13 Rollerskates Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv, Malcolm in the Middle S01E14 The Bots and the Bees Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv, Malcolm in the Middle S01E15 Smunday Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv, Malcolm in the Middle S01E16 Water Park 1 Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv]
Rename episodes using [TheTVDB] with [Airdate Order]
Auto-detected query: [Malcolm in the Middle]
Fetching episode data for [Malcolm]
Fetching episode data for [Stuck in the Middle]
Multiple Options: C:\test\malc\Malcolm in the Middle S01E01 Pilot Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv: [Malcolm, Harley, le cadet de mes soucis]
Multiple Options: C:\test\malc\Malcolm in the Middle S01E02 Red Dress Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv: [Malcolm, Harley, le cadet de mes soucis]
Multiple Options: C:\test\malc\Malcolm in the Middle S01E03 Home Alone 4 Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv: [Malcolm, Harley, le cadet de mes soucis]
Multiple Options: C:\test\malc\Malcolm in the Middle S01E04 Shame Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv: [Malcolm, Harley, le cadet de mes soucis]
Multiple Options: C:\test\malc\Malcolm in the Middle S01E05 Malcolm Babysits Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv: [Malcolm, Harley, le cadet de mes soucis]
Multiple Options: C:\test\malc\Malcolm in the Middle S01E06 Sleepover Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv: [Malcolm, Harley, le cadet de mes soucis]
Multiple Options: C:\test\malc\Malcolm in the Middle S01E07 Francis Escapes Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv: [Malcolm, Harley, le cadet de mes soucis]
Multiple Options: C:\test\malc\Malcolm in the Middle S01E08 Krelboyne Picnic Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv: [Malcolm, Harley, le cadet de mes soucis]
Multiple Options: C:\test\malc\Malcolm in the Middle S01E09 Lois vs Evil Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv: [Malcolm, Harley, le cadet de mes soucis]
Multiple Options: C:\test\malc\Malcolm in the Middle S01E10 Stock Car Races Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv: [Malcolm, Harley, le cadet de mes soucis]
Multiple Options: C:\test\malc\Malcolm in the Middle S01E11 Funeral Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv: [Malcolm, Harley, le cadet de mes soucis]
Multiple Options: C:\test\malc\Malcolm in the Middle S01E12 Cheerleader Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv: [Malcolm, Harley, le cadet de mes soucis]
Multiple Options: C:\test\malc\Malcolm in the Middle S01E13 Rollerskates Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv: [Malcolm, Harley, le cadet de mes soucis]
Multiple Options: C:\test\malc\Malcolm in the Middle S01E14 The Bots and the Bees Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv: [Malcolm, Harley, le cadet de mes soucis]
Multiple Options: C:\test\malc\Malcolm in the Middle S01E15 Smunday Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv: [Malcolm, Harley, le cadet de mes soucis]
Multiple Options: C:\test\malc\Malcolm in the Middle S01E16 Water Park 1 Multi VFI NOST 1080p WEB-DL NF x265 HEVC AAC 5.1-Papaya.mkv: [Malcolm, Harley, le cadet de mes soucis]
* Consider using -non-strict to enable advanced auto-selection
* Consider using --filter "id in [73838]" or --q "Malcolm" to select one option
CmdlineException: Failed to identify or process any files
Finished without processing any files
Abort (×_×)
Do you have an idea why behaviour is different ?
Please let me know if I can test something.
User avatar
rednoah
The Source
Posts: 23959
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Different behaviour between GUI and CLI

Post by rednoah »

GUI and CLI are not necessarily identical, especially not in Strict Mode, because the GUI won't do anything without your approval, and thus can get away with being less strict for added convenience.

e.g. GUI will sometimes answer its own questions without bothering you, while the CLI prompts you to be more explicit in advance before moving on to processing files without your explicit approval:

Code: Select all

Consider using --filter "id in [73838]" or --q "Malcolm" to select one option
:idea: Please read the FAQ and How to Request Help.
Koni
Posts: 3
Joined: 23 Apr 2020, 07:51

Re: Different behaviour between GUI and CLI

Post by Koni »

Hi Rednoah,

Thanks for your help.
Is there a way to get the same behaviour for CLI and GUI (by adding a parameter to command line ?)
Maybe I can help CLI detection by adding a list of tv show I already have ? Is there a way to do that ?

Regards,
User avatar
rednoah
The Source
Posts: 23959
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Different behaviour between GUI and CLI

Post by rednoah »

You can use the --filter option to whitelist or blacklist options in advance:
viewtopic.php?t=2127

As long as --filter eliminates all but one option, then Strict Mode will be happy to process that one option.
:idea: Please read the FAQ and How to Request Help.
Koni
Posts: 3
Joined: 23 Apr 2020, 07:51

Re: Different behaviour between GUI and CLI

Post by Koni »

Hi,

I will end up by using this filter :

Code: Select all

--filter "( lines('C:/test/tvlist.txt').contains(n) && type == /Episode/ ) || ( type == /Movie/ )"
This will allow me to provide a list of known TV shows and disable filtering for Movies.
Next job is to generate tvlist.txt from folder names.

Small comment : readLines in filter is now deprecated, we should use lines instead.

Thanks a lot for your help !
User avatar
rednoah
The Source
Posts: 23959
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Different behaviour between GUI and CLI

Post by rednoah »

You could probably write it like this:

Code: Select all

any{episode; n in output.list()}{ true }
episode ... fails if the current object isn't an Episode object
output.list() ... file and folder listing for your --output folder (you may need to adjust this depending on your series format)
:idea: Please read the FAQ and How to Request Help.
Post Reply