Running a FileBot Post-processor
Follow these instructions to configure the Unmanic Docker container for running FileBot as a Post-processor function.
Instructions:
1) Enable FileBot in the Unmanic container
The Unmanic container does not have FileBot installed out-of-the-box.
You will need to install it into the container during container startup.
- Create a file inside the container
/config/startup.sh
- Inside this file append the following contents:
# _____ _ _ _ _
# | ___(_) | ___| |__ ___ | |_
# | |_ | | |/ _ \ '_ \ / _ \| __|
# | _| | | | __/ |_) | (_) | |_
# |_| |_|_|\___|_.__/ \___/ \__|
#
# Flag to easily disable installation on startup
INSTALL_FILEBOT=true
INSTALL_LEGACY_FILEBOT=false
# Define software versions (only used for legacy installation)
ARCH=amd64 # (amd64, 1386, armhf)
FILEBOT_VERSION=4.7.9
if [[ ${INSTALL_FILEBOT} == 'true' ]]; then
if ! command -v filebot &> /dev/null; then
# 1. Import signing keys
apt-get update
apt-get install -y --install-recommends dirmngr gnupg apt-transport-https
apt-key adv --fetch-keys "https://raw.githubusercontent.com/filebot/plugins/master/gpg/maintainer.pub"
# 2. Add deb repository to sources.list
echo "deb [arch=all] https://get.filebot.net/deb/ universal main" | tee /etc/apt/sources.list.d/filebot.list
# 3. Update package index
apt-get update
# 4. Install dependencies explicitly (otherwise apt-get autoremove may purge them)
apt-get install -y --install-recommends \
default-jre \
openjfx \
mediainfo \
libchromaprint-tools \
p7zip-full \
unrar
if [[ ${INSTALL_LEGACY_FILEBOT} == 'true' ]]; then
# 5. Install FileBot legacy version
mkdir -p /config/filebot/
pushd /config/filebot/
if [[ ! -e /config/filebot/filebot_${FILEBOT_VERSION}_${ARCH}.deb ]]; then
curl -kSL \
-o /config/filebot/filebot_${FILEBOT_VERSION}_${ARCH}.deb \
"https://cfhcable.dl.sourceforge.net/project/filebot/filebot/FileBot_${FILEBOT_VERSION}/filebot_${FILEBOT_VERSION}_${ARCH}.deb"
chmod a+rw /config/filebot/filebot_${FILEBOT_VERSION}_${ARCH}.deb
fi
# apt-get install -y openjdk-8-jdk-headless libjna-java
apt-get install -y /config/filebot/filebot_${FILEBOT_VERSION}_${ARCH}.deb
popd
else
# 5. Install FileBot from repo
apt-get install -y --install-recommends filebot
fi
fi
fi
It may take some time for this script to complete the installation of FileBot and all of its dependencies. During this time, Unmanic will not start, and the web UI will not be accessible. Be patient, it will only need to run this installation the first time the container is started.
You can configure the script in the following ways:
Variable | Set Value | Description |
---|---|---|
INSTALL_FILEBOT | true / false | Enable / Disable the script |
INSTALL_LEGACY_FILEBOT | true | Install the legacy version of FileBot link rather than the latest release |
ARCH | amd64 / 1386 / armhf | Specify the hardware (x86_64 / x86 / ARM) version of FileBot (only required when installing the legacy version) |
FILEBOT_VERSION | 4.7.9 | Specify the version of FileBot to download (only required when installing the legacy version) |
- Restart the container
During startup, this script will install FileBot if it is not already installed in this container.
2) Install the 'External Post-processor Script' Plugin
Open the plugin installer and install the plugin named 'External Post-processor Script'
3) Configure the 'External Post-processor Script' Plugin
Once installed, click on the 'External Post-processor Script' Plugin icon.
Click on Settings
4) Enable the 'External Post-processor Script' Plugin
In the Plugin table, enable the configured 'External Post-processor Script' Plugin
Plugin Config Examples
Here are some examples of what FileBot can be used for in an Unmanic Post-process...
References:
Rename TV Shows with the correct codec in the file name:
Run the command for each output file created by Unmanic
True
Command or script to execute:
filebot
Arguments to pass to the command or script:
--conflict skip
-non-strict
--db TheMovieDB::TV
-rename "{output_file_path}"
--format "{n.upperInitial().space('.')}-{s00e00}-{t.upperInitial().space('.')}-{source}-{vf}-{vc}"