• Stars
    star
    303
  • Rank 137,655 (Top 3 %)
  • Language
    JavaScript
  • License
    Other
  • Created over 8 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🎬 Command line utility for synchronizing Plex Media Server watched / seen status between multiple servers

plex-sync

A simple command-line utility to synchronize watched / seen status between different Plex Media Servers.

npm Travis Dependencies Greenkeeper badge MIT license

asciicast

Features

  • Syncs watch status between different Plex servers.

Requirements

  • NodeJS 4+

Installation

plex-sync is installed via NPM:

$ npm install -g plex-sync

Usage

There are several available configuration environment variables:

Variable Description
PLEX_TOKEN The API token used to access your Plex server. To locate this token, follow the instructions here, or use this bookmarklet. The Plex token must be set on the arguments or via the environment variable.
DRY_RUN Set this environment variable to make plex-sync print out what it was planning to do rather than actually perform the synchronization.
MATCH_TYPE Can be either fuzzy (default) or precise. When the matching is fuzzy, the script will match items by their year and title. When the matching is precise, the script matches items by their internal Plex GUID, which is usually the IMDb or TMDb ID. This requires an individual API request to be performed for each item (each movie, each TV episode, etc.) and thus is very slow and can potentially overwhelm and crash the Plex server. Use at your own risk.
RATE_LIMIT Default 5. If the MATCH_TYPE is set to precise, this is the maximum number of concurrent API requests plex-sync will make to your server to fetch GUIDs. Use this to (potentially) alleviate performance issues with precise matching.

First, find the IDs for the libraries on each server you would like to sync. These IDs can be found at the end of the URL when viewing the library in your browser (like .../section/ID).

Next, use the CLI as follows:

$ plex-sync [https://][token@]IP[:PORT]/SECTION[,rw] [https://][token@]IP[:PORT]/SECTION[,rw]
            [[https://][token@]IP[:PORT]/SECTION[,rw]...]

Examples

Sync watched status between two servers, using the default port (32400), using library ID 1 for the first server and library 3 for the second:

$ plex-sync 10.0.1.5/1 10.0.1.10/3

Sync three servers, with different ports:

$ plex-sync 10.0.1.5:32401/1 10.0.1.5:32402/1 10.0.1.10/3

Sync with a server via HTTPS:

$ plex-sync 10.0.1.2/2 https://server-domain/3

Dry run, to see what the script will do:

$ DRY_RUN=1 plex-sync 10.0.1.5/1 10.0.1.5/1

Precise matching (slow and may crash the Plex server):

$ MATCH_TYPE=precise plex-sync 10.0.1.5/1 10.0.1.5/1

Syncing between multiple Plex users (different access tokens):

Unidirectional sync (read from one server, write to the other):

$ plex-sync 10.0.1.5/1,r 10.0.1.10/3,w

Complex use case:

$ plex-sync [email protected]:32401/1,r https://[email protected]/3,w [email protected]/2,rw

For more complex strategies, like syncing between multiple different library mappings, just run the tool multiple times. If you need to run the synchronization on a schedule, use another scheduling tool like cron. These more advanced features may be added in the future, but currently plex-sync is very simple.

Contributing

Contributions are welcome. Open a pull request or issue to contribute.

License

MIT license. See LICENSE for more information.

More Repositories

1

heroku-minecraft

πŸ’Ž run a Minecraft server on Heroku
CoffeeScript
88
star
2

dotfiles

🏠 dotfile configuration for macOS and Linux
Shell
46
star
3

elastic-ts

TypeScript + Elasticsearch + magic ✨
TypeScript
36
star
4

halfstaff

πŸ‡ΊπŸ‡Έ Is the US flag at half-staff?
Ruby
22
star
5

fast-case

⚑Fast camelCase and PascalCase string and key conversion for JavaScript (Node / browser)
JavaScript
18
star
6

git-sync

πŸ—‘οΈ git-sync to fast-forward outdated branches and remove merged and deleted upstream branches
Go
17
star
7

heroku-buildpack-caddy

Heroku buildpack to install Caddy, the fast, cross-platform HTTP/2 web server with automatic HTTPS
Shell
11
star
8

run

🦊 A small utility for running package.json scripts and npm modules.
Go
8
star
9

saved-for-later

🌐 A linkblog, from Jacob
TypeScript
8
star
10

psk31

πŸ“» Experiment encoding and decoding PSK31 with the Web Audio API
JavaScript
7
star
11

zap

⚑ A lightweight HTTP server framework for Node.
TypeScript
6
star
12

the-environment

🌱 Simple Node.js package for environment variables
TypeScript
4
star
13

vscode-minimal-icons

Minimal icon theme for VS Code
4
star
14

b64u

⚑Tiny, lightweight module for encoding and decoding Base64 URLs
JavaScript
3
star
15

tf

⚑ Fast Terraform version wrapper
Go
3
star
16

kubernetes-health

πŸ₯ Helper library for implementing Kubernetes heath checks and graceful HTTP shutdown in Node applications.
TypeScript
3
star
17

www

🏠 my online home
JavaScript
3
star
18

linter-flowtype

Lightweight Atom editor extension for flow linting, autocomplete, outline, and hyperclick
JavaScript
3
star
19

hydrographer

Generate Helm charts with JavaScript
TypeScript
2
star
20

aoc

TypeScript
2
star
21

bpsk31

πŸ’» Website about PSK31, the Amateur Radio digital operating mode
CSS
1
star
22

jacobwgillespie

✨
1
star
23

language-hocon

HOCON syntax highlighting for Atom
1
star
24

archive

🏦 Archive of older repositories
JavaScript
1
star
25

homebrew-tap

Ruby
1
star
26

startpage

Custom new tab page
JavaScript
1
star
27

lang

Experiment designing a (nonexistent) programming language
C
1
star
28

build-test

Dockerfile
1
star