Coder Social home page Coder Social logo

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

View Code? Open in Web Editor NEW
39.0 4.0 6.0 70 KB

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

License: MIT License

Shell 5.46% Go 94.54%
access dyndns ipv6 plex remote script ddns

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

update-plex-ipv6-access-url

DynDNS-like tool 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 settings with plex.direct-domain using current IPv6 address

Command line arguments

If any required command line argument is omitted, the tool will prompt you to provide input at runtime.

Name Description Required Options Default
address Plex server's address in format http[s]://host:port Yes
interface Name of network interface to use for IPv6 access Yes
token Plex access token (X-Plex-Token) How to find If config is not given
config Path to Plex config (Preferences.xml) How to find No
use Which IPv6 address(es) to use if multiple are found on the interface No first last all first
capitalization Capitalization to use for dashed IPv6 address in Plex custom access URL No upper lower lower

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 -address http://localhost:32400 -interface ens18 -config "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Preferences.xml"

Plex does not store the config on disk on all platforms. On those platforms, you need to manually specify an access token, as it cannot be read from Preferences.xml.

.\update-plex-ipv6-access-url.exe -address http://localhost:32400 -interface Ethernet -token your-X-Plex-Token

To automate the process, create a cronjob or other type of scheduled task in order to run the script regularly.

For testing or one-time use, you can also run the tool without any command line arguments and provide required input at runtime.

$ ./update-plex-ipv6-access-url
Enter the Plex server's address in format 'http[s]://host:port': http://localhost:32400
Enter the name of network interface to use for IPv6 access: eth0
Enter a Plex access token (X-Plex-Token): your-X-Plex-Token

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

Contributors

cetteup avatar nadams5755 avatar renovate[bot] avatar rlandolt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

asdf
.tool-versions
  • golang 1.21.5
github-actions
.github/workflows/ci.yaml
  • actions/checkout v4
  • actions/setup-go v5
  • golangci/golangci-lint-action v3
  • actions/checkout v4
  • actions/setup-go v5
  • actions/cache v3
.github/workflows/release.yaml
  • actions/checkout v4
  • wangyoucao577/go-release-action v1.41
gomod
go.mod
  • go 1.21.5
  • github.com/go-playground/validator/v10 v10.16.0
  • github.com/rs/zerolog v1.31.0
  • github.com/stretchr/testify v1.8.4

  • Check this box to trigger a request for Renovate to run again on this repository

Feature Request: Docker Image with support for Docker Compose

Hello,

I have Plex running in a container on my NAS along with a bunch of other containers as well - since the official image is maintained by LinuxServers it takes quite a bit of effort to install the script in a worker image and modify it with the downside being that I lose upstream updates to the Plex container via Watchtower.

Will it be possible to publish a Docker image in a public registry that runs the update script as a cronjob on a lightweight container?

Here's a sample Dockerfile:

FROM ubuntu:latest

ENV PLEX_ADDRESS=
ENV PLEX_TOKEN=

RUN apt-get update

RUN apt-get install -y wget cron

RUN wget https://github.com/cetteup/update-plex-ipv6-access-url/releases/download/v0.1.0/update-plex-ipv6-access-url-v0.1.0-linux-arm64.tar.gz -O command.tar.gz 

RUN tar -xvf command.tar.gz

CMD crontab -l | { cat; echo "*/10 * * * * bash /root/update-plex-ipv6-access-url -address http://${PLEX_ADDRESS} -interface eth0 -token ${PLEX_TOKEN} > /dev/stdout"; } | crontab - && crontab -l && cron -f

Convert IPv6 characters to uppercase

I'm not sure if this is an issue for others, but on my plex server, if the IPv6 address portion of the custom server access URL isn't uppercase, my plex apps are not able to connect remotely.

For instance, my plex app fails to connect when the custom server access URL is formatted like this:
https://3210-488d-188f-5660-0000-0000-0000-9a52.f1c87d9690af4e0da1c2bfbf34b850fb.plex.direct:32400

But it works as expected when the URL is formatted like this:
https://3210-488D-188F-5660-0000-0000-0000-9A52.f1c87d9690af4e0da1c2bfbf34b850fb.plex.direct:32400

For reference, I am on Ubuntu 18.04 LTS using Plex Media Server version 1.40.0.7775

Option to select IPv6 temporary or secured

When I run an ifconfig, I have the following:
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=6460<TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM> ether 20:a5:cb:d1:b4:7f inet6 xxxx::xxx:xxxx:xxxx:42b2%en1 prefixlen 64 secured scopeid 0x12 inet 192.168.178.32 netmask 0xffffff00 broadcast 192.168.178.255 inet6 xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:a28a:683c prefixlen 64 autoconf secured inet6 xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:f523:d9cf prefixlen 64 autoconf temporary nd6 options=201<PERFORMNUD,DAD> media: autoselect status: active
My DDNS uses the temporary all the time, and this tool will use the secured (more permanent address). Would it be possible to add an option to select the temporary IPv6 over the secured?

CLI documentation request (arguments)

I'm using a plex server on my home network. My Internet connection is T-Mobile Home Internet 5G, which uses CG-NAT and does not offer port forwarding. However, it does offer ipv6 and uPnP. Therefore, I plan to use MiniuPnP CLI combined with this script to open the appropriate ipv6 inbound port and update Plex with the right ipv6 address.

It seems like this script is run with the following arguments:

  1. Network port
  2. Plex config file (?)

It also seems like you need to have initially entered a custom ipv6 URL in the Plex config.

Please excuse me - I gave it a cursory view but haven't delved deep into the script. Thanks for your efforts in figuring this out!

Help on windows

Apologies for this, but I was wondering how exactly you make sure this script runs periodically on windows, and also - where do you add in the new arguments to send it to the preferences XML. I'm trying to understand the readme, but I am horribly confused. Sorry.

Running Script on Windows, Device "" does not exist

image
Attempting to run the script, I am given this error saying that device "" does not exist. Attempting to run with arguments attempts to use the first argument as a device name and similarly fails. Not sure if there is an additional argument I need to use because I am on Windows or not.

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.