Giter Site home page Giter Site logo

estallio / plex-metadata-exporter Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 3.0 8 KB

Saves json and xml metadata as well as cover and art of movies alongside the files in a plex library.

License: MIT License

JavaScript 81.29% Shell 13.09% Dockerfile 5.61%
plex plex-media-server plex-library plex-api exporter nodejs

plex-metadata-exporter's Introduction

Plex Metadata Exporter

What does it?

Saves json and xml metadata as well as cover and art of movies and shows alongside the files in the plex library.

Why is this necessary?

If you've changed many titles, covers and descriptions in your library you want to back up these data alongside the files so that the changes are not only saved in the Plex database. The current solutions ExportTools.bundle and Lambda.bundle didn't fit my needs when i wanted to archive my whole library.

How to use

Clone this repo and navigate in the cloned folder, then run:

cd app
npm install
npm run start

Alternatively, you can also use the Docker image, which saves the whole library at a regular basis - once a week on monday at 05:00 am by default. The basic usage can be seen in the sample docker-compose file. The docker-compose file also provides example commands for running the whole export only once or clean up all files.

Configuration

For running the app manually, just rename or copy the .env.example file to .env and edit the following configs:

# IP or domain and port of the plex server, it is also possible to use the Plex-domain
PLEX_ADDRESS=https://IP:PORT

Example 1: PLEX_ADDRESS=https://192.168.0.2:32400
Example 2: PLEX_ADDRESS=https://192-168-0-2.asfj3940580sdfjkl489sfd345mlf.plex.direct:32400
this url resolves also to your local IP and is also as safe as the plex software or DigiCert is.
See here for more info on how they do this: https://blog.filippo.io/how-plex-is-doing-https-for-all-its-users/
There could be 2 issues I can think of:
1. Plex is resolving to a different IP - you would recognize that case, however, as you run the Plex software, there is some trust in Plex anyways
2. Someone in the network sniffing the DNS requests knows that you run a "private" Plex server on the mentioned IP address in the local network or on a public instance:
    2.1. Someone starts an attack if it's a public IP - that could happen in any case, but when using the DNS, there is a exclusive offering for an attacker to know the software (Plex) and maybe the port
    2.2. Someone knows for sure you run a Plex server in your local area network and can track you back in your home, even it is not illegal to run your Plex server, these could be however relevant infos

# a Plex authentication token, look here how to get one: https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token
X_PLEX_TOKEN=sOmEpL3XT0k3n1234

# it is possible that the root path of the plex server
# is different from the root path running this script
# possible scenarios are running this script in relation
# to a remote server or a docker-container
PLEX_ROOT_FOLDER=/absolute/path/to/the/media

# will be appended to the media-filename before the extension
# e.g. mkvOrMP4FileName-meta_data_naming_scheme.json
# this is especially useful when you want to remove all the meta data at a later point - see below
FILE_ENDING_PATTERN=meta_data_naming_scheme

Clean up

To remove all generated files, you can utilize the find command:

find . -name '*-FILE_ENDING_PATTERN.json' -type f -delete
find . -name '*-FILE_ENDING_PATTERN.xml' -type f -delete
find . -name '*-FILE_ENDING_PATTERN-art.jpg' -type f -delete
find . -name '*-FILE_ENDING_PATTERN-thumb.jpg' -type f -delete

With the FILE_ENDING_PATTERN from the .example.env file:

find . -name '*-meta_data_naming_scheme.json' -type f -delete
find . -name '*-meta_data_naming_scheme.xml' -type f -delete
find . -name '*-meta_data_naming_scheme-art.jpg' -type f -delete
find . -name '*-meta_data_naming_scheme-thumb.jpg' -type f -delete

plex-metadata-exporter's People

Contributors

estallio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

plex-metadata-exporter's Issues

Resume point to prevent restart from beginning of libraries

Loving the idea and approach, have been trying to find something for this purpose for a number of years.

Now it may because of the shear size of my libraries but I'm finding that if the script hits any errors it goes back to the beginning of the first library and with a big library this not ideal.

I think a some form of resume point tracking would be good.

Also currently it seems to replace all items on every run which again in a large library is a heavy on disk and if you happen to be replicating the library to other nodes (resilio sync), hits the network as well.

Run once for all libraries?

The docker instructions seem to show that I need to run it once per library, is this correct or am I missing something, is there a way to run it once but for all libraries? If not, could there be?

Thanks, just getting started looking at it but it looks really nice.

bin/node is not found (truenas core)

Hey is there any way I can run this with Plex installed on TrueNAS/FreeNAS? I just want to copy the metadata and images to the data folders, I don't get why Plex made it so hard not to lol

When I run run_once.sh it tells me the path for node isn't found.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.