Open
Description
I would like to accept my plex servers invite on users behalf, I can currently do this with python-plexapi using acceptInvite.
And call it like this to accept users invite
def accept_plex_invitation(token: str, server_api_key: Optional[str] = None, server_url: Optional[str] = None):
"""Accept a Plex invitation
:param token: The token of the invitation
:type token: str
:param server_api_key: The API key of the Plex server
:type server_api_key: Optional[str] - If not provided, will get from database.
:param server_url: The URL of the Plex server
:type server_url: Optional[str] - If not provided, will get from database.
:return: None
"""
# Get the PlexServer object
plex = get_plex_server(server_api_key=server_api_key, server_url=server_url)
# Get my account from Plex and email
my_account = plex.myPlexAccount()
# Get plex account for the user
plex_account = MyPlexAccount(token=token)
# Accept the invitation and enable sync
plex_account.acceptInvite(my_account.email)
plex_account.enableViewStateSync()****
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
Open Issues