Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement] Accept plex servers invite #87

Open
that-9uy opened this issue Feb 26, 2025 · 1 comment
Open

[enhancement] Accept plex servers invite #87

that-9uy opened this issue Feb 26, 2025 · 1 comment

Comments

@that-9uy
Copy link

that-9uy commented Feb 26, 2025

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()****
@JasonLandbridge
Copy link
Collaborator

This is missing from the API spec but you're welcome to add this to the spec in a PR and then all SDK's will have it implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Open Issues
Development

No branches or pull requests

2 participants