Plex NFO Exporter is a script that extracts metadata, posters, and background art from Plex and generates compatible files for use with other media servers like Jellyfin.
- Extract media metadata from Plex into
.nfo
files. - Multiple naming formats to export to i.e. poster as
poster.jpg
or{filename}_poster.jpg
. - Save files in the media directory for easy use with other media servers.
- Does not refresh Plex library metadata during the export process.
- Flexible options:
- Choose what metadata to export (e.g., title, tagline, plot, year, etc.).
- Select specific libraries to process.
- Export all metadata from Plex if needed.
- Support for path mapping between separate Plex and library servers.
- Compatible with movies, TV shows, and music libraries.
- Supports Plex's latest movie and TV agents, as well as Hama agent.
- Supports multiple movie titles in one directory.
Run the Plex NFO Exporter using the official Docker image:
docker run --rm \
-v /path/to/config:/app/config \
-v /path/to/config/logs:/app/logs \
-v /path/to/media:/media \
-e TZ=Asia/Jakarta \
-e CRON_SCHEDULE=0 4 * * * \
-e RUN_IMMEDIATELY=false \
-e PLEX_URL='http://plex_ip:port' \
-e PLEX_TOKEN='super-secret-token' \
ghcr.io/van-geaux/plex_nfo_exporter:latest
After first deployment, fill the generated config.yml
and .env
before restarting it again.
.env
file will only be generated if you are not using PLEX_URL
and PLEX_TOKEN
environment variables
For the .env
, fill it with:
PLEX_URL='http://plex_ip:plex_port' # i.e. http://192.168.1.2:32400 or https://plex.yourdomain.tld if using proxy
PLEX_TOKEN='super-scecret-token'
services:
plex-nfo-exporter:
image: ghcr.io/van-geaux/plex_nfo_exporter:latest
environment:
- TZ=Asia/Jakarta
- CRON_SCHEDULE=0 4 * * * # if not set will default to 4AM everyday
- RUN_IMMEDIATELY=false # if true will run immediately at start regardless of cron
- PLEX_URL='http://plex_ip:port' # optional, you need to set in config.yml otherwise
- PLEX_TOKEN='super-secret-token' # optional, you need to set in config.yml otherwise
volumes:
- /path/to/config:/app/config
- /path/to/config/logs:/app/logs # optional, you need to create the logs folder if you want to mount it
- /volume1/data/media:/data_media # left side local path, right side plex path. YOU NEED TO SET THIS EVEN IF BOTH ARE THE SAME
After first deployment, fill the generated config.yml
and .env
before restarting it again.
.env
file will only be generated if you are not using PLEX_URL
and PLEX_TOKEN
environment variables
For the .env
, fill it with:
PLEX_URL='http://plex_ip:plex_port' # i.e. http://192.168.1.2:32400 or https://plex.yourdomain.tld if using proxy
PLEX_TOKEN='super-scecret-token'
To build and run the image from the source code, follow these steps:
-
Clone the Repository
git clone https://github.com/van-geaux/plex_nfo_exporter.git
cd plex_nfo_exporter
-
Build the Docker Image
docker build -t plex_nfo_exporter:latest .
-
Run the Custom Image
docker run --rm \ -v /path/to/config:/app/config \ -v /path/to/config/logs:/app/logs \ -v /path/to/media:/media \ -e TZ=Asia/Jakarta \ -e CRON_SCHEDULE=0 4 * * * \ -e RUN_IMMEDIATELY=false \ -e PLEX_URL='http://plex_ip:port' \ -e PLEX_TOKEN='super-secret-token' \ ghcr.io/van-geaux/plex_nfo_exporter:latest
After first deployment, fill the generated config.yml
and .env
before restarting it again.
.env
file will only be generated if you are not using PLEX_URL
and PLEX_TOKEN
environment variables
For the .env
, fill it with:
PLEX_URL='http://plex_ip:plex_port' # i.e. http://192.168.1.2:32400 or https://plex.yourdomain.tld if using proxy
PLEX_TOKEN='super-scecret-token'
-
Download and Prepare the Script
Clone or download the repository, ensuring the following files are included:config.yml
(will create if not exists).env
(will create if not exists)main.py
requirements.txt
-
Configure the Script
Editconfig.yml
and.env
to include your desired settings and credentials. -
Install Python
Install Python (tested with Python 3.9–3.11). -
Set Up the Environment
Open a terminal and navigate to the script directory:cd /your_directory/plex_nfo_exporter
(Optional) Create and activate a virtual environment:
python -m venv env env\Scripts\activate # Windows source env/bin/activate # macOS/Linux
-
Install Dependencies Install the required Python packages:
pip install -r requirements.txt
-
Run the Script Execute the script:
python main.py
-
Supported Plex Agents
- Compatible with Plex's new TV and movie agents.
- Detects Hama agent and other agents to set metadata source IDs accordingly.
-
Metadata Export Options
- Choose specific metadata fields to export.
- Defaults include title, tagline, plot, year, and metadata agent IDs.
-
File Organization
- Saves .nfo files as movie.nfo, tvshow.nfo, artist.nfo, album.nfo or other naming schemes as needed.
- Exports active poster and fanart images as poster.jpg and fanart.jpg.
-
Sync Across Servers
- Ensures that Plex and Jellyfin display the same library metadata, images, and media names.
-
Docker Image
- Docker image available at
ghcr.io/van-geaux/plex_nfo_exporter:latest
.
- Docker image available at
-
About Me:
I'm not a developer by trade, but I manage Plex and Jellyfin to enjoy both convenience and flexibility.
My primary library is anime in Plex using the Hama agent with romaji names. -
Why This Script?
I needed a tool to sync Plex and Jellyfin libraries, especially for anime with custom posters and art.
Existing tools either require a full library refresh (e.g., Lambda) or work in reverse (e.g., XBMC Importer). -
Kometa Integration:
I use Kometa to beautify posters, which works perfectly with this script.
- Enhance compatibility with more media servers.
Feel free to open an issue or submit a pull request for improvements or feature requests.