npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

plex-sync

v0.6.1

Published

Sync watched status between Plex servers

Downloads

38

Readme

plex-sync

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

npm Travis Dependencies 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):

$ plex-sync [email protected]/1 [email protected]/3

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.