Giter Site home page Giter Site logo

svnstfns / update-plex-ipv6-access-url Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cetteup/update-plex-ipv6-access-url

0.0 0.0 0.0 12 KB

DynDNS-like script for keeping your Plex IPv6 custom access URL up to date

License: MIT License

Shell 100.00%

update-plex-ipv6-access-url's Introduction

update-plex-ipv6-access-url

DynDNS-like script for keeping your Plex IPv6 custom access URL up to date, automating the IPv6 workaround for Plex as described on Reddit.

Features

  • determine IPv6 address for a specified interface
  • update Plex config with plex.direct-domain using current IPv6 address
  • restart Plex service

Prerequisite

You need to initially add a custom server access URL manually, which the script will then keep up to date. Here's how you can easily find everything you need:

  1. Navigate to any media item in your library as the admin user
  2. Click ... (More) next to the edit pen to see more options
  3. Click "Get Info" at the very bottom of the list
  4. At the bottom right of the "Media info" dialogue, click "View XML"
  5. Take note of the domain in the new tab, you should something like https://[some-ip-address].[server-id].plex.direct:32400/
  6. Determine your server's current IPv6 address (either directly from the server or via your router)
  7. Expand the IPv6 address to it's uncompressed/full state (using a tool like this one, which turns a shortened IPv6 such as 2606:4700::6810:84e5 into 2606:4700:0000:0000:0000:0000:6810:84e5)
  8. Replace all colons in the expanded IPv6 address with dashes
  9. Put everything together as https://["dashed"-ipv6-address].[serverid].plex.direct:32400/ the "dashed" IPv6
  10. Add the url as a "Custom server access URL" in your Plex server settings unter "Network"

If you are unsure where to find the "Media info" dialogue in order to get your server id, follow this Plex support article.

Example:

IPv6 address reported by server: 2606:4700::6810:84e5

Expanded IPv6 address: 2606:4700:0000:0000:0000:0000:6810:84e5

Custom server access URL to add: https://2606-4700-0000-0000-0000-0000-6810-84e5.055e11e51095c8b4f16c572691ff8113.plex.direct:32400/

Setup

In order to use the script, you just need to download it. However, if you want it to automatically restart the Plex service in case the IPv6 address changed, you need to either comment out or add a command to restart the service (depending on your host OS).

Command line arguments

The script requires two positional arguments:

Position Description Required
1 Name of network interface to use for IPv6 access Yes
2 Path to Plex config (Preferences.xml) Yes

If you are unsure where to find your Plex data directory (which contains the Preferences.xml), please refer to this Plex support article.

Usage

A simple example: You are running Plex on an Ubuntu server and set Plex up to listen on the ens18 interface. Your Plex library resides in the default location, which is /var/lib/plexmediaserver/Library/Application Support/Plex Media Server. Assuming you are currently in the directory you placed the script in, you would run the script like so:

./update-plex-ipv6-access-url.sh ens18 "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Preferences.xml"

Please note: You need to either quote the path to the config or escape the contained spaces.

In order to automate the process, create a cronjob or other type of scheduled task in order to run the script regularly. Just keep in mind that your Plex server will be unavailable for a few seconds when the script restarts the Plex service after an IPv6 address change, so choose times to run the script accordingly.

update-plex-ipv6-access-url's People

Contributors

cetteup avatar nadams5755 avatar rlandolt avatar

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.