Add PLEX_PUBLIC_URL for Play Now and "Open in Plex" links when PLEX_URL isn't reachable from devices - #33
Open
claude-on-call wants to merge 1 commit into
Open
Add PLEX_PUBLIC_URL for Play Now and "Open in Plex" links when PLEX_URL isn't reachable from devices#33claude-on-call wants to merge 1 commit into
claude-on-call wants to merge 1 commit into
Conversation
PLEX_URL is often Docker-internal (http://plex:32400) or a LAN IP. plexapi's playMedia hands that host to the player, and playlist links are built from it too, so phones away from home and browsers on other networks can't follow them. PLEX_PUBLIC_URL, when set, overrides the address given to players and the base of playlist links. Unset, nothing changes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PLEX_URLis the address MediaSage uses to reach Plex. In Docker setups that's often an internal hostname (http://plex:32400) or a LAN IP. The same URL is also used in two places where other devices need to reach Plex:playMediatells the player to fetch the play queue fromPLEX_URL's host and port. A phone can't resolveplex, and can't reach a LAN IP when it's away from home.{PLEX_URL}/web/..., which a browser can't open for the same reason.Change
A new optional
PLEX_PUBLIC_URL: the Plex URL as seen from browsers and players (e.g.https://plex.example.com). When it's set:play_queuepasses its protocol, address and port toplayMedia. plexapi merges**paramsinto the command, so these override the defaults.PLEX_URL.When it's unset, nothing changes. It's documented in the README env table,
.env.exampleanddocker-compose.yml.Testing
pytest: all tests pass.PLEX_URL=http://plex:32400, Plex published behind a reverse proxy), Play Now to Plexamp on a phone works withPLEX_PUBLIC_URLset. (I didn't test whether Plexamp would also have found the server some other way without it.)🤖 Generated with Claude Code