mirror of
https://github.com/LukeHagar/plexpy.git
synced 2025-12-07 20:57:45 +00:00
Server
(server)
Overview
Operations against the Plex Media Server System.
Available Operations
- 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
Get Server Capabilities
Example Usage
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
x_plex_client_identifier="gcgzw5rz2xovp84b4vha3a40",
)
res = s.server.get_server_capabilities()
if res.object is not None:
# handle response
pass
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Response
operations.GetServerCapabilitiesResponse
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.GetServerCapabilitiesResponseBody | 400 | application/json |
| errors.GetServerCapabilitiesServerResponseBody | 401 | application/json |
| errors.SDKError | 4xx-5xx | / |
get_server_preferences
Get Server Preferences
Example Usage
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
x_plex_client_identifier="gcgzw5rz2xovp84b4vha3a40",
)
res = s.server.get_server_preferences()
if res.object is not None:
# handle response
pass
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Response
operations.GetServerPreferencesResponse
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.GetServerPreferencesResponseBody | 400 | application/json |
| errors.GetServerPreferencesServerResponseBody | 401 | application/json |
| errors.SDKError | 4xx-5xx | / |
get_available_clients
Get Available Clients
Example Usage
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
x_plex_client_identifier="gcgzw5rz2xovp84b4vha3a40",
)
res = s.server.get_available_clients()
if res.object is not None:
# handle response
pass
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Response
operations.GetAvailableClientsResponse
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.GetAvailableClientsResponseBody | 400 | application/json |
| errors.GetAvailableClientsServerResponseBody | 401 | application/json |
| errors.SDKError | 4xx-5xx | / |
get_devices
Get Devices
Example Usage
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
x_plex_client_identifier="gcgzw5rz2xovp84b4vha3a40",
)
res = s.server.get_devices()
if res.object is not None:
# handle response
pass
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Response
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.GetDevicesResponseBody | 400 | application/json |
| errors.GetDevicesServerResponseBody | 401 | application/json |
| errors.SDKError | 4xx-5xx | / |
get_server_identity
This request is useful to determine if the server is online or offline
Example Usage
from plex_api_client import PlexAPI
s = PlexAPI(
x_plex_client_identifier="gcgzw5rz2xovp84b4vha3a40",
)
res = s.server.get_server_identity()
if res.object is not None:
# handle response
pass
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Response
operations.GetServerIdentityResponse
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.GetServerIdentityResponseBody | 408 | application/json |
| errors.SDKError | 4xx-5xx | / |
get_my_plex_account
Returns MyPlex Account Information
Example Usage
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
x_plex_client_identifier="gcgzw5rz2xovp84b4vha3a40",
)
res = s.server.get_my_plex_account()
if res.object is not None:
# handle response
pass
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Response
operations.GetMyPlexAccountResponse
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.GetMyPlexAccountResponseBody | 400 | application/json |
| errors.GetMyPlexAccountServerResponseBody | 401 | application/json |
| errors.SDKError | 4xx-5xx | / |
get_resized_photo
Plex's Photo transcoder is used throughout the service to serve images at specified sizes.
Example Usage
from plex_api_client import PlexAPI
from plex_api_client.models import operations
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
x_plex_client_identifier="gcgzw5rz2xovp84b4vha3a40",
)
res = s.server.get_resized_photo(request={
"width": 110,
"height": 165,
"blur": 20,
"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
Parameters
| 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. |
Response
operations.GetResizedPhotoResponse
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.GetResizedPhotoResponseBody | 400 | application/json |
| errors.GetResizedPhotoServerResponseBody | 401 | application/json |
| errors.SDKError | 4xx-5xx | / |
get_media_providers
Retrieves media providers and their features from the Plex server.
Example Usage
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
x_plex_client_identifier="gcgzw5rz2xovp84b4vha3a40",
)
res = s.server.get_media_providers(x_plex_token="CV5xoxjTpFKUzBTShsaf")
if res.object is not None:
# handle response
pass
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
x_plex_token |
str | ✔️ | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Response
operations.GetMediaProvidersResponse
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.GetMediaProvidersResponseBody | 400 | application/json |
| errors.GetMediaProvidersServerResponseBody | 401 | application/json |
| errors.SDKError | 4xx-5xx | / |
get_server_list
Get Server List
Example Usage
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
x_plex_client_identifier="gcgzw5rz2xovp84b4vha3a40",
)
res = s.server.get_server_list()
if res.object is not None:
# handle response
pass
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Response
operations.GetServerListResponse
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.GetServerListResponseBody | 400 | application/json |
| errors.GetServerListServerResponseBody | 401 | application/json |
| errors.SDKError | 4xx-5xx | / |