Class PlexClient

Main class for interacting with a Plex client. This class can connect directly to the client and control it or proxy commands through your Plex Server. To better understand the Plex client API's read this page: https://github.com/plexinc/plex-media-player/wiki/Remote-control-API Attributes: TAG (str): 'Player' key (str): '/resources' device (str): Best guess on the type of device this is (PS, iPhone, Linux, etc). deviceClass (str): Device class (pc, phone, etc). machineIdentifier (str): Unique ID for this device. model (str): Unknown platform (str): Unknown platformVersion (str): Description product (str): Client Product (Plex for iOS, etc). protocol (str): Always seems ot be 'plex'. protocolCapabilities (list): List of client capabilities (navigation, playback, timeline, mirror, playqueues). protocolVersion (str): Protocol version (1, future proofing?) server (:class:~plexapi.server.PlexServer): Server this client is connected to. session (:class:~requests.Session): Session object used for connection. state (str): Unknown title (str): Name of this client (Johns iPhone, etc). token (str): X-Plex-Token used for authenication vendor (str): Unknown version (str): Device version (4.6.1, etc). _session (obj): Requests session object used to access this client. _proxyThroughServer (bool): Set to True after calling :func:~plexapi.client.PlexClient.proxyThroughServer() (default False).

Constructors

Properties

TAG: string = 'Player'
_baseurl: string = null

HTTP address of the client

_token: string = null

Token used to access this client

deviceClass?: string
key: string = '/resources'
machineIdentifier?: string
platform?: string
platformVersion?: string
product?: string
protocol?: string
protocolCapabilities?: string[]
protocolVersion?: string
timeout: number
title?: string

Methods

  • Alias of reload as any subsequent requests to this client will be made directly to the device even if the object attributes were initially populated from a PlexServer.

    Returns Promise<void>

  • 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

    Parameters

    • path: string
    • method:
          | "get"
          | "post"
          | "put"
          | "patch"
          | "head"
          | "delete" = 'get'
    • Optionalheaders: Record<string, string>

    Returns Promise<T>

  • Returns Promise<void>

    PlexClient.connect

  • Build a URL string with proper token argument. Token will be appended to the URL if either includeToken is True or TODO: CONFIG.log.show_secrets is 'true'.

    Parameters

    • key: string
    • includeToken: boolean = false

    Returns URL