Skip to content

lufinkey/pseuplex

Repository files navigation

Pseudo Metadata Proxy for Plex

A middleware proxy for the plex server API. This sits in between the plex client and the plex server, forwarding requests and modifying responses to add some extra features.

Inspired by Replex

This project is still very much a WIP and it is not recommended to enable remote access yet.

Features

  • Similar Films on Letterboxd

    Instead of only showing related movies from your server, you can show the list of similar movies from letterboxd

    Similar Films on Letterboxd

    For movies that aren't available on your server, the "unavailable" status will appear on the film page.

    Unavailable

    Note: The unavailable status will not show on the Roku client or any other client that doesn't subscribe to the plex server websocket.

  • Letterboxd Friends Activity

    Activity from your letterboxd friends can be displayed on the server home page. Different users on your server can be configured to display their own friend feeds.

    Letterboxd Friends Activity Feed

  • Letterboxd Friends Reviews

    Reviews from your letterboxd friends can be included alongside the RottenTomatoes reviews

    Letterboxd Friends Reviews

Setup

SSL

You will need to use your own SSL certificate for your plex server in order for this proxy to modify requests over HTTPS. Otherwise, it will only work over HTTP, or it will fallback to the plex server's true address instead of the proxy address.

Configuration

Create a config.json file with the following structure, and fill in the configuration for your setup:

{
	"port": 32397,
	"plex": {
		"host": "http://127.0.0.1:32400",
		"token": "<PLEX API TOKEN>"
	},
	"ssl": {
		"keyPath": "/etc/pseudo_plex_proxy/ssl_cert.key",
		"certPath": "/etc/pseudo_plex_proxy/ssl_cert.crt"
	},
	"perUser": {
		"[email protected]": {
			"letterboxdUsername": "<LETTERBOXD USERNAME>"
		}
	}
}
  • protocol: The server protocol. Either http, https, or http+https (default is http+https)
  • port: The port that this proxy will run on.
  • plex
    • host: The url of your plex server.
    • token: The plex API token of the server owner.
    • appDataPath: (optional) Manually specify the path of your plex server's appdata folder if it's in an unconventional place. On Linux, this is typically /var/lib/plexmediaserver/Library/Application Support/Plex Media Server unless you're running via docker. This will be used to determine the path of the SSL certificate if ssl.autoP12Path is true. This will also be used to determine the path of Preferences.xml if ssl.autoP12Password is true.
  • ssl
    • p12Path: The path to your SSL p12 file.
    • p12Password: The password to decrypt your SSL p12 file.
    • keyPath: The path to your SSL private key. This is ignored if ssl.p12Path is set or ssl.autoP12Path is true.
    • certPath: The path to your SSL certificate. This is ignored if ssl.p12Path is set or ssl.autoP12Path is true.
    • autoP12Path: Automatically locate and use your plex server's SSL p12 file (if it's installed on the same system in a conventional location).
    • autoP12Password: Automatically determine the password of your plex server's SSL p12 file.
    • watchCertChanges: Automatically reload the SSL certificate/key whenever your cert/key/p12 file changes
    • certReloadDelay: The time in milliseconds to wait after your cert/key/p12 file changes before reloading SSL (if ssl.watchCertChanges is true). Default is 1000.
  • perUser: A map of settings to configure for each user on your server. The map keys are the plex email for each user.
    • letterboxdUsername: The letterboxd username for this user
    • letterboxdSimilarItemsEnabled: Display similar items from letterboxd on plex media item pages for this user
    • letterboxdFriendsActivityHubEnabled: Display the letterboxd friends activity hub on the home page for this user
    • letterboxdFriendsReviewsEnabled: Display letterboxd friends reviews for this user
  • letterboxdSimilarItemsEnabled: Display similar items from letterboxd on plex media item pages for all users
  • letterboxdFriendsActivityHubEnabled: Display the letterboxd friends activity hub on the home page for all users
  • letterboxdFriendsReviewsEnabled: Display letterboxd friends reviews for all users

Network Settings

If you have generated your own SSL certificate, configure your server's Network settings to use it. You don't need to set these settings if using ssl.autoP12Path and ssl.autoP12Password in your config.

Plex SSL Prefs

In the Custom server access URLs field, put the URLs of your proxy server, separated by commas.

Plex Server URLs

If you are using your plex server's default certificate (ie ssl.autoP12Path and ssl.autoP12Password in your config), you may need to manually add the automatic domains for your plex server here instead.

Plex Server Default URLs

Ensure Enable local network discovery (GDM) and Enable Relay are both unchecked, and then save the changes to your server's network settings.

At this point, your plex server might not show up on app.plex.tv until you start the proxy server, but you should still be able to access it via its local ip.

Local Access

If you're using a custom domain name for your SSL certificate, you can hardcode the DNS entry mapping on your home router (or pihole if you have it). This way your domain will always resolve to the local ip when accessing via your local network (ie: map yourdomain.com to 192.168.1.123 or whatever the local IP of your proxy server is).

If you're having issues getting clients to connect through the proxy, try setting a firewall rule to disallow connections directly to your plex server. Alternatively, you can run Plex inside of docker, and set the external port to anything other than 32400.

Remote Access

If you want to enable the proxy for remote access, you'll just need to port forward your proxy server instead of your plex server.

Running

To run, cd into this repo's folder in terminal and run the following commands, replacing the config.json path with your own:

npm install
npm start -- --config="/path/to/config.json"

About

A middleware for the plex server API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published