April 23Apr 23 This tool, developed in Python and then packaged as a standalone binary with PyInstaller, is designed to analyze a TV series directory whose .nfo metadata files were generated by Sonarr. Its purpose is to read these metadata files and use the TMDB API to automatically replace the contents of the <title> and <plot> tags in the language of your choice.Optionally, the program can also retrieve localized images in that same language when they are available on TMDB. It therefore makes it possible to fully relocalize the textual metadata, and potentially the visual assets as well, of a TV series library already structured by Sonarr.Download and installwget https://codeberg.org/waazaa/unraid-packages/raw/branch/main/sonarr-nfo-localizer/sonarr-nfo-localizer-Unraid.txz && installpkg sonarr-nfo-localizer-Unraid.txzThis package contains a binary built with PyInstaller from the following Python script:https://codeberg.org/waazaa/sonarr-metadata-localizer/src/branch/main/root/app/nfo_jellyfin.pyThis makes it possible to avoid installing dependencies such as a Python environment.How it worksOnce the package is installed, you can access the sonarr-nfo-localizer application and use it as follows.First, create a configuration file, for example .env, containing the environment variables below. You can then adjust each value to match your needs:export TMDB_API_KEY=27xxxxxxxxxxxxxxxxxxxcexport TMDB_LANGUAGE=fr-FRexport TMDB_IMAGE_LANGUAGE=fr,nullexport DOWNLOAD_IMAGES=trueexport SKIP_EMPTY=trueexport UPDATE_SHOW_TITLE=falseexport SERIES_COVER_NAME=cover.jpgexport SERIES_POSTER_NAME=poster.jpgexport SERIES_BACKDROP_NAME=backdrop.jpgexport SERIES_LOGO_NAME=logo.pngexport SLEEP_BETWEEN_REQUESTS=0.25export HTTP_TIMEOUT=25Variable descriptionTMDB_API_KEY: Your TMDB API key, required to query TMDB.TMDB_LANGUAGE: The language to use for textual metadata retrieved from TMDB, such as titles and plots. Example: fr-FRTMDB_IMAGE_LANGUAGE: The preferred language for localized images. The value fr,null means the tool will first look for French images, then fall back to images without a specified language if none are available.DOWNLOAD_IMAGES: Enables or disables image downloading. Set it to true to download localized images, or false to skip them.SKIP_EMPTY: If set to true, the tool will avoid replacing existing fields with empty values returned by TMDB.UPDATE_SHOW_TITLE: If set to true, the series title will also be updated. If set to false, the existing title will be kept unchanged.SERIES_COVER_NAME: Output filename to use for the series cover image.SERIES_POSTER_NAME: Output filename to use for the series poster image.SERIES_BACKDROP_NAME: Output filename to use for the series backdrop image.SERIES_LOGO_NAME: Output filename to use for the series logo image.SLEEP_BETWEEN_REQUESTS: Delay, in seconds, inserted between API requests in order to avoid hitting TMDB too aggressively.HTTP_TIMEOUT: Maximum HTTP timeout, in seconds, for API and image download requests.Running the commandOnce your configuration file is ready, launch the tool with:source .env && sonarr-nfo-localizer /path/to/tvshowsThis command loads the environment variables from the .env file and then runs sonarr-nfo-localizer against the target directory containing your TV shows.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.