Page 1 of 1

Matching another format

Posted: 09 Feb 2016, 12:47
by 2muchtv
Hi,

Firstly, I'm ecstatic in discovering Filebot, this seems to sort out my issue of living with a flat-directory of series/movies folders and symlinking/hardlinking it elsewhere in Kodi/whatever. Having just discovered it however, I am a complete noob :)

I'm not yet too bothered with how files are named where they end up, the amc, etc. documentation seems to describe that well.

What I am struggling with however is how I can change how matching works with my source material - unfortunately I have several 100's of gb's worth of series files in a slightly custom format all living in one flat directory in the format of: Series.Name-s01e01-SD.ext other than the obvious the latter end ends in SD or HD, so a example would be:
Alf-s01e01-SD.mp4
CSI.Los.Angeles-s02e03.mkv
etc.

Any idea how I specify this syntax? It seems like --format is for the resulting/output files, and in the amc information I found at-hand it reverts to using --def "seriesFormat" however again that seems like the resulting/output files and not based on the matching conditions.

Thanks!

Re: Matching another format

Posted: 09 Feb 2016, 13:17
by rednoah
1.
A file "Alf-s01e01-SD.mp4" will be matched to an Episode object, then your --format is used to convert that Episode object to a file path.


2.
FileBot doesn't care how your files are organized. It'll do it's best to determine which file is which Episode based on the information that is available (file/folder names, metadata, etc).

If you have lots of files, you probably wanna run some tests on a small chunk of files first. You can use --action test for that. Rely on movie/series auto-detection only if necessary.


3.
You can move/rename files based on the filename itself. Moving episodes into series/season/episode folders may or may not improve accuracy when running -rename or the amc script on large batches of files:
viewtopic.php?f=3&t=2072

Re: Matching another format

Posted: 09 Feb 2016, 14:46
by 2muchtv
Thanks rednoah,

1 - Thanks, I was concerned that the SD|HD items was 'confusing' the matcher somehow..

2 - Appreciate that, been testing with '--action test' for the very same reason. Unfortunately circumstances dictate that all my series files is in one flat structure, not a immediate problem it seems..

3 - Unfortunately the directory where all the series lie is there for other players which operate less effectively in that manner - for example on a WDTV Live you would have to go in every folder by hand to which may or may not be empty, etc. my use case for filebot is to attempt to organise the same folder (with symlinks most probably) in a manner that other players, such as Kodi will at least be able to index/Librarise :)

Seeing as there should be no issues I'm running into a strange one..

Code: Select all

$ ls /tmp/test ; rm -rf /tmp/test-lib/*
Believe-s01e11-HD.mkv  Believe-s01e12-HD.mkv  Castle.2009-s08e09-HD.mkv
Believe-s01e11-SD.mp4  Believe-s01e12-SD.mp4  Castle.2009-s08e09-SD.mp4
$ filebot -script fn:amc --output "/tmp/test-lib" --action symlink "/tmp/test"   --q seri
es --db TheTVDB --def skipExtract=y -non-strict  | tee /tmp/filebot.log
Run script [fn:amc] at [Tue Feb 09 16:40:30 GMT +2]
Parameter: skipExtract = y
Argument: /tmp/test
Input: /tmp/test/Believe-s01e11-HD.mkv
Input: /tmp/test/Believe-s01e11-SD.mp4
Input: /tmp/test/Believe-s01e12-HD.mkv
Input: /tmp/test/Believe-s01e12-SD.mp4
Input: /tmp/test/Castle.2009-s08e09-HD.mkv
Input: /tmp/test/Castle.2009-s08e09-SD.mp4
Group: [tvs:believe] => [Believe-s01e11-HD.mkv, Believe-s01e11-SD.mp4, Believe-s01e12-HD.mkv, Believe-s01e12-S
D.mp4]
Group: [tvs:castle 2009] => [Castle.2009-s08e09-HD.mkv, Castle.2009-s08e09-SD.mp4]
Rename episodes using [TheTVDB]
Fetching episode data for [The UP Series]
Fetching episode data for [The Sagan Series]
Fetching episode data for [Is Born Series]
Fetching episode data for [The Feynman Series]
Fetching episode data for [XIII (2011)]
Fetching episode data for [The UP Series]
Fetching episode data for [The Sagan Series]
Fetching episode data for [Is Born Series]
Fetching episode data for [The Feynman Series]
Fetching episode data for [XIII (2011)]
[SYMLINK] Rename [/tmp/test/Believe-s01e11-SD.mp4] to [/tmp/test-lib/TV Shows/XIII (2011)/Season 01/XIII (2011) - S01E11 - The Bunker.mp4]
[SYMLINK] Rename [/tmp/test/Believe-s01e12-SD.mp4] to [/tmp/test-lib/TV Shows/XIII (2011)/Season 01/XIII (2011) - S01E12 - The Key.mp4]
[SYMLINK] Rename [/tmp/test/Believe-s01e11-HD.mkv] to [/tmp/test-lib/TV Shows/XIII (2011)/Season 01/XIII (2011) - S01E11 - The Bunker.mkv]
[SYMLINK] Rename [/tmp/test/Believe-s01e12-HD.mkv] to [/tmp/test-lib/TV Shows/XIII (2011)/Season 01/XIII (2011) - S01E12 - The Key.mkv]
Processed 4 files
Rename episodes using [TheTVDB]
Fetching episode data for [The UP Series]
Fetching episode data for [The Sagan Series]
Fetching episode data for [Is Born Series]
Fetching episode data for [The Feynman Series]
Fetching episode data for [XIII (2011)]
Fetching episode data for [The UP Series]
Fetching episode data for [The Sagan Series]
Fetching episode data for [Is Born Series]
Fetching episode data for [The Feynman Series]
Fetching episode data for [XIII (2011)]
Stripping invalid characters from new path: TV Shows/Is Born Series/Season 08/Is Born Series - S08E09 - An MG is Born: Part 9 (MGB Roadster)
Stripping invalid characters from new path: TV Shows/Is Born Series/Season 08/Is Born Series - S08E09 - An MG is Born: Part 9 (MGB Roadster)
[SYMLINK] Rename [/tmp/test/Castle.2009-s08e09-HD.mkv] to [/tmp/test-lib/TV Shows/Is Born Series/Season 08/Is Born Series - S08E09 - An MG is Born Part 9 (MGB Roadster).mkv]
[SYMLINK] Rename [/tmp/test/Castle.2009-s08e09-SD.mp4] to [/tmp/test-lib/TV Shows/Is Born Series/Season 08/Is Born Series - S08E09 - An MG is Born Part 9 (MGB Roadster).mp4]
Processed 2 files
Done ヾ(@⌒ー⌒@)ノ
$ ls -1 /tmp/test-lib/TV\ Shows/
Is Born Series
XIII (2011)
As you can see, the input files are nothing close to what they should be, yet the lines starting with ^Group seems to match perfectly (or is that what it searched on TVDB for?), any ideas?

Thanks!

Re: Matching another format

Posted: 09 Feb 2016, 15:37
by rednoah
You can force series mode via --def ut_label and that'll automatically force TheTVDB as well.

Using --q and --db will screw with default behaviour. Remove those options. You want default behaviour.

You don't want to override auto-detection with your own --q query unless you know exactly what you're doing.

Re: Matching another format

Posted: 09 Feb 2016, 15:51
by 2muchtv
rednoah wrote:You can force series mode via --def ut_label and that'll automatically force TheTVDB as well.

Using --q and --db will screw with default behaviour. Remove those options. You want default behaviour.

You don't want to override auto-detection with your own --q query unless you know exactly what you're doing.
Thanks for the tips redonah,

I removed --q and --db as I don't know what I'm doing and strangely it is acting the same, I get the same resulting files with or without --def "ut_label=TV" and with or without -non-strict, using the same files as above:

Code: Select all

$ rm -rf /tmp/test-lib/*
$ filebot -script fn:amc --output "/tmp/test-lib" --action symlink "/tmp/test"  --def skipExtract=y -non-strict  --def "ut_label=TV" | tee /tmp/filebot.log
Run script [fn:amc] at [Tue Feb 09 17:47:22 GMT +2]
Parameter: skipExtract = y
Parameter: ut_label = TV
Argument: /tmp/test
Input: /tmp/test/Believe-s01e11-HD.mkv
Input: /tmp/test/Believe-s01e11-SD.mp4
Input: /tmp/test/Believe-s01e12-HD.mkv
Input: /tmp/test/Believe-s01e12-SD.mp4
Input: /tmp/test/Castle.2009-s08e09-HD.mkv
Input: /tmp/test/Castle.2009-s08e09-SD.mp4
Group: [tvs:xiii 2011] => [Believe-s01e11-HD.mkv, Believe-s01e11-SD.mp4, Believe-s01e12-HD.mkv, Believe-s01e12-SD.mp4]
Group: [tvs:is born series] => [Castle.2009-s08e09-HD.mkv, Castle.2009-s08e09-SD.mp4]
Rename episodes using [TheTVDB]
Auto-detected query: [XIII (2011)]
Fetching episode data for [XIII (2011)]
Auto-detected query: [XIII (2011)]
Fetching episode data for [XIII (2011)]
[SYMLINK] Rename [/tmp/test/Believe-s01e11-SD.mp4] to [/tmp/test-lib/TV Shows/XIII (2011)/Season 01/XIII (2011) - S01E11 - The Bunker.mp4]
[SYMLINK] Rename [/tmp/test/Believe-s01e12-SD.mp4] to [/tmp/test-lib/TV Shows/XIII (2011)/Season 01/XIII (2011) - S01E12 - The Key.mp4]
[SYMLINK] Rename [/tmp/test/Believe-s01e11-HD.mkv] to [/tmp/test-lib/TV Shows/XIII (2011)/Season 01/XIII (2011) - S01E11 - The Bunker.mkv]
[SYMLINK] Rename [/tmp/test/Believe-s01e12-HD.mkv] to [/tmp/test-lib/TV Shows/XIII (2011)/Season 01/XIII (2011) - S01E12 - The Key.mkv]
Processed 4 files
Rename episodes using [TheTVDB]
Auto-detected query: [Is Born Series]
Fetching episode data for [Is Born Series]
Auto-detected query: [Is Born Series]
Fetching episode data for [Is Born Series]
Stripping invalid characters from new path: TV Shows/Is Born Series/Season 08/Is Born Series - S08E09 - An MG is Born: Part 9 (MGB Roadster)
Stripping invalid characters from new path: TV Shows/Is Born Series/Season 08/Is Born Series - S08E09 - An MG is Born: Part 9 (MGB Roadster)
[SYMLINK] Rename [/tmp/test/Castle.2009-s08e09-HD.mkv] to [/tmp/test-lib/TV Shows/Is Born Series/Season 08/Is Born Series - S08E09 - An MG is Born Part 9 (MGB Roadster).mkv]
[SYMLINK] Rename [/tmp/test/Castle.2009-s08e09-SD.mp4] to [/tmp/test-lib/TV Shows/Is Born Series/Season 08/Is Born Series - S08E09 - An MG is Born Part 9 (MGB Roadster).mp4]
Processed 2 files
Done ヾ(@⌒ー⌒@)ノ
Any ideas?

Re: Matching another format

Posted: 09 Feb 2016, 15:59
by rednoah
Your files are tagged now. Use the xattr script to untag them:
viewtopic.php?f=4&t=5#p5394

That's why we always use --action test until we know it's working. Test mode disables various behaviours, and xattr is one of them.

Re: Matching another format

Posted: 09 Feb 2016, 16:50
by 2muchtv
rednoah wrote:Your files are tagged now. Use the xattr script to untag them:
viewtopic.php?f=4&t=5#p5394

That's why we always use --action test until we know it's working. Test mode disables various behaviours, and xattr is one of them.
rednoah, nice!

Admittedly I used '--action test' and then slipped over to using symlink some point during my testing, I was not aware of the behavioral change - that said, learnt a lot, thanks!

Good use of xattr there! That works perfectly indeed and lots of interesting scripts at that link too.

Totally aside & stupid user request - could not find such a option, any method to limit the directory depth to scan on the input/original files side?

Thanks for your help!

Re: Matching another format

Posted: 09 Feb 2016, 17:00
by rednoah
You can pass in your own file lists via arguments:

Code: Select all

find . -maxdepth 1 -type f -exec filebot -script fn:amc ... '{}' '+'

Re: Matching another format

Posted: 09 Feb 2016, 17:17
by 2muchtv
rednoah wrote:You can pass in your own file lists via arguments:

Code: Select all

find . -maxdepth 1 -type f -exec filebot -script fn:amc ... '{}' '+'
Exactly what I figured I would do if filebot itself did not offer it, thanks a ton again for your help!

Re: Matching another format

Posted: 09 Feb 2016, 17:23
by rednoah
You can use --def ignore=regex for filtering out file paths that are too long, but for folder depth it'd be a bit clunky.