fix: replace deprecated Plex v1 invite endpoints with v2 API for auto-accept#119
Merged
fix: replace deprecated Plex v1 invite endpoints with v2 API for auto-accept#119
Conversation
…-accept
plexapi 4.18's pendingInvites()/acceptInvite() call deprecated Plex v1
endpoints (/api/invites/requests) that now return 410 Gone. This caused
the auto-accept mechanism to silently fail, requiring users to manually
accept library invitations at plex.tv after OAuth redemption.
Replace the plexapi calls with direct HTTP requests to the Plex v2 API:
- GET /api/v2/shared_servers/invites/received/pending
- POST /api/v2/shared_servers/{id}/accept
Also add retry logic (3 attempts, 1s delay) for invite propagation,
enhance logging at info/warning levels, and include auto_accepted in
the share log event.
🤖 Augment PR SummarySummary: Updates Plex direct-share auto-accept to use Plex�s v2 invite APIs instead of plexapi�s deprecated v1 invite endpoints. Why: Plex�s v1 invite endpoints (used by plexapi 4.18 for pending/accept) now return Changes:
Technical Notes: The new flow executes in 🤖 Was this summary useful? React with 👍 or 👎 |
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.
Summary
/api/invites/requests, which now return 410 Gone) with direct HTTP calls to the Plex v2 API (/api/v2/shared_servers/invites/received/pendingand/api/v2/shared_servers/{id}/accept)shared_serversPOSTinfolevel for invite status,warninglevel for exceptions (previouslydebug), and includeauto_acceptedin theplex_library_shared_directlog eventContext
plexapi 4.18's
pendingInvites()andacceptInvite()use Plex v1 endpoints that Plex has retired (returns 410 Gone). The auto-accept block caught the resulting exception atdebuglevel and swallowed it, causing users to need manual acceptance at plex.tv after OAuth redemption.This is the same issue reported upstream in python-plexapi#1536, with a fix proposed in pushingkarmaorg/python-plexapi#1537 (still unmerged). The approach here mirrors how Wizarr solved the same problem.
Test plan
auto_accepted=Truein logs and immediate library access