Docker image that updates Sonarr-generated NFO files using TMDb localized metadata (title/overview).
3.2K
Translate the metadata of your TV shows into your language, for Jellyfin.
Sonarr writes its NFO files in English. This image rewrites the titles and plots of your series and episodes with localized metadata from TMDbโ , and can download localized artwork (poster, backdrop, logo, episode thumbnails) with Jellyfin-friendly file names.
It works instantly through a Sonarr webhook, and with a scheduled scan of your whole library as a safety net.
.bak), cleaned up automatically after 7 dayslinux/amd64 and linux/arm64tvshow.nfo, which provides the TMDb ID of the series.tvshow.nfo: the plot, and optionally the title;.nfo: the title and plot, when the episode number can be read from the file name (S01E02, 1x02).*.bak).| File | Content |
|---|---|
cover.jpg / poster.jpg | Series poster (same image) |
backdrop.jpg | Series background |
logo.png | Series logo, if available |
<episode>-thumb.jpg | Episode thumbnail, next to its .nfo |
Images that were already downloaded are not downloaded again (tracked in .tmdb-art-state.json in each series folder).
You need a free TMDb API key: themoviedb.org/settings/apiโ .
services:
sonarr-metadata-localizer:
image: waazaafr/sonarr-metadata-localizer:latest
container_name: sonarr-metadata-localizer
restart: unless-stopped
ports:
- "8787:8787"
environment:
TZ: "Europe/Paris"
TMDB_API_KEY: "your-tmdb-api-key"
AUTH_TOKEN: "a-long-random-secret"
TMDB_LANGUAGE: "fr-FR"
TMDB_IMAGE_LANGUAGE: "fr,null"
SONARR_ROOT_FOLDER: "/tv"
volumes:
# Must be the SAME path as your series folder inside Sonarr (e.g. /tv)
- /your/series/folder:/tv:rw
โ ๏ธ The series path must be identical in Sonarr and in this container. The webhook receives the series path as Sonarr sees it (e.g.
/tv/My Show), and looks for it inside this container.
In Sonarr, go to Settings โ Connect โ + โ Webhook:
| Field | Value |
|---|---|
| Triggers | On Import, On Upgrade, On Rename, On Series Add |
| URL | http://<container-ip>:8787/sonarr |
| Method | POST |
| Headers | X-Auth-Token = the value of AUTH_TOKEN |
Click Test: Sonarr should report a success.
๐ Set
AUTH_TOKENand theX-Auth-Tokenheader: withoutAUTH_TOKEN, anyone who can reach the port can trigger the webhook.
What happens when Sonarr calls the webhook:
DEBOUNCE_SECONDS (30 s): importing a full season updates the series once.tvshow.nfo and the .nfo of the imported episodes before updating them.Download events, so they are handled too.A health endpoint is available at http://<container-ip>:8787/health.
| Variable | Default | Description |
|---|---|---|
TMDB_API_KEY | โ | Required (or TMDB_BEARER_TOKEN): TMDb v3 API key |
TMDB_BEARER_TOKEN | โ | Alternative to the API key: TMDb read access token |
TMDB_LANGUAGE | fr-FR | Language of titles and plots (fr-FR, en-US, es-ESโฆ) |
TMDB_IMAGE_LANGUAGE | fr,null | Preferred image languages, in order (null = images without text) |
SKIP_EMPTY | true | Keep the existing text when TMDb has no translation |
UPDATE_SHOW_TITLE | false | Also replace the series title in tvshow.nfo |
SLEEP_BETWEEN_REQUESTS | 0.25 | Pause between TMDb requests, in seconds |
HTTP_TIMEOUT | 25 | Timeout of HTTP requests, in seconds |
| Variable | Default | Description |
|---|---|---|
DOWNLOAD_IMAGES | true | Download series artwork and episode thumbnails |
SERIES_COVER_NAME | cover.jpg | File name of the series poster |
SERIES_POSTER_NAME | poster.jpg | File name of the copy of the poster |
SERIES_BACKDROP_NAME | backdrop.jpg | File name of the background |
SERIES_LOGO_NAME | logo.png | File name of the logo |
| Variable | Default | Description |
|---|---|---|
SONARR_ROOT_FOLDER | /tv | Root folder of your series inside the container |
CRON_CHECK_INTERVAL | 0 */8 * * * | When the whole library is scanned (cron syntax) |
CRON_BAK_CLEANUP | 15 4 * * * | When .bak files older than 7 days are deleted (cron syntax) |
TZ | Europe/Paris | Time zone used by the schedules |
A scan never starts while the previous one is still running.
| Variable | Default | Description |
|---|---|---|
PORT | 8787 | Listening port |
AUTH_TOKEN | โ | Secret expected in the X-Auth-Token header (recommended) |
ALLOWED_EVENT_TYPES | Download,Rename,SeriesAdd | Sonarr events that trigger an update |
DEBOUNCE_SECONDS | 30 | Delay used to group the events of a same series |
WAIT_FOR_EPISODE_NFO_SECONDS | 120 | How long to wait for Sonarr to write the .nfo of imported episodes |
WAIT_FOR_TVSHOWNFO_SECONDS | 60 | How long to wait for Sonarr to write tvshow.nfo |
WAIT_POLL_INTERVAL | 2 | Check interval while waiting, in seconds |
MAX_RETRIES | 3 | Retries when tvshow.nfo is still missing |
RETRY_BACKOFF_SECONDS | 20 | Delay between retries, increased at each retry |
WORKERS | 4 | Number of series processed in parallel |
QUEUE_MAX | 500 | Maximum number of series waiting to be processed |
DRY_RUN | false | Log the changes without writing any file (webhook only) |
LOG_LEVEL | INFO | DEBUG, INFO, WARNING or ERROR |
linux/amd64 and linux/arm64.DEBOUNCE_SECONDS), so a season import updates the series once instead of once per episode..nfo of imported episodes (WAIT_FOR_EPISODE_NFO_SECONDS), which Sonarr may write after calling the webhook.ALLOWED_EVENT_TYPES now defaults to Download,Rename,SeriesAdd (Upgrade and SeriesEdit are not sent by Sonarr; upgrades arrive as Download)..bak before the first change.S2024E05) are now recognized.Content type
Image
Digest
sha256:c7a45d962โฆ
Size
61.4 MB
Last updated
1 day ago
docker pull waazaafr/sonarr-metadata-localizer