[SOLVED] german movie naming with listener

All about user-defined episode / movie / file name format expressions
Post Reply
thepappaq
Posts: 7
Joined: 06 Dec 2018, 15:21

[SOLVED] german movie naming with listener

Post by thepappaq »

Hello, everybody,

I have the following problem. I run filebot in a docker container without GUI and try to figure out how to set filebot to do the titles using the german The Movie Database entry.

I want the listener to simply listen to the input folder and rename and move the folder and movie file. I have already written the naming scheme, but I can't get it to use the German title.

I wonder if you can't just pass filebot a parameter in the config-file to switch the preferred language to german?

Here the code of the .conf and the .sh file.

Code: Select all

# If we don't see any events for $SETTLE_DURATION time, assume that it's safe to run FileBot. Format is HH:MM:SS,
# with HH and MM optional.
SETTLE_DURATION=10

# However, if we see a stream of changes for longer than $MAX_WAIT_TIME with no break of $SETTLE_DURATION or more, then
# go ahead and run FileBot. Otherwise we might be waiting forever for the directory to stop changing. Format is
# HH:MM:SS, with HH and MM optional.
MAX_WAIT_TIME=05:01:00

# After running FileBot, wait at least this long before running it again, even if $SETTLE_DURATION time has passed
# after change. This controls the maximum frequency of FileBot.
MIN_PERIOD=05:00

# Set this to 1 to log all events, for debugging purposes. WARNING! This creates copious amounts of confusing logging!
DEBUG=0

# Create an account at http://www.opensubtitles.org/ if you want to download subtitles
OPENSUBTITLES_USER=""
OPENSUBTITLES_PASSWORD=""

# Set this to a language code if you want to download subtitles. e.g. Use "en" for english
SUBTITLE_LANG=""

# By default, the container monitors /input and writes files to /output. Use this option if you are mounting /media
# instead. See the documentation for more information.
#INPUT_DIR=/media/input
#OUTPUT_DIR=/media/output

# Allow FileBot to process a file if the file is created or modified in the input directory, even if FileBot processed
# the file before. Setting this to "no" causes FileBot to remember the file forever.
ALLOW_REPROCESSING=yes

# Run the UI in addition to the normal non-interactive behavior. The UI uses about 460MB of RAM, as opposed to about
# 20MB of RAM. On my machine it uses .33% CPU instead of .03% CPU.
RUN_UI=yes

Code: Select all

#!/bin/bash

# This script by default uses "Automated Media Center" (AMC). See the final filebot call below. For more docs on AMC,
# visit: http://www.filebot.net/forums/viewtopic.php?t=215

#-----------------------------------------------------------------------------------------------------------------------

# Specify the URLs of any scripts that you need. They will be downloaded into /config/scripts
SCRIPTS_TO_DOWNLOAD=(
# Example:
# https://raw.githubusercontent.com/filebot/scripts/devel/cleaner.groovy
)

#-----------------------------------------------------------------------------------------------------------------------

QUOTE_FIXER='replaceAll(/[\`\u00b4\u2018\u2019\u02bb]/, "'"'"'").replaceAll(/[\u201c\u201d]/, '"'"'""'"'"')'

# Customize the renaming format here. For info on formatting: https://www.filebot.net/naming.html

# Music/Eric Clapton/From the Cradle/05 - It Hurts Me Too.mp3
MUSIC_FORMAT="Music/{n.$QUOTE_FIXER}/{album.$QUOTE_FIXER}/{media.TrackPosition.pad(2)} - {t.$QUOTE_FIXER}"

# Fight Club (1999)/Fight Club.mkv
MOVIE_FORMAT="{n} ({y})/{n}{' CD'+pi}"

# TV Shows/Game of Thrones/Season 05/Game of Thrones - S05E08 - Hardhome.mp4
# TV Shows/Game of Thrones/Special/Game of Thrones - S00E11 - A Day in the Life.mp4
SERIES_FORMAT="TV Shows/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.${QUOTE_FIXER}.replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}"

. /files/FileBot.conf

if [ "$SUBTITLE_LANG" == "" ];then
  SUBTITLE_OPTION=""
else
  SUBTITLE_OPTION="subtitles=$SUBTITLE_LANG"
fi

#-----------------------------------------------------------------------------------------------------------------------

# Used to detect old versions of this script
VERSION=5

# Download scripts and such.
. /files/pre-run.sh

# See http://www.filebot.net/forums/viewtopic.php?t=215 for details on amc
filebot -script fn:amc -no-xattr --output "$OUTPUT_DIR" --log-file /files/amc.log --action move --conflict auto \
  -non-strict --def ut_dir="$INPUT_DIR" ut_kind=multi music=y deleteAfterExtract=y clean=y \
  excludeList=/config/amc-exclude-list.txt $SUBTITLE_OPTION \
  movieFormat="$MOVIE_FORMAT" musicFormat="$MUSIC_FORMAT" seriesFormat="$SERIES_FORMAT"

if [ "$ALLOW_REPROCESSING" = "yes" ]; then
  tempfile=$(mktemp)
  # FileBot only puts files that it can process into the amc-exclude-list.txt file. e.g. jpg files are not in there. So
  # take the intersection of the existing files and the ones in the list.
  comm -12 <(sort /config/amc-exclude-list.txt) <(find /input | sort) > $tempfile
  mv -f $tempfile /config/amc-exclude-list.txt
fi
Thank you very much for the answers in advance.

greetings
Last edited by thepappaq on 06 Dec 2018, 18:25, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: german movie naming with listener

Post by rednoah »

I'm not familiar with your docker container. However, as far as the filebot command-line tools is concerned, --lang German will do the trick:

Code: Select all

--lang German
:idea: Please read the FAQ and How to Request Help.
thepappaq
Posts: 7
Joined: 06 Dec 2018, 15:21

Re: german movie naming with listener

Post by thepappaq »

I inserted --lang de

Code: Select all

--lang de
Works like a charm! Thank you!
Post Reply