Page 1 of 1

AMC Docker - Advice for better result

Posted: 23 Jan 2023, 17:38
by ShiftyTree
Hi rednoah, Hi forum, first time poster here!

I'm going for an mostly-automated content pipeline 'jDownloader->filebot->emby' by just C'n'L links and let the machines make them appear in the correct tvshow/movies storage for emby server to pick-up. Everything of this runs in Docker. This pipeline highly depends on filebot's ability to separate tvshows and movies which seems to be the key feature of FB for me. I happy I stumbled upon your project and really appreciate your work here!

This is the sysinfo of the container (rednoah/filebot)

Code: Select all

FileBot 4.9.6 (r9125)
JNA Native: 6.1.1
MediaInfo: 21.09
Tools: fpcalc/1.5.1 7z/16.02 unrar/6.11 mkvpropedit/65.0.0 AtomicParsley/8
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2022-08-15 (r836)
Groovy: 3.0.9
JRE: OpenJDK Runtime Environment 17.0.5
JVM: OpenJDK 64-Bit Server VM
CPU/MEM: 2 Core / 4.2 GB Max Memory / 34 MB Used Memory
OS: Linux (amd64)
HW: Linux cd99a6772e70 5.15.83-1-pve #1 SMP PVE 5.15.83-1 (2022-12-15T00:00Z) x86_64 x86_64 x86_64 GNU/Linux
CPU/MEM: Intel(R) Core(TM) i3-8109U CPU @ 3.00GHz [MemTotal: 16 GB | MemFree: 3.6 GB | MemAvailable: 4.2 GB | SwapCached: 310 MB | SwapTotal: 8 GB | SwapFree: 6 GB]
STORAGE: overlay [/] @ 212 GB | zfs [/volume1] @ 700 GB | zfs [/data] @ 212 GB
USER: filebot
DATA: /data/filebot
Package: DOCKER
License: FileBot License P********* (Valid-Until: 2024-xx-yy)
Done ヾ(@⌒ー⌒@)ノ
Maybe I had bad luck (with the exotic titles) but I suffer from 'mis-recognization' and I'm wondering whether there is something to fine-tune that I overlooked. Later I would want to use the watcher image or jlesage/filebot image but first I want the settings tweaked for 'perfection'. This is my command:

Code: Select all

docker run --rm -it -v /mnt/dlbox:/volume1 -v /docker/appdata/rednoah-filebot:/data rednoah/filebot \
        -script fn:amc \
        --output "/volume1/" \
        --action test \
        -non-strict \
        --lang English \
        --log all \
        --log-file amc.log \
        "/volume1/download.1deflate" \
        --def movieDB=TheMovieDB \
        --def seriesDB=TheMovieDB::TV \
        --def unsorted=y \
        --def unsortedFormat="/volume1/download.3sorted.unsorted/{ fn }" \
        --def artwork=y \
        --def music=n \
        --def movieFormat="./download.3sorted.movies/{n} ({y})/{n} ({y}) {vf}" \
        --def seriesFormat="./download.3sorted.tvshows/{n} ({y})/Season {s.pad(2)}/s{s.pad(2)}e{e.pad(2)} - {t}" \
#       --def clean=y \
#       --def excludeList=amc.txt \
and it results in this output:

Code: Select all

Run script [fn:amc] at [Mon Jan 23 17:30:38 GMT 2023]
Parameter: movieDB = TheMovieDB
Parameter: seriesDB = TheMovieDB::TV
Parameter: unsorted = y
Parameter: unsortedFormat = /volume1/download.3sorted.unsorted/{ fn }
Parameter: artwork = y
Parameter: music = n
Parameter: movieFormat = ./download.3sorted.movies/{n} ({y})/{n} ({y}) {vf}
Parameter: seriesFormat = ./download.3sorted.tvshows/{n} ({y})/Season {s.pad(2)}/s{s.pad(2)}e{e.pad(2)} - {t}
Argument[0]: /volume1/download.1deflate
[TEST] --def artwork is incompatible with --action TEST and has been disabled
[TEST] --def unsorted is incompatible with --action TEST and has been disabled
Ignore video extra: /volume1/download.1deflate/Sie.nannten.ihn.Muecke.1978.German.1080p.BluRay/Sample/d-muecke-1080p-sample.mkv
Input: /volume1/download.1deflate/Sie.nannten.ihn.Muecke.1978.German.1080p.BluRay/Subs/d-muecke-1080p.idx
Input: /volume1/download.1deflate/Sie.nannten.ihn.Muecke.1978.German.1080p.BluRay/Subs/d-muecke-1080p.sub
Input: /volume1/download.1deflate/Sie.nannten.ihn.Muecke.1978.German.1080p.BluRay/d-muecke-1080p.mkv
Group: {Movie=Uppercut (1978)} => [d-muecke-1080p.idx, d-muecke-1080p.sub]
Group: {Movie=Uppercut (1978), Series=null} => [d-muecke-1080p.mkv]
Rename movies using [TheMovieDB]
Auto-detect movie from context [/volume1/download.1deflate/Sie.nannten.ihn.Muecke.1978.German.1080p.BluRay/Subs/d-muecke-1080p.idx]
Auto-detect movie from context [/volume1/download.1deflate/Sie.nannten.ihn.Muecke.1978.German.1080p.BluRay/Subs/d-muecke-1080p.sub]
[TEST] from [/volume1/download.1deflate/Sie.nannten.ihn.Muecke.1978.German.1080p.BluRay/Subs/d-muecke-1080p.sub] to [/volume1/./download.3sorted.movies/Sie nannten ihn Mücke (1978)/Sie nannten ihn Mücke (1978) 1080p.sub]
[TEST] from [/volume1/download.1deflate/Sie.nannten.ihn.Muecke.1978.German.1080p.BluRay/Subs/d-muecke-1080p.idx] to [/volume1/./download.3sorted.movies/Sie nannten ihn Mücke (1978)/Sie nannten ihn Mücke (1978) 1080p.idx]
Processed 2 files
Rename movies using [TheMovieDB]
[TEST] from [/volume1/download.1deflate/Sie.nannten.ihn.Muecke.1978.German.1080p.BluRay/d-muecke-1080p.mkv] to [/volume1/./download.3sorted.movies/Uppercut (1978)/Uppercut (1978) 1080p.mkv]
Processed 1 file
Finished without processing any files
Done ¯\_(ツ)_/¯
The sub-titles and the movie go into different directories, and I've no idea why. My expectation would be to have everything (+art +nfo) under 'Sie nannten ihn Mücke (1978)'.

Thanks in advance!

Re: AMC Docker - Advice for better result

Posted: 24 Jan 2023, 04:05
by rednoah
This is a funny one, because both Uppercut (1978) and Sie nannten ihn Mücke (1978) are correct and refer to the same movie:
https://www.themoviedb.org/movie/11144- ... -bulldozer


:idea: If you don't care about subtitle files, then you can use --def ignore="sub|idx" to not process them.


:idea: If you care about subtitle files, then pre-processing them to match the folder and file name of the "closest" video file can help get better results. See Rename subtitle files to match the name of a nearby video file for details.




:arrow: Possible duplicate of Strange behavior, title language (if there is a nearby *.nfo file). Because the *.nfo file is picked up by the movie file in the same folder, but not the subtitle files in the different folder.

Here's what I get with the latest beta revision:

Code: Select all

...
Input: Sie.nannten.ihn.Muecke.1978.German.1080p.BluRay/d-muecke-1080p.mp4
Input: Sie.nannten.ihn.Muecke.1978.German.1080p.BluRay/Subs/d-muecke-1080p.idx
Input: Sie.nannten.ihn.Muecke.1978.German.1080p.BluRay/Subs/d-muecke-1080p.sub
...
[TEST] from [Sie.nannten.ihn.Muecke.1978.German.1080p.BluRay/d-muecke-1080p.mp4] to [Movies/They Called Him Bulldozer (1978)/They Called Him Bulldozer (1978).mp4]
[TEST] from [Sie.nannten.ihn.Muecke.1978.German.1080p.BluRay/Subs/d-muecke-1080p.idx] to [Movies/They Called Him Bulldozer (1978)/They Called Him Bulldozer (1978).idx]
[TEST] from [Sie.nannten.ihn.Muecke.1978.German.1080p.BluRay/Subs/d-muecke-1080p.sub] to [Movies/They Called Him Bulldozer (1978)/They Called Him Bulldozer (1978).sub]
...

Emby Format

Posted: 24 Jan 2023, 04:12
by rednoah
Also, you'll want to use the {plex} format because your custom format doesn't take corner cases (e.g. year already part of the series name, no season number, double episodes, etc) into account:

Code: Select all

--def movieFormat='download.3sorted.movies/{ ~emby.id % { " [$vf]" } }'

Code: Select all

--def seriesFormat='download.3sorted.tvshows/{ ~emby.id }'

Re: AMC Docker - Advice for better result

Posted: 25 Jan 2023, 21:56
by ShiftyTree
Ohkayyy.. these are quite a few hints! Thanks a lot. It took me some time to setup images/containers with the beta build and give those hints a try. While doing so, it seemed to me that the different flavors of your docker images are realized through tags rednoah/filebot:watcher instead of something like rednoah/filebot-watcher:latest. But I'm no docker guy, no idea whether this is just a matter of style. Had you ever considered offering the beta as image(s)? Here's my attempt :)

Code: Select all

FROM rednoah/filebot:watcher
RUN curl -sSL https://get.filebot.net/filebot/BETA/FileBot_5.0.0_amd64.deb > FileBot_5.0.0_amd64.deb && dpkg -i FileBot_5.0.0_amd64.deb && rm FileBot_5.0.0_amd64.deb

docker build -t rednoah/filebot-watcher:beta .
Anyway.. I think I will be going with the beta (instead of deleting subs/nfos). Meanwhile I found another bunch of 'source data' that doesn't get recognized very well, but I guess this is daily business.

And thanks for the {emby} hint, I wasn't aware of that. In general this groovy (is it?) notation confuses me quite a bit. Is there a way to get an overview of all the 'possibilities' those objects do offer? You probably have written some posts about it, but I got lost.. (e.g. the semantics of file.structurePathTail or file[1] .. )

Re: AMC Docker - Advice for better result

Posted: 26 Jan 2023, 02:15
by rednoah
Well, we don't plan on doing version-specific or pre-built daily-build containers, and the current docker commands are already in use by a large number of users, so we can't change that now. A change that breaks user setups must have some very compelling advantages.

ShiftyTree wrote: 25 Jan 2023, 21:56 Meanwhile I found another bunch of 'source data' that doesn't get recognized very well, but I guess this is daily business.
Please copy & paste the console logs here. Each case is different, but depending on your use case and mismatch patterns, the --filter option might allow you to fine-tune things for your specific use case.

ShiftyTree wrote: 25 Jan 2023, 21:56 And thanks for the {emby} hint, I wasn't aware of that. In general this groovy (is it?) notation confuses me quite a bit. Is there a way to get an overview of all the 'possibilities' those objects do offer? You probably have written some posts about it, but I got lost.. (e.g. the semantics of file.structurePathTail or file[1] .. )
The {emby} format has its own documentation page. That's all you need. You'll want to use the Format Editor in the Desktop application to prototype your format and explore available bindings.


:?: What does file.structurePathTail or file[1] do? Load a few files in the GUI and open the Format Editor and then see what code gives you what results. That is the best way to approach any custom format, trial & error prototyping. I'm happy to look into the code-level details if you still have questions after that.


:idea: The FileBot Groovy Expression Reference Documentation is there if you want to know everything, but barely scraping the surface by copying & pasting from the examples is more than enough for almost all use cases.