(server)
Operations against the Plex Media Server System.
- get_server_capabilities - Get Server Capabilities
- get_server_preferences - Get Server Preferences
- get_available_clients - Get Available Clients
- get_devices - Get Devices
- get_server_identity - Get Server Identity
- get_my_plex_account - Get MyPlex Account
- get_resized_photo - Get a Resized Photo
- get_media_providers - Get Media Providers
- get_server_list - Get Server List
Get Server Capabilities
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
client_id="3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name="Plex for Roku",
client_version="2.4.1",
platform="Roku",
device_nickname="Roku 3",
)
res = s.server.get_server_capabilities()
if res.object is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetServerCapabilitiesResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.GetServerCapabilitiesBadRequest | 400 | application/json |
errors.GetServerCapabilitiesUnauthorized | 401 | application/json |
errors.SDKError | 4XX, 5XX | */* |
Get Server Preferences
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
client_id="3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name="Plex for Roku",
client_version="2.4.1",
platform="Roku",
device_nickname="Roku 3",
)
res = s.server.get_server_preferences()
if res.object is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetServerPreferencesResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.GetServerPreferencesBadRequest | 400 | application/json |
errors.GetServerPreferencesUnauthorized | 401 | application/json |
errors.SDKError | 4XX, 5XX | */* |
Get Available Clients
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
client_id="3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name="Plex for Roku",
client_version="2.4.1",
platform="Roku",
device_nickname="Roku 3",
)
res = s.server.get_available_clients()
if res.object is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetAvailableClientsResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.GetAvailableClientsBadRequest | 400 | application/json |
errors.GetAvailableClientsUnauthorized | 401 | application/json |
errors.SDKError | 4XX, 5XX | */* |
Get Devices
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
client_id="3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name="Plex for Roku",
client_version="2.4.1",
platform="Roku",
device_nickname="Roku 3",
)
res = s.server.get_devices()
if res.object is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Error Type | Status Code | Content Type |
---|---|---|
errors.GetDevicesBadRequest | 400 | application/json |
errors.GetDevicesUnauthorized | 401 | application/json |
errors.SDKError | 4XX, 5XX | */* |
This request is useful to determine if the server is online or offline
from plex_api_client import PlexAPI
s = PlexAPI(
client_id="3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name="Plex for Roku",
client_version="2.4.1",
platform="Roku",
device_nickname="Roku 3",
)
res = s.server.get_server_identity()
if res.object is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetServerIdentityResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.GetServerIdentityRequestTimeout | 408 | application/json |
errors.SDKError | 4XX, 5XX | */* |
Returns MyPlex Account Information
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
client_id="3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name="Plex for Roku",
client_version="2.4.1",
platform="Roku",
device_nickname="Roku 3",
)
res = s.server.get_my_plex_account()
if res.object is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetMyPlexAccountResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.GetMyPlexAccountBadRequest | 400 | application/json |
errors.GetMyPlexAccountUnauthorized | 401 | application/json |
errors.SDKError | 4XX, 5XX | */* |
Plex's Photo transcoder is used throughout the service to serve images at specified sizes.
from plex_api_client import PlexAPI
from plex_api_client.models import operations
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
client_id="3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name="Plex for Roku",
client_version="2.4.1",
platform="Roku",
device_nickname="Roku 3",
)
res = s.server.get_resized_photo(request={
"width": 110,
"height": 165,
"blur": 0,
"min_size": operations.MinSize.ONE,
"upscale": operations.Upscale.ONE,
"url": "/library/metadata/49564/thumb/1654258204",
"opacity": 100,
})
if res is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetResizedPhotoRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetResizedPhotoResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.GetResizedPhotoBadRequest | 400 | application/json |
errors.GetResizedPhotoUnauthorized | 401 | application/json |
errors.SDKError | 4XX, 5XX | */* |
Retrieves media providers and their features from the Plex server.
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
client_id="3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name="Plex for Roku",
client_version="2.4.1",
platform="Roku",
device_nickname="Roku 3",
)
res = s.server.get_media_providers(x_plex_token="CV5xoxjTpFKUzBTShsaf")
if res.object is not None:
# handle response
pass
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
x_plex_token |
str | ✔️ | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetMediaProvidersResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.GetMediaProvidersBadRequest | 400 | application/json |
errors.GetMediaProvidersUnauthorized | 401 | application/json |
errors.SDKError | 4XX, 5XX | */* |
Get Server List
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
client_id="3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name="Plex for Roku",
client_version="2.4.1",
platform="Roku",
device_nickname="Roku 3",
)
res = s.server.get_server_list()
if res.object is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetServerListResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.GetServerListBadRequest | 400 | application/json |
errors.GetServerListUnauthorized | 401 | application/json |
errors.SDKError | 4XX, 5XX | */* |