mirror of
https://github.com/LukeHagar/plexpy.git
synced 2025-12-06 04:20:52 +00:00
8.9 KiB
8.9 KiB
Hubs
(hubs)
Overview
Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
Available Operations
- get_global_hubs - Get Global Hubs
- get_library_hubs - Get library specific hubs
get_global_hubs
Get Global Hubs filtered by the parameters provided.
Example Usage
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
x_plex_client_identifier="gcgzw5rz2xovp84b4vha3a40",
)
res = s.hubs.get_global_hubs()
if res.object is not None:
# handle response
pass
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
count |
Optional[float] | ➖ | The number of items to return with each hub. |
only_transient |
Optional[operations.OnlyTransient] | ➖ | Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Response
operations.GetGlobalHubsResponse
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.GetGlobalHubsBadRequest | 400 | application/json |
| errors.GetGlobalHubsUnauthorized | 401 | application/json |
| errors.SDKError | 4xx-5xx | / |
get_library_hubs
This endpoint will return a list of library specific hubs
Example Usage
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
x_plex_client_identifier="gcgzw5rz2xovp84b4vha3a40",
)
res = s.hubs.get_library_hubs(section_id=6728.76)
if res.object is not None:
# handle response
pass
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
section_id |
float | ✔️ | the Id of the library to query |
count |
Optional[float] | ➖ | The number of items to return with each hub. |
only_transient |
Optional[operations.QueryParamOnlyTransient] | ➖ | Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Response
operations.GetLibraryHubsResponse
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.GetLibraryHubsBadRequest | 400 | application/json |
| errors.GetLibraryHubsUnauthorized | 401 | application/json |
| errors.SDKError | 4xx-5xx | / |