mirror of
https://github.com/LukeHagar/plexpy.git
synced 2025-12-07 12:47:45 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.459.2
This commit is contained in:
@@ -26,20 +26,16 @@ Get Server Activities
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.activities.get_server_activities()
|
||||
res = plex_api.activities.get_server_activities()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -70,20 +66,16 @@ Cancel Server Activities
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.activities.cancel_server_activities(activity_uuid="25b71ed5-0f9d-461c-baa7-d404e9e10d3e")
|
||||
res = plex_api.activities.cancel_server_activities(activity_uuid="25b71ed5-0f9d-461c-baa7-d404e9e10d3e")
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -24,20 +24,16 @@ This endpoint provides the caller with a temporary token with the same access le
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.authentication.get_transient_token(type_=operations.GetTransientTokenQueryParamType.DELEGATION, scope=operations.Scope.ALL)
|
||||
res = plex_api.authentication.get_transient_token(type_=operations.GetTransientTokenQueryParamType.DELEGATION, scope=operations.Scope.ALL)
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -72,20 +68,16 @@ Note: requires Plex Media Server >= 1.15.4.
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.authentication.get_source_connection_information(source="provider://provider-identifier")
|
||||
res = plex_api.authentication.get_source_connection_information(source="provider://provider-identifier")
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -117,20 +109,16 @@ Get the User data from the provided X-Plex-Token
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.authentication.get_token_details()
|
||||
res = plex_api.authentication.get_token_details()
|
||||
|
||||
if res.user_plex_account is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.user_plex_account is not None
|
||||
|
||||
# Handle response
|
||||
print(res.user_plex_account)
|
||||
|
||||
```
|
||||
|
||||
@@ -162,25 +150,25 @@ Sign in user with username and password and return user data with Plex authentic
|
||||
```python
|
||||
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",
|
||||
)
|
||||
with PlexAPI() as plex_api:
|
||||
|
||||
res = s.authentication.post_users_sign_in_data(request={
|
||||
"request_body": {
|
||||
"login": "username@email.com",
|
||||
"password": "password123",
|
||||
"verification_code": "123456",
|
||||
},
|
||||
})
|
||||
res = plex_api.authentication.post_users_sign_in_data(request={
|
||||
"client_id": "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
"client_name": "Plex for Roku",
|
||||
"device_nickname": "Roku 3",
|
||||
"client_version": "2.4.1",
|
||||
"platform": "Roku",
|
||||
"request_body": {
|
||||
"login": "username@email.com",
|
||||
"password": "password123",
|
||||
"verification_code": "123456",
|
||||
},
|
||||
})
|
||||
|
||||
if res.user_plex_account is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.user_plex_account is not None
|
||||
|
||||
# Handle response
|
||||
print(res.user_plex_account)
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -23,20 +23,16 @@ Returns a list of butler tasks
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.butler.get_butler_tasks()
|
||||
res = plex_api.butler.get_butler_tasks()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -72,20 +68,16 @@ This endpoint will attempt to start all Butler tasks that are enabled in the set
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.butler.start_all_tasks()
|
||||
res = plex_api.butler.start_all_tasks()
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -117,20 +109,16 @@ This endpoint will stop all currently running tasks and remove any scheduled tas
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.butler.stop_all_tasks()
|
||||
res = plex_api.butler.stop_all_tasks()
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -167,20 +155,16 @@ This endpoint will attempt to start a single Butler task that is enabled in the
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.butler.start_task(task_name=operations.TaskName.CLEAN_OLD_BUNDLES)
|
||||
res = plex_api.butler.start_task(task_name=operations.TaskName.CLEAN_OLD_BUNDLES)
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -214,20 +198,16 @@ This endpoint will stop a currently running task by name, or remove it from the
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.butler.stop_task(task_name=operations.PathParamTaskName.BACKUP_DATABASE)
|
||||
res = plex_api.butler.stop_task(task_name=operations.PathParamTaskName.BACKUP_DATABASE)
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -21,20 +21,16 @@ Get Global Hubs filtered by the parameters provided.
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.hubs.get_global_hubs()
|
||||
res = plex_api.hubs.get_global_hubs()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -69,27 +65,23 @@ This endpoint will return the recently added content.
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.hubs.get_recently_added(request={
|
||||
"content_directory_id": 470161,
|
||||
"type": operations.Type.TV_SHOW,
|
||||
"section_id": 2,
|
||||
"include_meta": operations.IncludeMeta.ENABLE,
|
||||
"x_plex_container_start": 0,
|
||||
"x_plex_container_size": 50,
|
||||
})
|
||||
res = plex_api.hubs.get_recently_added(request={
|
||||
"content_directory_id": 470161,
|
||||
"type": operations.Type.TV_SHOW,
|
||||
"section_id": 2,
|
||||
"include_meta": operations.IncludeMeta.ENABLE,
|
||||
"x_plex_container_start": 0,
|
||||
"x_plex_container_size": 50,
|
||||
})
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -120,20 +112,16 @@ This endpoint will return a list of library specific hubs
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.hubs.get_library_hubs(section_id=6728.76)
|
||||
res = plex_api.hubs.get_library_hubs(section_id=6728.76)
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -31,20 +31,16 @@ This resource returns hash values for local files
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.library.get_file_hash(url="file://C:\Image.png&type=13")
|
||||
res = plex_api.library.get_file_hash(url="file://C:\Image.png&type=13")
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -79,41 +75,37 @@ This endpoint will return the recently added content.
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.library.get_recently_added_library(request={
|
||||
"type": operations.QueryParamType.TV_SHOW,
|
||||
"content_directory_id": 2,
|
||||
"pinned_content_directory_id": [
|
||||
3,
|
||||
5,
|
||||
7,
|
||||
13,
|
||||
12,
|
||||
1,
|
||||
6,
|
||||
14,
|
||||
2,
|
||||
10,
|
||||
16,
|
||||
17,
|
||||
],
|
||||
"section_id": 2,
|
||||
"include_meta": operations.QueryParamIncludeMeta.ENABLE,
|
||||
"x_plex_container_start": 0,
|
||||
"x_plex_container_size": 50,
|
||||
})
|
||||
res = plex_api.library.get_recently_added_library(request={
|
||||
"type": operations.QueryParamType.TV_SHOW,
|
||||
"content_directory_id": 2,
|
||||
"pinned_content_directory_id": [
|
||||
3,
|
||||
5,
|
||||
7,
|
||||
13,
|
||||
12,
|
||||
1,
|
||||
6,
|
||||
14,
|
||||
2,
|
||||
10,
|
||||
16,
|
||||
17,
|
||||
],
|
||||
"section_id": 2,
|
||||
"include_meta": operations.QueryParamIncludeMeta.ENABLE,
|
||||
"x_plex_container_start": 0,
|
||||
"x_plex_container_size": 50,
|
||||
})
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -151,20 +143,16 @@ This allows a client to provide a rich interface around the media (e.g. allow so
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.library.get_all_libraries()
|
||||
res = plex_api.library.get_all_libraries()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -234,20 +222,16 @@ Each type in the library comes with a set of filters and sorts, aiding in buildi
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.library.get_library_details(section_key=9518)
|
||||
res = plex_api.library.get_library_details(section_key=9518)
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -280,20 +264,16 @@ Delete a library using a specific section id
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.library.delete_library(section_key=9518)
|
||||
res = plex_api.library.delete_library(section_key=9518)
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -338,6 +318,7 @@ Fetches details from a specific section of the library identified by a section k
|
||||
- `resolution`: Items categorized by resolution.
|
||||
- `firstCharacter`: Items categorized by the first letter.
|
||||
- `folder`: Items categorized by folder.
|
||||
- `albums`: Items categorized by album.
|
||||
|
||||
|
||||
### Example Usage
|
||||
@@ -346,28 +327,24 @@ Fetches details from a specific section of the library identified by a section k
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.library.get_library_items(request={
|
||||
"tag": operations.Tag.EDITION,
|
||||
"section_key": 9518,
|
||||
"include_guids": operations.IncludeGuids.ENABLE,
|
||||
"type": operations.GetLibraryItemsQueryParamType.TV_SHOW,
|
||||
"include_meta": operations.GetLibraryItemsQueryParamIncludeMeta.ENABLE,
|
||||
"x_plex_container_start": 0,
|
||||
"x_plex_container_size": 50,
|
||||
})
|
||||
res = plex_api.library.get_library_items(request={
|
||||
"tag": operations.Tag.EDITION,
|
||||
"section_key": 9518,
|
||||
"include_guids": operations.IncludeGuids.ENABLE,
|
||||
"type": operations.GetLibraryItemsQueryParamType.TV_SHOW,
|
||||
"include_meta": operations.GetLibraryItemsQueryParamIncludeMeta.ENABLE,
|
||||
"x_plex_container_start": 0,
|
||||
"x_plex_container_size": 50,
|
||||
})
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -401,20 +378,16 @@ This endpoint Refreshes all the Metadata of the library.
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.library.get_refresh_library_metadata(section_key=9518, force=operations.Force.ONE)
|
||||
res = plex_api.library.get_refresh_library_metadata(section_key=9518, force=operations.Force.ONE)
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -466,20 +439,16 @@ Each type in the library comes with a set of filters and sorts, aiding in buildi
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.library.get_search_library(section_key=9518, type_=operations.GetSearchLibraryQueryParamType.TV_SHOW)
|
||||
res = plex_api.library.get_search_library(section_key=9518, type_=operations.GetSearchLibraryQueryParamType.TV_SHOW)
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -514,27 +483,24 @@ Search the provided query across all library sections, or a single section, and
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.library.get_search_all_libraries(request={
|
||||
"query": "<value>",
|
||||
"search_types": [
|
||||
operations.SearchTypes.PEOPLE,
|
||||
],
|
||||
"include_collections": operations.QueryParamIncludeCollections.ENABLE,
|
||||
"include_external_media": operations.QueryParamIncludeExternalMedia.ENABLE,
|
||||
})
|
||||
res = plex_api.library.get_search_all_libraries(request={
|
||||
"query": "<value>",
|
||||
"client_id": "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
"search_types": [
|
||||
operations.SearchTypes.PEOPLE,
|
||||
],
|
||||
"include_collections": operations.QueryParamIncludeCollections.ENABLE,
|
||||
"include_external_media": operations.QueryParamIncludeExternalMedia.ENABLE,
|
||||
})
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -567,20 +533,16 @@ This endpoint will return the metadata of a library item specified with the rati
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.library.get_meta_data_by_rating_key(rating_key=9518)
|
||||
res = plex_api.library.get_meta_data_by_rating_key(rating_key=9518)
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -613,20 +575,16 @@ This endpoint will return the children of of a library item specified with the r
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.library.get_metadata_children(rating_key=1539.14, include_elements="Stream")
|
||||
res = plex_api.library.get_metadata_children(rating_key=1539.14, include_elements="Stream")
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -661,20 +619,16 @@ This endpoint will return the top watched content from libraries of a certain ty
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.library.get_top_watched_content(type_=operations.GetTopWatchedContentQueryParamType.TV_SHOW, include_guids=1)
|
||||
res = plex_api.library.get_top_watched_content(type_=operations.GetTopWatchedContentQueryParamType.TV_SHOW, include_guids=1)
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -708,20 +662,16 @@ This endpoint will return the on deck content.
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.library.get_on_deck()
|
||||
res = plex_api.library.get_on_deck()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -23,20 +23,16 @@ This endpoint will write a single-line log message, including a level and source
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.log.log_line(level=operations.Level.THREE, message="Test log message", source="Postman")
|
||||
res = plex_api.log.log_line(level=operations.Level.THREE, message="Test log message", source="Postman")
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -91,22 +87,18 @@ Ensure each parameter is properly URL-encoded to avoid interpretation issues.
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.log.log_multi_line(request="level=4&message=Test%20message%201&source=postman\n" +
|
||||
"level=3&message=Test%20message%202&source=postman\n" +
|
||||
"level=1&message=Test%20message%203&source=postman")
|
||||
res = plex_api.log.log_multi_line(request="level=4&message=Test%20message%201&source=postman\n" +
|
||||
"level=3&message=Test%20message%202&source=postman\n" +
|
||||
"level=1&message=Test%20message%203&source=postman")
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -139,20 +131,16 @@ This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.log.enable_paper_trail()
|
||||
res = plex_api.log.enable_paper_trail()
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -23,20 +23,16 @@ This will mark the provided media key as Played.
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.media.mark_played(key=59398)
|
||||
res = plex_api.media.mark_played(key=59398)
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -68,20 +64,16 @@ This will mark the provided media key as Unplayed.
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.media.mark_unplayed(key=59398)
|
||||
res = plex_api.media.mark_unplayed(key=59398)
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -114,20 +106,16 @@ This API command can be used to update the play progress of a media item.
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.media.update_play_progress(key="<key>", time=90000, state="played")
|
||||
res = plex_api.media.update_play_progress(key="<key>", time=90000, state="played")
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -161,27 +149,23 @@ Gets the banner image of the media item
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.media.get_banner_image(request={
|
||||
"rating_key": 9518,
|
||||
"width": 396,
|
||||
"height": 396,
|
||||
"min_size": 1,
|
||||
"upscale": 1,
|
||||
"x_plex_token": "CV5xoxjTpFKUzBTShsaf",
|
||||
})
|
||||
res = plex_api.media.get_banner_image(request={
|
||||
"rating_key": 9518,
|
||||
"width": 396,
|
||||
"height": 396,
|
||||
"min_size": 1,
|
||||
"upscale": 1,
|
||||
"x_plex_token": "CV5xoxjTpFKUzBTShsaf",
|
||||
})
|
||||
|
||||
if res.response_stream is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.response_stream is not None
|
||||
|
||||
# Handle response
|
||||
print(res.response_stream)
|
||||
|
||||
```
|
||||
|
||||
@@ -213,27 +197,23 @@ Gets the thumbnail image of the media item
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.media.get_thumb_image(request={
|
||||
"rating_key": 9518,
|
||||
"width": 396,
|
||||
"height": 396,
|
||||
"min_size": 1,
|
||||
"upscale": 1,
|
||||
"x_plex_token": "CV5xoxjTpFKUzBTShsaf",
|
||||
})
|
||||
res = plex_api.media.get_thumb_image(request={
|
||||
"rating_key": 9518,
|
||||
"width": 396,
|
||||
"height": 396,
|
||||
"min_size": 1,
|
||||
"upscale": 1,
|
||||
"x_plex_token": "CV5xoxjTpFKUzBTShsaf",
|
||||
})
|
||||
|
||||
if res.response_stream is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.response_stream is not None
|
||||
|
||||
# Handle response
|
||||
print(res.response_stream)
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -34,25 +34,21 @@ Create a new playlist. By default the playlist is blank. To create a playlist al
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.playlists.create_playlist(request={
|
||||
"title": "<value>",
|
||||
"type": operations.CreatePlaylistQueryParamType.PHOTO,
|
||||
"smart": operations.Smart.ONE,
|
||||
"uri": "https://inborn-brochure.biz",
|
||||
})
|
||||
res = plex_api.playlists.create_playlist(request={
|
||||
"title": "<value>",
|
||||
"type": operations.CreatePlaylistQueryParamType.PHOTO,
|
||||
"smart": operations.Smart.ONE,
|
||||
"uri": "https://inborn-brochure.biz",
|
||||
})
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -84,20 +80,16 @@ Get All Playlists given the specified filters.
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.playlists.get_playlists()
|
||||
res = plex_api.playlists.get_playlists()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -132,20 +124,16 @@ Smart playlist details contain the `content` attribute. This is the content URI
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.playlists.get_playlist(playlist_id=4109.48)
|
||||
res = plex_api.playlists.get_playlist(playlist_id=4109.48)
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -178,20 +166,16 @@ This endpoint will delete a playlist
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.playlists.delete_playlist(playlist_id=216.22)
|
||||
res = plex_api.playlists.delete_playlist(playlist_id=216.22)
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -224,20 +208,16 @@ From PMS version 1.9.1 clients can also edit playlist metadata using this endpoi
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.playlists.update_playlist(playlist_id=3915)
|
||||
res = plex_api.playlists.update_playlist(playlist_id=3915)
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -276,20 +256,16 @@ Note that for dumb playlists, items have a `playlistItemID` attribute which is u
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.playlists.get_playlist_contents(playlist_id=5004.46, type_=operations.GetPlaylistContentsQueryParamType.TV_SHOW)
|
||||
res = plex_api.playlists.get_playlist_contents(playlist_id=5004.46, type_=operations.GetPlaylistContentsQueryParamType.TV_SHOW)
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -323,20 +299,16 @@ Clears a playlist, only works with dumb playlists. Returns the playlist.
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.playlists.clear_playlist_contents(playlist_id=1893.18)
|
||||
res = plex_api.playlists.clear_playlist_contents(playlist_id=1893.18)
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -370,20 +342,16 @@ With a smart playlist, passing a new `uri` parameter replaces the rules for the
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.playlists.add_playlist_contents(playlist_id=8502.01, uri="server://12345/com.plexapp.plugins.library/library/metadata/1", play_queue_id=123)
|
||||
res = plex_api.playlists.add_playlist_contents(playlist_id=8502.01, uri="server://12345/com.plexapp.plugins.library/library/metadata/1", play_queue_id=123)
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -419,20 +387,16 @@ Imports m3u playlists by passing a path on the server to scan for m3u-formatted
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.playlists.upload_playlist(path="/home/barkley/playlist.m3u", force=operations.QueryParamForce.ZERO, section_id=1)
|
||||
res = plex_api.playlists.upload_playlist(path="/home/barkley/playlist.m3u", force=operations.QueryParamForce.ZERO, section_id=1)
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -25,20 +25,16 @@ Get Companions Data
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.plex.get_companions_data()
|
||||
res = plex_api.plex.get_companions_data()
|
||||
|
||||
if res.response_bodies is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.response_bodies is not None
|
||||
|
||||
# Handle response
|
||||
print(res.response_bodies)
|
||||
|
||||
```
|
||||
|
||||
@@ -70,20 +66,16 @@ Get friends of provided auth token.
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.plex.get_user_friends()
|
||||
res = plex_api.plex.get_user_friends()
|
||||
|
||||
if res.friends is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.friends is not None
|
||||
|
||||
# Handle response
|
||||
print(res.friends)
|
||||
|
||||
```
|
||||
|
||||
@@ -115,19 +107,14 @@ Returns the geolocation and locale data of the caller
|
||||
```python
|
||||
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",
|
||||
)
|
||||
with PlexAPI() as plex_api:
|
||||
|
||||
res = s.plex.get_geo_data()
|
||||
res = plex_api.plex.get_geo_data()
|
||||
|
||||
if res.geo_data is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.geo_data is not None
|
||||
|
||||
# Handle response
|
||||
print(res.geo_data)
|
||||
|
||||
```
|
||||
|
||||
@@ -159,20 +146,16 @@ Retrieves the home data for the authenticated user, including details like home
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.plex.get_home_data()
|
||||
res = plex_api.plex.get_home_data()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -204,20 +187,16 @@ Get Plex server access tokens and server connections
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.plex.get_server_resources(include_https=operations.IncludeHTTPS.ENABLE, include_relay=operations.IncludeRelay.ENABLE, include_i_pv6=operations.IncludeIPv6.ENABLE, client_id="3381b62b-9ab7-4e37-827b-203e9809eb58")
|
||||
res = plex_api.plex.get_server_resources(client_id="3381b62b-9ab7-4e37-827b-203e9809eb58", include_https=operations.IncludeHTTPS.ENABLE, include_relay=operations.IncludeRelay.ENABLE, include_i_pv6=operations.IncludeIPv6.ENABLE)
|
||||
|
||||
if res.plex_devices is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.plex_devices is not None
|
||||
|
||||
# Handle response
|
||||
print(res.plex_devices)
|
||||
|
||||
```
|
||||
|
||||
@@ -225,10 +204,10 @@ if res.plex_devices is not None:
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
||||
| `client_id` | *str* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 |
|
||||
| `include_https` | [Optional[operations.IncludeHTTPS]](../../models/operations/includehttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 |
|
||||
| `include_relay` | [Optional[operations.IncludeRelay]](../../models/operations/includerelay.md) | :heavy_minus_sign: | Include Relay addresses in the results <br/>E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400<br/> | 1 |
|
||||
| `include_i_pv6` | [Optional[operations.IncludeIPv6]](../../models/operations/includeipv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 |
|
||||
| `client_id` | *Optional[str]* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 |
|
||||
|
||||
@@ -253,19 +232,20 @@ Retrieve a Pin ID from Plex.tv to use for authentication flows
|
||||
```python
|
||||
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",
|
||||
)
|
||||
with PlexAPI() as plex_api:
|
||||
|
||||
res = s.plex.get_pin(request={})
|
||||
res = plex_api.plex.get_pin(request={
|
||||
"client_id": "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
"client_name": "Plex for Roku",
|
||||
"device_nickname": "Roku 3",
|
||||
"client_version": "2.4.1",
|
||||
"platform": "Roku",
|
||||
})
|
||||
|
||||
if res.auth_pin_container is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.auth_pin_container is not None
|
||||
|
||||
# Handle response
|
||||
print(res.auth_pin_container)
|
||||
|
||||
```
|
||||
|
||||
@@ -297,21 +277,21 @@ Retrieve an Access Token from Plex.tv after the Pin has been authenticated
|
||||
```python
|
||||
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",
|
||||
)
|
||||
with PlexAPI() as plex_api:
|
||||
|
||||
res = s.plex.get_token_by_pin_id(request={
|
||||
"pin_id": 408895,
|
||||
})
|
||||
res = plex_api.plex.get_token_by_pin_id(request={
|
||||
"pin_id": 408895,
|
||||
"client_id": "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
"client_name": "Plex for Roku",
|
||||
"device_nickname": "Roku 3",
|
||||
"client_version": "2.4.1",
|
||||
"platform": "Roku",
|
||||
})
|
||||
|
||||
if res.auth_pin_container is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.auth_pin_container is not None
|
||||
|
||||
# Handle response
|
||||
print(res.auth_pin_container)
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -26,3 +26,6 @@ The following SDKs are generated from the OpenAPI Specification. They are automa
|
||||
| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
|
||||
| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
|
||||
| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
@@ -33,20 +33,16 @@ This request is intended to be very fast, and called as the user types.
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.search.perform_search(query="dylan", limit=5)
|
||||
res = plex_api.search.perform_search(query="dylan", limit=5)
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -84,20 +80,16 @@ Results, as well as their containing per-type hubs, contain a `distance` attribu
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.search.perform_voice_search(query="dead+poop", limit=5)
|
||||
res = plex_api.search.perform_voice_search(query="dead+poop", limit=5)
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -131,20 +123,16 @@ This will search the database for the string provided.
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.search.get_search_results(query="110")
|
||||
res = plex_api.search.get_search_results(query="110")
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -27,20 +27,16 @@ Get Server Capabilities
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.server.get_server_capabilities()
|
||||
res = plex_api.server.get_server_capabilities()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -71,20 +67,16 @@ Get Server Preferences
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.server.get_server_preferences()
|
||||
res = plex_api.server.get_server_preferences()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -115,20 +107,16 @@ Get Available Clients
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.server.get_available_clients()
|
||||
res = plex_api.server.get_available_clients()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -159,20 +147,16 @@ Get Devices
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.server.get_devices()
|
||||
res = plex_api.server.get_devices()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -203,19 +187,14 @@ This request is useful to determine if the server is online or offline
|
||||
```python
|
||||
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",
|
||||
)
|
||||
with PlexAPI() as plex_api:
|
||||
|
||||
res = s.server.get_server_identity()
|
||||
res = plex_api.server.get_server_identity()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -245,20 +224,16 @@ Returns MyPlex Account Information
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.server.get_my_plex_account()
|
||||
res = plex_api.server.get_my_plex_account()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -291,28 +266,24 @@ Plex's Photo transcoder is used throughout the service to serve images at specif
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
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,
|
||||
})
|
||||
res = plex_api.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
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -344,20 +315,16 @@ Retrieves media providers and their features from the Plex server.
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.server.get_media_providers(x_plex_token="CV5xoxjTpFKUzBTShsaf")
|
||||
res = plex_api.server.get_media_providers(x_plex_token="CV5xoxjTpFKUzBTShsaf")
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -389,20 +356,16 @@ Get Server List
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.server.get_server_list()
|
||||
res = plex_api.server.get_server_list()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -22,20 +22,16 @@ This will retrieve the "Now Playing" Information of the PMS.
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.sessions.get_sessions()
|
||||
res = plex_api.sessions.get_sessions()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -66,20 +62,16 @@ This will Retrieve a listing of all history views.
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.sessions.get_session_history(sort="viewedAt:desc", account_id=1, filter_={}, library_section_id=12)
|
||||
res = plex_api.sessions.get_session_history(sort="viewedAt:desc", account_id=1, filter_={}, library_section_id=12)
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -114,20 +106,16 @@ Get Transcode Sessions
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.sessions.get_transcode_sessions()
|
||||
res = plex_api.sessions.get_transcode_sessions()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -158,20 +146,16 @@ Stop a Transcode Session
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.sessions.stop_transcode_session(session_key="zz7llzqlx8w9vnrsbnwhbmep")
|
||||
res = plex_api.sessions.stop_transcode_session(session_key="zz7llzqlx8w9vnrsbnwhbmep")
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -21,20 +21,16 @@ This will return the media statistics for the server
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.statistics.get_statistics(timespan=4)
|
||||
res = plex_api.statistics.get_statistics(timespan=4)
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -66,20 +62,16 @@ This will return the resources for the server
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.statistics.get_resources_statistics(timespan=4)
|
||||
res = plex_api.statistics.get_resources_statistics(timespan=4)
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -111,20 +103,16 @@ This will return the bandwidth statistics for the server
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.statistics.get_bandwidth_statistics(timespan=4)
|
||||
res = plex_api.statistics.get_bandwidth_statistics(timespan=4)
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -22,20 +22,16 @@ Querying status of updates
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.updater.get_update_status()
|
||||
res = plex_api.updater.get_update_status()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
@@ -67,20 +63,16 @@ Checking for updates
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.updater.check_for_updates(download=operations.Download.ONE)
|
||||
res = plex_api.updater.check_for_updates(download=operations.Download.ONE)
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -114,20 +106,16 @@ Note that these two parameters are effectively mutually exclusive. The `tonight`
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.updater.apply_updates(tonight=operations.Tonight.ONE, skip=operations.Skip.ONE)
|
||||
res = plex_api.updater.apply_updates(tonight=operations.Tonight.ONE, skip=operations.Skip.ONE)
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -21,31 +21,27 @@ Get the timeline for a media item
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.video.get_timeline(request={
|
||||
"rating_key": 23409,
|
||||
"key": "/library/metadata/23409",
|
||||
"state": operations.State.PLAYING,
|
||||
"has_mde": 1,
|
||||
"time": 2000,
|
||||
"duration": 10000,
|
||||
"context": "home:hub.continueWatching",
|
||||
"play_queue_item_id": 1,
|
||||
"play_back_time": 2000,
|
||||
"row": 1,
|
||||
})
|
||||
res = plex_api.video.get_timeline(request={
|
||||
"rating_key": 23409,
|
||||
"key": "/library/metadata/23409",
|
||||
"state": operations.State.PLAYING,
|
||||
"has_mde": 1,
|
||||
"time": 2000,
|
||||
"duration": 10000,
|
||||
"context": "home:hub.continueWatching",
|
||||
"play_queue_item_id": 1,
|
||||
"play_back_time": 2000,
|
||||
"row": 1,
|
||||
})
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
@@ -77,37 +73,33 @@ Begin a Universal Transcode Session
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.video.start_universal_transcode(request={
|
||||
"has_mde": 1,
|
||||
"path": "/library/metadata/23409",
|
||||
"media_index": 0,
|
||||
"part_index": 0,
|
||||
"protocol": "hls",
|
||||
"fast_seek": 0,
|
||||
"direct_play": 0,
|
||||
"direct_stream": 0,
|
||||
"subtitle_size": 100,
|
||||
"subtites": "burn",
|
||||
"audio_boost": 100,
|
||||
"location": "lan",
|
||||
"media_buffer_size": 102400,
|
||||
"session": "zvcage8b7rkioqcm8f4uns4c",
|
||||
"add_debug_overlay": 0,
|
||||
"auto_adjust_quality": 0,
|
||||
})
|
||||
res = plex_api.video.start_universal_transcode(request={
|
||||
"has_mde": 1,
|
||||
"path": "/library/metadata/23409",
|
||||
"media_index": 0,
|
||||
"part_index": 0,
|
||||
"protocol": "hls",
|
||||
"fast_seek": 0,
|
||||
"direct_play": 0,
|
||||
"direct_stream": 0,
|
||||
"subtitle_size": 100,
|
||||
"subtites": "burn",
|
||||
"audio_boost": 100,
|
||||
"location": "lan",
|
||||
"media_buffer_size": 102400,
|
||||
"session": "zvcage8b7rkioqcm8f4uns4c",
|
||||
"add_debug_overlay": 0,
|
||||
"auto_adjust_quality": 0,
|
||||
})
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -20,25 +20,21 @@ Get User Watchlist
|
||||
from plex_api_client import PlexAPI
|
||||
from plex_api_client.models import operations
|
||||
|
||||
s = PlexAPI(
|
||||
with 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",
|
||||
)
|
||||
) as plex_api:
|
||||
|
||||
res = s.watchlist.get_watch_list(request={
|
||||
"filter_": operations.Filter.AVAILABLE,
|
||||
"x_plex_token": "CV5xoxjTpFKUzBTShsaf",
|
||||
"x_plex_container_start": 0,
|
||||
"x_plex_container_size": 50,
|
||||
})
|
||||
res = plex_api.watchlist.get_watch_list(request={
|
||||
"filter_": operations.Filter.AVAILABLE,
|
||||
"x_plex_token": "CV5xoxjTpFKUzBTShsaf",
|
||||
"x_plex_container_start": 0,
|
||||
"x_plex_container_size": 50,
|
||||
})
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user