@ctrl/plex
    Preparing search index...

    Class MyPlexAccount

    MyPlex account and profile information. This object represents the data found Account on the myplex.tv servers at the url https://plex.tv/users/account. You may create this object directly by passing in your username & password (or token). There is also a convenience method provided at :class:~plexapi.server.PlexServer.myPlexAccount() which will create and return this object.

    Index

    Constructors

    • Parameters

      • baseUrl: string = null
      • Optionalusername: string

        Your MyPlex username

      • Optionalpassword: string

        Your MyPlex password

      • Optionaltoken: string

        Token used to access this client.

      • timeout: number = TIMEOUT

        timeout in seconds on initial connect to myplex

      • Optionalserver: PlexServer

        not often available

      Returns MyPlexAccount

    Properties

    authenticationToken?: string

    auth token for user by plex

    baseUrl: string = null
    certificateVersion?: number

    Unknown

    email?: string

    Your current Plex email address

    entitlements?: string[]

    List of devices your allowed to use with this account

    EXISTINGUSER: string = 'https://plex.tv/api/home/users?invitedEmail={username}'
    FRIENDINVITE: string = 'https://plex.tv/api/servers/{machineId}/shared_servers'
    FRIENDSERVERS: string = 'https://plex.tv/api/servers/{machineId}/shared_servers/{serverId}'
    FRIENDUPDATE: string = 'https://plex.tv/api/friends/{userId}'
    guest?: boolean

    Unknown

    home?: boolean

    Unknown

    homeSize?: number

    Unknown

    HOMEUSERCREATE: string = 'https://plex.tv/api/home/users?title={title}'
    id?: number

    Your Plex account ID

    locale?: string

    Your Plex locale

    mailingListActive?: boolean
    mailingListStatus?: "active" | "inactive"

    Your current mailing list status.

    maxHomeSize?: number

    Unknown

    password?: string

    Your MyPlex password

    PLEXSERVERS: string = 'https://plex.tv/api/servers/{machineId}'
    queueEmail?: string

    Email address to add items to your Watch Later queue.

    REMOVEHOMEUSER: string = 'https://plex.tv/api/home/users/{userId}'
    REMOVEINVITE: string = 'https://plex.tv/api/invites/requested/{userId}?friend=0&server=1&home=0'
    REQUESTED: string = 'https://plex.tv/api/invites/requested'
    REQUESTS: string = 'https://plex.tv/api/invites/requests'
    restricted?: boolean

    Unknown

    scrobbleTypes?: string

    Description

    server?: PlexServer

    not often available

    SIGNIN: string = 'https://plex.tv/users/sign_in.json'
    subscriptionActive?: boolean

    True if your subsctiption is active

    subscriptionFeatures?: string[]

    List of features allowed on your subscription

    subscriptionPlan?: string

    Name of subscription plan

    subscriptionStatus?: "active" | "inactive"

    String representation of subscriptionActive

    thumb?: string

    URL of your account thumbnail

    timeout: number = TIMEOUT

    timeout in seconds on initial connect to myplex

    title?: string

    Unknown. - Looks like an alias for username

    token?: string

    Token used to access this client.

    username?: string

    Your MyPlex username

    uuid?: string

    Unknown

    WEBHOOKS: string = 'https://plex.tv/api/v2/user/webhooks'
    key: string = 'https://plex.tv/api/v2/user'

    Methods

    • Returns Record<string, string>

    • Parameters

      • token: string

        pass token from claimToken

      Returns Promise<any>

    • Returns a new :class:~server.PlexServer or :class:~client.PlexClient object. Often times there is more than one address specified for a server or client. This function will prioritize local connections before remote and HTTPS before HTTP. After trying to connect to all available addresses for this resource and assuming at least one connection was successful, the PlexServer object is built and returned.

      Returns Promise<MyPlexAccount>

    • Parameters

      • name: string = ''

        Name to match against.

      • OptionalclientId: string

        clientIdentifier to match against.

      Returns Promise<MyPlexDevice>

    • Returns a list of all :class:~plexapi.myplex.MyPlexDevice objects connected to the server.

      Returns Promise<MyPlexDevice[]>

    • Main method used to handle HTTPS requests to the Plex client. This method helps by encoding the response to utf-8 and parsing the returned XML into and ElementTree object. Returns None if no data exists in the response. TODO: use headers

      Type Parameters

      • T = any

      Parameters

      • url: string
      • method: "get" | "post" | "put" | "patch" | "head" | "delete" = 'get'
      • Optionalheaders: any
      • Optionalusername: string
      • Optionalpassword: string

      Returns Promise<T>

    • Returns the :class:~plexapi.myplex.MyPlexResource that matches the name specified.

      Parameters

      • name: string

      Returns Promise<MyPlexResource>

    • This follows the outline described in https://forums.plex.tv/t/authenticating-with-plex/609370 to fetch a token and potentially compromise username and password. To use first call getWebLogin() and present the returned uri to a user to go to, then await webLoginCheck(). If you pass in a forwardUrl, then send the user to the returned uri, and when a request comes in on the passed in url, then await webLoginCheck().

      Parameters

      • forwardUrl: string = null

      Returns Promise<WebLogin>

    • Pass in the webLogin object obtained from getWebLogin() and this will poll Plex to see if the user agreed. It returns a connected MyPlexAccount or throws an error.

      Parameters

      • webLogin: WebLogin
      • timeoutSeconds: number = 60

      Returns Promise<MyPlexAccount>