mirror of
https://github.com/LukeHagar/plexpy.git
synced 2025-12-06 04:20:52 +00:00
* `plex_api.library_playlists.add_playlist_items()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.hubs.get_metadata_hubs()`: * `request.only_transient` **Changed** * `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library_collections.move_collection_item()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library_collections.delete_collection_item()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library_collections.add_collection_items()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.content.get_sonically_similar()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.butler.stop_task()`: `request` **Changed** **Breaking** ⚠️ * `plex_api.butler.start_task()`: `request` **Changed** **Breaking** ⚠️ * `plex_api.content.get_sonic_path()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.download_queue.get_item_decision()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.hubs.get_all_hubs()`: * `request.only_transient` **Changed** * `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.hubs.get_continue_watching()`: `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.hubs.get_promoted_hubs()`: `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.content.get_all_leaves()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.hubs.get_postplay_hubs()`: * `request.only_transient` **Changed** * `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.hubs.get_related_hubs()`: * `request.only_transient` **Changed** * `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.hubs.get_section_hubs()`: * `request.only_transient` **Changed** * `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.content.list_content()`: * `request` **Changed** * `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.content.get_albums()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.search.search_hubs()`: `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.search.voice_search_hubs()`: * `request.type` **Changed** **Breaking** ⚠️ * `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.get_library_items()`: * `request.media_query` **Changed** * `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.ingest_transient_item()`: * `request` **Changed** * `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.get_library_matches()`: * `request` **Changed** **Breaking** ⚠️ * `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.content.get_metadata_item()`: * `request` **Changed** * `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.get_sections()`: `response.media_container.directory.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.add_section()`: * `request` **Changed** * `response.media_container.directory.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.get_tags()`: * `request.type` **Changed** **Breaking** ⚠️ * `plex_api.content.get_collection_items()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.get_all_item_leaves()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.status.list_sessions()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.play_queue.move_play_queue_item()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.get_extras()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.play_queue.delete_play_queue_item()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.play_queue.unshuffle()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.list_matches()`: * `request.manual` **Changed** * `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.list_sonically_similar()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.play_queue.reset_play_queue()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.get_related_items()`: `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.list_similar()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.play_queue.clear_play_queue()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.get_item_tree()`: `response.media_container.metadata_item.[]` **Changed** **Breaking** ⚠️ * `plex_api.play_queue.add_to_play_queue()`: * `request.next` **Changed** * `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.play_queue.get_play_queue()`: * `request` **Changed** * `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library_playlists.move_playlist_item()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.get_person()`: `response.media_container.directory.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.list_person_media()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library_playlists.get_playlist_generator_items()`: `response.media_container.metadata` **Changed** **Breaking** ⚠️ * `plex_api.library.get_library_details()`: * `request.include_details` **Changed** * `response.media_container.directory.[]` **Changed** **Breaking** ⚠️ * `plex_api.library_playlists.modify_playlist_generator()`: * `request.item` **Changed** * `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.autocomplete()`: * `request.media_query` **Changed** * `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.get_collections()`: * `request.media_query` **Changed** * `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.get_common()`: * `request.media_query` **Changed** * `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library_playlists.delete_playlist_item()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library_playlists.clear_playlist_items()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.play_queue.shuffle()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library_playlists.create_playlist()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.playlist.get_playlist_items()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.playlist.get_playlist()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.collections.create_collection()`: * `request.type` **Changed** **Breaking** ⚠️ * `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.dv_rs.tune_channel()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.live_tv.get_sessions()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.live_tv.get_live_tv_session()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.playlist.list_playlists()`: `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.subscriptions.get_all_subscriptions()`: * `request` **Changed** * `response.media_container.media_subscription.[].media_grab_operation.[].metadata` **Changed** **Breaking** ⚠️ * `plex_api.subscriptions.create_subscription()`: `response.media_container.media_subscription.[].media_grab_operation.[].metadata` **Changed** **Breaking** ⚠️ * `plex_api.subscriptions.get_scheduled_recordings()`: `response.media_container.media_grab_operation.[].metadata` **Changed** **Breaking** ⚠️ * `plex_api.subscriptions.get_template()`: `response.media_container.subscription_template.[].media_subscription.[].media_grab_operation.[].metadata` **Changed** **Breaking** ⚠️ * `plex_api.subscriptions.get_subscription()`: * `request` **Changed** * `response.media_container.media_subscription.[].media_grab_operation.[].metadata` **Changed** **Breaking** ⚠️ * `plex_api.subscriptions.edit_subscription_preferences()`: `response.media_container.media_subscription.[].media_grab_operation.[].metadata` **Changed** **Breaking** ⚠️ * `plex_api.subscriptions.reorder_subscription()`: `response.media_container.media_subscription.[].media_grab_operation.[].metadata` **Changed** **Breaking** ⚠️ * `plex_api.transcoder.make_decision()`: * `request` **Changed** * `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️ * `plex_api.library.refresh_items_metadata()`: * `request.mark_updated` **Changed** * `plex_api.authentication.post-users-sign-in-data()`: **Added** * `plex_api.transcoder.start_transcode_session()`: `request` **Changed** * `plex_api.devices.modify_device()`: * `request.enabled` **Changed** * `plex_api.library.get_media_part()`: * `request.download` **Changed** * `plex_api.library.detect_intros()`: * `request.force` **Changed** * `plex_api.library.refresh_section()`: * `request.force` **Changed** * `plex_api.library_playlists.upload_playlist()`: * `request.force` **Changed** * `plex_api.library.delete_media_item()`: * `request.proxy` **Changed** * `plex_api.authentication.get_token_details()`: **Added** * `plex_api.library.get_first_characters()`: * `request.media_query` **Changed** * `plex_api.library.update_items()`: * `request.field.locked` **Changed** * `plex_api.library.delete_library_section()`: * `request.async` **Changed** * `plex_api.library.set_stream_selection()`: * `request.all_parts` **Changed** * `plex_api.play_queue.create_play_queue()`: `request` **Changed** * `plex_api.library.get_augmentation_status()`: * `request.wait` **Changed** * `plex_api.library.detect_voice_activity()`: `request` **Changed** * `plex_api.transcoder.transcode_image()`: `request` **Changed** * `plex_api.transcoder.transcode_subtitles()`: `request` **Changed** * `plex_api.library.add_subtitles()`: `request` **Changed** * `plex_api.library.get_stream()`: * `request.auto_adjust_subtitle` **Changed** * `plex_api.library.start_bif_generation()`: * `request.force` **Changed** * `plex_api.library.detect_credits()`: `request` **Changed** * `plex_api.ultra_blur.get_image()`: * `request.noise` **Changed** * `plex_api.library.generate_thumbs()`: * `request.force` **Changed** * `plex_api.updater.apply_updates()`: `request` **Changed** * `plex_api.updater.check_updates()`: * `request.download` **Changed** * `plex_api.library.delete_metadata_item()`: * `request.proxy` **Changed** * `plex_api.library.optimize_database()`: * `request.async` **Changed** * `plex_api.hubs.update_hub_visibility()`: `request` **Changed** * `plex_api.hubs.create_custom_hub()`: `request` **Changed** * `plex_api.library.get_section_image()`: * `request.media_query` **Changed** * `plex_api.download_queue.add_download_queue_items()`: `request` **Changed** * `plex_api.timeline.report()`: `request` **Changed** * `plex_api.general.get_source_connection_information()`: * `request.refresh` **Changed** * `plex_api.plex.get-server-resources()`: **Added** * `plex_api.users.get-users()`: **Added**
4535 lines
211 KiB
Markdown
4535 lines
211 KiB
Markdown
# Library
|
|
(*library*)
|
|
|
|
## Overview
|
|
|
|
Library endpoints which are outside of the Media Provider API. Typically this is manipulation of the library (adding/removing sections, modifying preferences, etc).
|
|
|
|
### Available Operations
|
|
|
|
* [get_library_items](#get_library_items) - Get all items in library
|
|
* [delete_caches](#delete_caches) - Delete library caches
|
|
* [clean_bundles](#clean_bundles) - Clean bundles
|
|
* [ingest_transient_item](#ingest_transient_item) - Ingest a transient item
|
|
* [get_library_matches](#get_library_matches) - Get library matches
|
|
* [optimize_database](#optimize_database) - Optimize the Database
|
|
* [get_random_artwork](#get_random_artwork) - Get random artwork
|
|
* [get_sections](#get_sections) - Get library sections (main Media Provider Only)
|
|
* [add_section](#add_section) - Add a library section
|
|
* [stop_all_refreshes](#stop_all_refreshes) - Stop refresh
|
|
* [get_sections_prefs](#get_sections_prefs) - Get section prefs
|
|
* [refresh_sections_metadata](#refresh_sections_metadata) - Refresh all sections
|
|
* [get_tags](#get_tags) - Get all library tags of a type
|
|
* [delete_metadata_item](#delete_metadata_item) - Delete a metadata item
|
|
* [edit_metadata_item](#edit_metadata_item) - Edit a metadata item
|
|
* [detect_ads](#detect_ads) - Ad-detect an item
|
|
* [get_all_item_leaves](#get_all_item_leaves) - Get the leaves of an item
|
|
* [analyze_metadata](#analyze_metadata) - Analyze an item
|
|
* [generate_thumbs](#generate_thumbs) - Generate thumbs of chapters for an item
|
|
* [detect_credits](#detect_credits) - Credit detect a metadata item
|
|
* [get_extras](#get_extras) - Get an item's extras
|
|
* [add_extras](#add_extras) - Add to an item's extras
|
|
* [get_file](#get_file) - Get a file from a metadata or media bundle
|
|
* [start_bif_generation](#start_bif_generation) - Start BIF generation of an item
|
|
* [detect_intros](#detect_intros) - Intro detect an item
|
|
* [create_marker](#create_marker) - Create a marker
|
|
* [match_item](#match_item) - Match a metadata item
|
|
* [list_matches](#list_matches) - Get metadata matches for an item
|
|
* [merge_items](#merge_items) - Merge a metadata item
|
|
* [list_sonically_similar](#list_sonically_similar) - Get nearest tracks to metadata item
|
|
* [set_item_preferences](#set_item_preferences) - Set metadata preferences
|
|
* [refresh_items_metadata](#refresh_items_metadata) - Refresh a metadata item
|
|
* [get_related_items](#get_related_items) - Get related items
|
|
* [list_similar](#list_similar) - Get similar items
|
|
* [split_item](#split_item) - Split a metadata item
|
|
* [add_subtitles](#add_subtitles) - Add subtitles
|
|
* [get_item_tree](#get_item_tree) - Get metadata items as a tree
|
|
* [unmatch](#unmatch) - Unmatch a metadata item
|
|
* [list_top_users](#list_top_users) - Get metadata top users
|
|
* [detect_voice_activity](#detect_voice_activity) - Detect voice activity
|
|
* [get_augmentation_status](#get_augmentation_status) - Get augmentation status
|
|
* [set_stream_selection](#set_stream_selection) - Set stream selection
|
|
* [get_person](#get_person) - Get person details
|
|
* [list_person_media](#list_person_media) - Get media for a person
|
|
* [delete_library_section](#delete_library_section) - Delete a library section
|
|
* [get_library_details](#get_library_details) - Get a library section by id
|
|
* [edit_section](#edit_section) - Edit a library section
|
|
* [update_items](#update_items) - Set the fields of the filtered items
|
|
* [start_analysis](#start_analysis) - Analyze a section
|
|
* [autocomplete](#autocomplete) - Get autocompletions for search
|
|
* [get_collections](#get_collections) - Get collections in a section
|
|
* [get_common](#get_common) - Get common fields for items
|
|
* [empty_trash](#empty_trash) - Empty section trash
|
|
* [get_section_filters](#get_section_filters) - Get section filters
|
|
* [get_first_characters](#get_first_characters) - Get list of first characters
|
|
* [delete_indexes](#delete_indexes) - Delete section indexes
|
|
* [delete_intros](#delete_intros) - Delete section intro markers
|
|
* [get_section_preferences](#get_section_preferences) - Get section prefs
|
|
* [set_section_preferences](#set_section_preferences) - Set section prefs
|
|
* [cancel_refresh](#cancel_refresh) - Cancel section refresh
|
|
* [refresh_section](#refresh_section) - Refresh section
|
|
* [get_available_sorts](#get_available_sorts) - Get a section sorts
|
|
* [get_stream_levels](#get_stream_levels) - Get loudness about a stream in json
|
|
* [get_stream_loudness](#get_stream_loudness) - Get loudness about a stream
|
|
* [get_chapter_image](#get_chapter_image) - Get a chapter image
|
|
* [set_item_artwork](#set_item_artwork) - Set an item's artwork, theme, etc
|
|
* [update_item_artwork](#update_item_artwork) - Set an item's artwork, theme, etc
|
|
* [delete_marker](#delete_marker) - Delete a marker
|
|
* [edit_marker](#edit_marker) - Edit a marker
|
|
* [delete_media_item](#delete_media_item) - Delete a media item
|
|
* [get_part_index](#get_part_index) - Get BIF index for a part
|
|
* [delete_collection](#delete_collection) - Delete a collection
|
|
* [get_section_image](#get_section_image) - Get a section composite image
|
|
* [delete_stream](#delete_stream) - Delete a stream
|
|
* [get_stream](#get_stream) - Get a stream
|
|
* [set_stream_offset](#set_stream_offset) - Set a stream offset
|
|
* [get_item_artwork](#get_item_artwork) - Get an item's artwork, theme, etc
|
|
* [get_media_part](#get_media_part) - Get a media part
|
|
* [get_image_from_bif](#get_image_from_bif) - Get an image from part BIF
|
|
|
|
## get_library_items
|
|
|
|
Request all metadata items according to a query.
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getLibraryItems" method="get" path="/library/all" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_library_items(request={
|
|
"media_query": {
|
|
"type": components.MediaType.EPISODE,
|
|
"source_type": 2,
|
|
"sort": "duration:desc,index",
|
|
},
|
|
})
|
|
|
|
assert res.media_container_with_metadata is not None
|
|
|
|
# Handle response
|
|
print(res.media_container_with_metadata)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetLibraryItemsRequest](../../models/operations/getlibraryitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetLibraryItemsResponse](../../models/operations/getlibraryitemsresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## delete_caches
|
|
|
|
Delete the hub caches so they are recomputed on next request
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="deleteCaches" method="delete" path="/library/caches" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
|
|
|
|
with PlexAPI(
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.delete_caches()
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.DeleteCachesResponse](../../models/operations/deletecachesresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## clean_bundles
|
|
|
|
Clean out any now unused bundles. Bundles can become unused when media is deleted
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="cleanBundles" method="put" path="/library/clean/bundles" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
|
|
|
|
with PlexAPI(
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.clean_bundles()
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.CleanBundlesResponse](../../models/operations/cleanbundlesresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## ingest_transient_item
|
|
|
|
This endpoint takes a file path specified in the `url` parameter, matches it using the scanner's match mechanism, downloads rich metadata, and then ingests the item as a transient item (without a library section). In the case where the file represents an episode, the entire tree (show, season, and episode) is added as transient items. At this time, movies and episodes are the only supported types, which are gleaned automatically from the file path.
|
|
Note that any of the parameters passed to the metadata details endpoint (e.g. `includeExtras=1`) work here.
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="ingestTransientItem" method="post" path="/library/file" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components, operations
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.ingest_transient_item(request=operations.IngestTransientItemRequest(
|
|
url="file:///storage%2Femulated%2F0%2FArcher-S01E01.mkv",
|
|
virtual_file_path="/Avatar.mkv",
|
|
compute_hashes=components.BoolInt.TRUE,
|
|
ingest_non_matches=components.BoolInt.TRUE,
|
|
))
|
|
|
|
assert res.media_container_with_metadata is not None
|
|
|
|
# Handle response
|
|
print(res.media_container_with_metadata)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.IngestTransientItemRequest](../../models/operations/ingesttransientitemrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.IngestTransientItemResponse](../../models/operations/ingesttransientitemresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_library_matches
|
|
|
|
The matches endpoint is used to match content external to the library with content inside the library. This is done by passing a series of semantic "hints" about the content (its type, name, or release year). Each type (e.g. movie) has a canonical set of minimal required hints.
|
|
This ability to match content is useful in a variety of scenarios. For example, in the DVR, the EPG uses the endpoint to match recording rules against airing content. And in the cloud, the UMP uses the endpoint to match up a piece of media with rich metadata.
|
|
The endpoint response can including multiple matches, if there is ambiguity, each one containing a `score` from 0 to 100. For somewhat historical reasons, anything over 85 is considered a positive match (we prefer false negatives over false positives in general for matching).
|
|
The `guid` hint is somewhat special, in that it generally represents a unique identity for a piece of media (e.g. the IMDB `ttXXX`) identifier, in contrast with other hints which can be much more ambiguous (e.g. a title of `Jane Eyre`, which could refer to the 1943 or the 2011 version).
|
|
Episodes require either a season/episode pair, or an air date (or both). Either the path must be sent, or the show title
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getLibraryMatches" method="get" path="/library/matches" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components, operations
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_library_matches(request=operations.GetLibraryMatchesRequest(
|
|
type=components.MediaType.TV_SHOW,
|
|
include_full_metadata=components.BoolInt.TRUE,
|
|
include_ancestor_metadata=components.BoolInt.TRUE,
|
|
include_alternate_metadata_sources=components.BoolInt.TRUE,
|
|
))
|
|
|
|
assert res.media_container_with_metadata is not None
|
|
|
|
# Handle response
|
|
print(res.media_container_with_metadata)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.GetLibraryMatchesRequest](../../models/operations/getlibrarymatchesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetLibraryMatchesResponse](../../models/operations/getlibrarymatchesresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## optimize_database
|
|
|
|
Initiate optimize on the database.
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="optimizeDatabase" method="put" path="/library/optimize" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.optimize_database(request={
|
|
"async_": components.BoolInt.TRUE,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.OptimizeDatabaseRequest](../../models/operations/optimizedatabaserequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.OptimizeDatabaseResponse](../../models/operations/optimizedatabaseresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_random_artwork
|
|
|
|
Get random artwork across sections. This is commonly used for a screensaver.
|
|
|
|
This retrieves 100 random artwork paths in the specified sections and returns them. Restrictions are put in place to not return artwork for items the user is not allowed to access. Artwork will be for Movies, Shows, and Artists only.
|
|
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getRandomArtwork" method="get" path="/library/randomArtwork" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_random_artwork(request={
|
|
"sections": [
|
|
5,
|
|
6,
|
|
],
|
|
})
|
|
|
|
assert res.media_container_with_artwork is not None
|
|
|
|
# Handle response
|
|
print(res.media_container_with_artwork)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetRandomArtworkRequest](../../models/operations/getrandomartworkrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetRandomArtworkResponse](../../models/operations/getrandomartworkresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_sections
|
|
|
|
A library section (commonly referred to as just a library) is a collection of media. Libraries are typed, and depending on their type provide either a flat or a hierarchical view of the media. For example, a music library has an artist > albums > tracks structure, whereas a movie library is flat.
|
|
Libraries have features beyond just being a collection of media; for starters, they include information about supported types, filters and sorts. This allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year).
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getSections" method="get" path="/library/sections/all" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
|
|
|
|
with PlexAPI(
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_sections()
|
|
|
|
assert res.object is not None
|
|
|
|
# Handle response
|
|
print(res.object)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetSectionsResponse](../../models/operations/getsectionsresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## add_section
|
|
|
|
Add a new library section to the server
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="addSection" method="post" path="/library/sections/all" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components, operations
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.add_section(request=operations.AddSectionRequest(
|
|
name="<value>",
|
|
type=39544,
|
|
agent="<value>",
|
|
language="<value>",
|
|
locations=[
|
|
"O:\fatboy\\Media\\Ripped\\Music",
|
|
"O:\fatboy\\Media\\My Music",
|
|
],
|
|
prefs=operations.QueryParamPrefs(),
|
|
relative=components.BoolInt.TRUE,
|
|
import_fromi_tunes=components.BoolInt.TRUE,
|
|
))
|
|
|
|
assert res.slash_get_responses_200 is not None
|
|
|
|
# Handle response
|
|
print(res.slash_get_responses_200)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
| `request` | [operations.AddSectionRequest](../../models/operations/addsectionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.AddSectionResponse](../../models/operations/addsectionresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## stop_all_refreshes
|
|
|
|
Stop all refreshes across all sections
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="stopAllRefreshes" method="delete" path="/library/sections/all/refresh" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
|
|
|
|
with PlexAPI(
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.stop_all_refreshes()
|
|
|
|
assert res.library_sections is not None
|
|
|
|
# Handle response
|
|
print(res.library_sections)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.StopAllRefreshesResponse](../../models/operations/stopallrefreshesresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_sections_prefs
|
|
|
|
Get a section's preferences for a metadata type
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getSectionsPrefs" method="get" path="/library/sections/prefs" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_sections_prefs(request={
|
|
"type": 460221,
|
|
})
|
|
|
|
assert res.library_sections is not None
|
|
|
|
# Handle response
|
|
print(res.library_sections)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetSectionsPrefsRequest](../../models/operations/getsectionsprefsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetSectionsPrefsResponse](../../models/operations/getsectionsprefsresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## refresh_sections_metadata
|
|
|
|
Tell PMS to refresh all section metadata
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="refreshSectionsMetadata" method="post" path="/library/sections/refresh" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.refresh_sections_metadata(request={})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.RefreshSectionsMetadataRequest](../../models/operations/refreshsectionsmetadatarequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.RefreshSectionsMetadataResponse](../../models/operations/refreshsectionsmetadataresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_tags
|
|
|
|
Get all library tags of a type
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getTags" method="get" path="/library/tags" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_tags(request={
|
|
"type": components.MediaType.TV_SHOW,
|
|
})
|
|
|
|
assert res.object is not None
|
|
|
|
# Handle response
|
|
print(res.object)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
|
|
| `request` | [operations.GetTagsRequest](../../models/operations/gettagsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetTagsResponse](../../models/operations/gettagsresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## delete_metadata_item
|
|
|
|
Delete a single metadata item from the library, deleting media as well
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="deleteMetadataItem" method="delete" path="/library/metadata/{ids}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.delete_metadata_item(request={
|
|
"ids": "<value>",
|
|
"proxy": components.BoolInt.TRUE,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.DeleteMetadataItemRequest](../../models/operations/deletemetadataitemrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.DeleteMetadataItemResponse](../../models/operations/deletemetadataitemresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## edit_metadata_item
|
|
|
|
Edit metadata items setting fields
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="editMetadataItem" method="put" path="/library/metadata/{ids}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.edit_metadata_item(request={
|
|
"ids": [
|
|
"<value 1>",
|
|
"<value 2>",
|
|
],
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.EditMetadataItemRequest](../../models/operations/editmetadataitemrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.EditMetadataItemResponse](../../models/operations/editmetadataitemresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## detect_ads
|
|
|
|
Start the detection of ads in a metadata item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="detectAds" method="put" path="/library/metadata/{ids}/addetect" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.detect_ads(request={
|
|
"ids": "<value>",
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
|
| `request` | [operations.DetectAdsRequest](../../models/operations/detectadsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.DetectAdsResponse](../../models/operations/detectadsresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_all_item_leaves
|
|
|
|
Get the leaves for a metadata item such as the episodes in a show
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getAllItemLeaves" method="get" path="/library/metadata/{ids}/allLeaves" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_all_item_leaves(request={
|
|
"ids": "<value>",
|
|
})
|
|
|
|
assert res.media_container_with_metadata is not None
|
|
|
|
# Handle response
|
|
print(res.media_container_with_metadata)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetAllItemLeavesRequest](../../models/operations/getallitemleavesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetAllItemLeavesResponse](../../models/operations/getallitemleavesresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## analyze_metadata
|
|
|
|
Start the analysis of a metadata item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="analyzeMetadata" method="put" path="/library/metadata/{ids}/analyze" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.analyze_metadata(request={
|
|
"ids": "<value>",
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.AnalyzeMetadataRequest](../../models/operations/analyzemetadatarequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.AnalyzeMetadataResponse](../../models/operations/analyzemetadataresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## generate_thumbs
|
|
|
|
Start the chapter thumb generation for an item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="generateThumbs" method="put" path="/library/metadata/{ids}/chapterThumbs" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.generate_thumbs(request={
|
|
"ids": "<value>",
|
|
"force": components.BoolInt.TRUE,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.GenerateThumbsRequest](../../models/operations/generatethumbsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GenerateThumbsResponse](../../models/operations/generatethumbsresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## detect_credits
|
|
|
|
Start credit detection on a metadata item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="detectCredits" method="put" path="/library/metadata/{ids}/credits" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components, operations
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.detect_credits(request=operations.DetectCreditsRequest(
|
|
ids="<value>",
|
|
force=components.BoolInt.TRUE,
|
|
manual=components.BoolInt.TRUE,
|
|
))
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
| `request` | [operations.DetectCreditsRequest](../../models/operations/detectcreditsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.DetectCreditsResponse](../../models/operations/detectcreditsresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_extras
|
|
|
|
Get the extras for a metadata item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getExtras" method="get" path="/library/metadata/{ids}/extras" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_extras(request={
|
|
"ids": "<value>",
|
|
})
|
|
|
|
assert res.media_container_with_metadata is not None
|
|
|
|
# Handle response
|
|
print(res.media_container_with_metadata)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetExtrasRequest](../../models/operations/getextrasrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetExtrasResponse](../../models/operations/getextrasresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## add_extras
|
|
|
|
Add an extra to a metadata item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="addExtras" method="post" path="/library/metadata/{ids}/extras" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.add_extras(request={
|
|
"ids": "<value>",
|
|
"url": "https://super-mortise.biz/",
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
|
| `request` | [operations.AddExtrasRequest](../../models/operations/addextrasrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.AddExtrasResponse](../../models/operations/addextrasresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_file
|
|
|
|
Get a bundle file for a metadata or media item. This is either an image or a mp3 (for a show's theme)
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getFile" method="get" path="/library/metadata/{ids}/file" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_file(request={
|
|
"ids": "<value>",
|
|
})
|
|
|
|
assert res.two_hundred_audio_mpeg3_response_stream is not None
|
|
|
|
# Handle response
|
|
print(res.two_hundred_audio_mpeg3_response_stream)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
|
|
| `request` | [operations.GetFileRequest](../../models/operations/getfilerequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetFileResponse](../../models/operations/getfileresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## start_bif_generation
|
|
|
|
Start the indexing (BIF generation) of an item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="startBifGeneration" method="put" path="/library/metadata/{ids}/index" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.start_bif_generation(request={
|
|
"ids": "<value>",
|
|
"force": components.BoolInt.TRUE,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.StartBifGenerationRequest](../../models/operations/startbifgenerationrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.StartBifGenerationResponse](../../models/operations/startbifgenerationresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## detect_intros
|
|
|
|
Start the detection of intros in a metadata item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="detectIntros" method="put" path="/library/metadata/{ids}/intro" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.detect_intros(request={
|
|
"ids": "<value>",
|
|
"force": components.BoolInt.TRUE,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
| `request` | [operations.DetectIntrosRequest](../../models/operations/detectintrosrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.DetectIntrosResponse](../../models/operations/detectintrosresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## create_marker
|
|
|
|
Create a marker for this user on the metadata item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="createMarker" method="post" path="/library/metadata/{ids}/marker" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.create_marker(request={
|
|
"ids": "<value>",
|
|
"type": 248391,
|
|
"start_time_offset": 535191,
|
|
"attributes": {},
|
|
})
|
|
|
|
assert res.object is not None
|
|
|
|
# Handle response
|
|
print(res.object)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
| `request` | [operations.CreateMarkerRequest](../../models/operations/createmarkerrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.CreateMarkerResponse](../../models/operations/createmarkerresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## match_item
|
|
|
|
Match a metadata item to a guid
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="matchItem" method="put" path="/library/metadata/{ids}/match" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.match_item(request={
|
|
"ids": "<value>",
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
|
| `request` | [operations.MatchItemRequest](../../models/operations/matchitemrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.MatchItemResponse](../../models/operations/matchitemresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## list_matches
|
|
|
|
Get the list of metadata matches for a metadata item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="listMatches" method="put" path="/library/metadata/{ids}/matches" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.list_matches(request={
|
|
"ids": "<value>",
|
|
"manual": components.BoolInt.TRUE,
|
|
})
|
|
|
|
assert res.media_container_with_metadata is not None
|
|
|
|
# Handle response
|
|
print(res.media_container_with_metadata)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
|
|
| `request` | [operations.ListMatchesRequest](../../models/operations/listmatchesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.ListMatchesResponse](../../models/operations/listmatchesresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## merge_items
|
|
|
|
Merge a metadata item with other items
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="mergeItems" method="put" path="/library/metadata/{ids}/merge" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.merge_items(request={
|
|
"ids_path_parameter": "<value>",
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
| `request` | [operations.MergeItemsRequest](../../models/operations/mergeitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.MergeItemsResponse](../../models/operations/mergeitemsresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## list_sonically_similar
|
|
|
|
Get the nearest tracks, sonically, to the provided track
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="listSonicallySimilar" method="get" path="/library/metadata/{ids}/nearest" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.list_sonically_similar(request={
|
|
"ids": "<value>",
|
|
})
|
|
|
|
assert res.media_container_with_metadata is not None
|
|
|
|
# Handle response
|
|
print(res.media_container_with_metadata)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.ListSonicallySimilarRequest](../../models/operations/listsonicallysimilarrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.ListSonicallySimilarResponse](../../models/operations/listsonicallysimilarresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## set_item_preferences
|
|
|
|
Set the preferences on a metadata item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="setItemPreferences" method="put" path="/library/metadata/{ids}/prefs" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.set_item_preferences(request={
|
|
"ids": "<value>",
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.SetItemPreferencesRequest](../../models/operations/setitempreferencesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.SetItemPreferencesResponse](../../models/operations/setitempreferencesresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## refresh_items_metadata
|
|
|
|
Refresh a metadata item from the agent
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="refreshItemsMetadata" method="put" path="/library/metadata/{ids}/refresh" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.refresh_items_metadata(request={
|
|
"ids": "<value>",
|
|
"mark_updated": components.BoolInt.TRUE,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.RefreshItemsMetadataRequest](../../models/operations/refreshitemsmetadatarequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.RefreshItemsMetadataResponse](../../models/operations/refreshitemsmetadataresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_related_items
|
|
|
|
Get a hub of related items to a metadata item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getRelatedItems" method="get" path="/library/metadata/{ids}/related" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_related_items(request={
|
|
"ids": "<value>",
|
|
})
|
|
|
|
assert res.object is not None
|
|
|
|
# Handle response
|
|
print(res.object)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetRelatedItemsRequest](../../models/operations/getrelateditemsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetRelatedItemsResponse](../../models/operations/getrelateditemsresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## list_similar
|
|
|
|
Get a list of similar items to a metadata item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="listSimilar" method="get" path="/library/metadata/{ids}/similar" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.list_similar(request={
|
|
"ids": "<value>",
|
|
})
|
|
|
|
assert res.media_container_with_metadata is not None
|
|
|
|
# Handle response
|
|
print(res.media_container_with_metadata)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
|
|
| `request` | [operations.ListSimilarRequest](../../models/operations/listsimilarrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.ListSimilarResponse](../../models/operations/listsimilarresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## split_item
|
|
|
|
Split a metadata item into multiple items
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="splitItem" method="put" path="/library/metadata/{ids}/split" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.split_item(request={
|
|
"ids": "<value>",
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
|
| `request` | [operations.SplitItemRequest](../../models/operations/splititemrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.SplitItemResponse](../../models/operations/splititemresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## add_subtitles
|
|
|
|
Add a subtitle to a metadata item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="addSubtitles" method="get" path="/library/metadata/{ids}/subtitles" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components, operations
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.add_subtitles(request=operations.AddSubtitlesRequest(
|
|
ids="<value>",
|
|
forced=components.BoolInt.TRUE,
|
|
hearing_impaired=components.BoolInt.TRUE,
|
|
))
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
| `request` | [operations.AddSubtitlesRequest](../../models/operations/addsubtitlesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.AddSubtitlesResponse](../../models/operations/addsubtitlesresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_item_tree
|
|
|
|
Get a tree of metadata items, such as the seasons/episodes of a show
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getItemTree" method="get" path="/library/metadata/{ids}/tree" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_item_tree(request={
|
|
"ids": "<value>",
|
|
})
|
|
|
|
assert res.media_container_with_nested_metadata is not None
|
|
|
|
# Handle response
|
|
print(res.media_container_with_nested_metadata)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
|
|
| `request` | [operations.GetItemTreeRequest](../../models/operations/getitemtreerequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetItemTreeResponse](../../models/operations/getitemtreeresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## unmatch
|
|
|
|
Unmatch a metadata item to info fetched from the agent
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="unmatch" method="put" path="/library/metadata/{ids}/unmatch" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.unmatch(request={
|
|
"ids": "<value>",
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
|
|
| `request` | [operations.UnmatchRequest](../../models/operations/unmatchrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.UnmatchResponse](../../models/operations/unmatchresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## list_top_users
|
|
|
|
Get the list of users which have played this item starting with the most
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="listTopUsers" method="get" path="/library/metadata/{ids}/users/top" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.list_top_users(request={
|
|
"ids": "<value>",
|
|
})
|
|
|
|
assert res.object is not None
|
|
|
|
# Handle response
|
|
print(res.object)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
| `request` | [operations.ListTopUsersRequest](../../models/operations/listtopusersrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.ListTopUsersResponse](../../models/operations/listtopusersresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## detect_voice_activity
|
|
|
|
Start the detection of voice in a metadata item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="detectVoiceActivity" method="put" path="/library/metadata/{ids}/voiceActivity" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components, operations
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.detect_voice_activity(request=operations.DetectVoiceActivityRequest(
|
|
ids="<value>",
|
|
force=components.BoolInt.TRUE,
|
|
manual=components.BoolInt.TRUE,
|
|
))
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.DetectVoiceActivityRequest](../../models/operations/detectvoiceactivityrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.DetectVoiceActivityResponse](../../models/operations/detectvoiceactivityresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_augmentation_status
|
|
|
|
Get augmentation status and potentially wait for completion
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getAugmentationStatus" method="get" path="/library/metadata/augmentations/{augmentationId}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_augmentation_status(request={
|
|
"augmentation_id": "<id>",
|
|
"wait": components.BoolInt.TRUE,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetAugmentationStatusRequest](../../models/operations/getaugmentationstatusrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetAugmentationStatusResponse](../../models/operations/getaugmentationstatusresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## set_stream_selection
|
|
|
|
Set which streams (audio/subtitle) are selected by this user
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="setStreamSelection" method="put" path="/library/parts/{partId}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.set_stream_selection(request={
|
|
"part_id": 360489,
|
|
"all_parts": components.BoolInt.TRUE,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.SetStreamSelectionRequest](../../models/operations/setstreamselectionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.SetStreamSelectionResponse](../../models/operations/setstreamselectionresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_person
|
|
|
|
Get details for a single actor.
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getPerson" method="get" path="/library/people/{personId}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_person(request={
|
|
"person_id": "<id>",
|
|
})
|
|
|
|
assert res.object is not None
|
|
|
|
# Handle response
|
|
print(res.object)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetPersonRequest](../../models/operations/getpersonrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetPersonResponse](../../models/operations/getpersonresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## list_person_media
|
|
|
|
Get all the media for a single actor.
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="listPersonMedia" method="get" path="/library/people/{personId}/media" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.list_person_media(request={
|
|
"person_id": "<id>",
|
|
})
|
|
|
|
assert res.media_container_with_metadata is not None
|
|
|
|
# Handle response
|
|
print(res.media_container_with_metadata)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.ListPersonMediaRequest](../../models/operations/listpersonmediarequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.ListPersonMediaResponse](../../models/operations/listpersonmediaresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## delete_library_section
|
|
|
|
Delete a library section by id
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="deleteLibrarySection" method="delete" path="/library/sections/{sectionId}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.delete_library_section(request={
|
|
"section_id": "<id>",
|
|
"async_": components.BoolInt.TRUE,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.DeleteLibrarySectionRequest](../../models/operations/deletelibrarysectionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.DeleteLibrarySectionResponse](../../models/operations/deletelibrarysectionresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_library_details
|
|
|
|
Returns details for the library. This can be thought of as an interstitial endpoint because it contains information about the library, rather than content itself. It often contains a list of `Directory` metadata objects: These used to be used by clients to build a menuing system.
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getLibraryDetails" method="get" path="/library/sections/{sectionId}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_library_details(request={
|
|
"section_id": "<id>",
|
|
"include_details": components.BoolInt.TRUE,
|
|
})
|
|
|
|
assert res.object is not None
|
|
|
|
# Handle response
|
|
print(res.object)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.GetLibraryDetailsRequest](../../models/operations/getlibrarydetailsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetLibraryDetailsResponse](../../models/operations/getlibrarydetailsresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## edit_section
|
|
|
|
Edit a library section by id setting parameters
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="editSection" method="put" path="/library/sections/{sectionId}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.edit_section(request={
|
|
"section_id": "<id>",
|
|
"agent": "<value>",
|
|
"locations": [
|
|
"O:\fatboy\\Media\\Ripped\\Music",
|
|
"O:\fatboy\\Media\\My Music",
|
|
],
|
|
"prefs": {},
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
|
|
| `request` | [operations.EditSectionRequest](../../models/operations/editsectionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.EditSectionResponse](../../models/operations/editsectionresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## update_items
|
|
|
|
This endpoint takes an large possible set of values. Here are some examples.
|
|
- **Parameters, extra documentation**
|
|
- artist.title.value
|
|
- When used with track, both artist.title.value and album.title.value need to be specified
|
|
- title.value usage
|
|
- Summary
|
|
- Tracks always rename and never merge
|
|
- Albums and Artists
|
|
- if single item and item without title does not exist, it is renamed.
|
|
- if single item and item with title does exist they are merged.
|
|
- if multiple they are always merged.
|
|
- Tracks
|
|
- Works as expected will update the track's title
|
|
- Single track: `/library/sections/{id}/all?type=10&id=42&title.value=NewName`
|
|
- Multiple tracks: `/library/sections/{id}/all?type=10&id=42,43,44&title.value=NewName`
|
|
- All tracks: `/library/sections/{id}/all?type=10&title.value=NewName`
|
|
- Albums
|
|
- Functionality changes depending on the existence of an album with the same title
|
|
- Album exists
|
|
- Single album: `/library/sections/{id}/all?type=9&id=42&title.value=Album 2`
|
|
- Album with id 42 is merged into album titled "Album 2"
|
|
- Multiple/All albums: `/library/sections/{id}/all?type=9&title.value=Moo Album`
|
|
- All albums are merged into the existing album titled "Moo Album"
|
|
- Album does not exist
|
|
- Single album: `/library/sections/{id}/all?type=9&id=42&title.value=NewAlbumTitle`
|
|
- Album with id 42 has title modified to "NewAlbumTitle"
|
|
- Multiple/All albums: `/library/sections/{id}/all?type=9&title.value=NewAlbumTitle`
|
|
- All albums are merged into a new album with title="NewAlbumTitle"
|
|
- Artists
|
|
- Functionaly changes depending on the existence of an artist with the same title.
|
|
- Artist exists
|
|
- Single artist: `/library/sections/{id}/all?type=8&id=42&title.value=Artist 2`
|
|
- Artist with id 42 is merged into existing artist titled "Artist 2"
|
|
- Multiple/All artists: `/library/sections/{id}/all?type=8&title.value=Artist 3`
|
|
- All artists are merged into the existing artist titled "Artist 3"
|
|
- Artist does not exist
|
|
- Single artist: `/library/sections/{id}/all?type=8&id=42&title.value=NewArtistTitle`
|
|
- Artist with id 42 has title modified to "NewArtistTitle"
|
|
- Multiple/All artists: `/library/sections/{id}/all?type=8&title.value=NewArtistTitle`
|
|
- All artists are merged into a new artist with title="NewArtistTitle"
|
|
|
|
- **Notes**
|
|
- Technically square brackets are not allowed in an URI except the Internet Protocol Literal Address
|
|
- RFC3513: A host identified by an Internet Protocol literal address, version 6 [RFC3513] or later, is distinguished by enclosing the IP literal within square brackets ("[" and "]"). This is the only place where square bracket characters are allowed in the URI syntax.
|
|
- Escaped square brackets are allowed, but don't render well
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="updateItems" method="put" path="/library/sections/{sectionId}/all" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.update_items(request={
|
|
"section_id": "<id>",
|
|
"field_locked": components.BoolInt.TRUE,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
|
|
| `request` | [operations.UpdateItemsRequest](../../models/operations/updateitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.UpdateItemsResponse](../../models/operations/updateitemsresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## start_analysis
|
|
|
|
Start analysis of all items in a section. If BIF generation is enabled, this will also be started on this section
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="startAnalysis" method="put" path="/library/sections/{sectionId}/analyze" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.start_analysis(request={
|
|
"section_id": 158829,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
| `request` | [operations.StartAnalysisRequest](../../models/operations/startanalysisrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.StartAnalysisResponse](../../models/operations/startanalysisresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## autocomplete
|
|
|
|
The field to autocomplete on is specified by the `{field}.query` parameter. For example `genre.query` or `title.query`.
|
|
Returns a set of items from the filtered items whose `{field}` starts with `{field}.query`. In the results, a `{field}.queryRange` will be present to express the range of the match
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="autocomplete" method="get" path="/library/sections/{sectionId}/autocomplete" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.autocomplete(request={
|
|
"section_id": 942007,
|
|
"media_query": {
|
|
"type": components.MediaType.EPISODE,
|
|
"source_type": 2,
|
|
"sort": "duration:desc,index",
|
|
},
|
|
})
|
|
|
|
assert res.media_container_with_metadata is not None
|
|
|
|
# Handle response
|
|
print(res.media_container_with_metadata)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
| `request` | [operations.AutocompleteRequest](../../models/operations/autocompleterequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.AutocompleteResponse](../../models/operations/autocompleteresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_collections
|
|
|
|
Get all collections in a section
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getCollections" method="get" path="/library/sections/{sectionId}/collections" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_collections(request={
|
|
"section_id": 348838,
|
|
"media_query": {
|
|
"type": components.MediaType.EPISODE,
|
|
"source_type": 2,
|
|
"sort": "duration:desc,index",
|
|
},
|
|
})
|
|
|
|
assert res.media_container_with_metadata is not None
|
|
|
|
# Handle response
|
|
print(res.media_container_with_metadata)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.GetCollectionsRequest](../../models/operations/getcollectionsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetCollectionsResponse](../../models/operations/getcollectionsresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_common
|
|
|
|
Represents a "Common" item. It contains only the common attributes of the items selected by the provided filter
|
|
Fields which are not common will be expressed in the `mixedFields` field
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getCommon" method="get" path="/library/sections/{sectionId}/common" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_common(request={
|
|
"section_id": 298154,
|
|
"media_query": {
|
|
"type": components.MediaType.EPISODE,
|
|
"source_type": 2,
|
|
"sort": "duration:desc,index",
|
|
},
|
|
})
|
|
|
|
assert res.media_container_with_metadata is not None
|
|
|
|
# Handle response
|
|
print(res.media_container_with_metadata)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetCommonRequest](../../models/operations/getcommonrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetCommonResponse](../../models/operations/getcommonresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## empty_trash
|
|
|
|
Empty trash in the section, permanently deleting media/metadata for missing media
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="emptyTrash" method="put" path="/library/sections/{sectionId}/emptyTrash" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.empty_trash(request={
|
|
"section_id": 30052,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
| `request` | [operations.EmptyTrashRequest](../../models/operations/emptytrashrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.EmptyTrashResponse](../../models/operations/emptytrashresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_section_filters
|
|
|
|
Get common filters on a section
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getSectionFilters" method="get" path="/library/sections/{sectionId}/filters" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_section_filters(request={
|
|
"section_id": 380557,
|
|
})
|
|
|
|
assert res.object is not None
|
|
|
|
# Handle response
|
|
print(res.object)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.GetSectionFiltersRequest](../../models/operations/getsectionfiltersrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetSectionFiltersResponse](../../models/operations/getsectionfiltersresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_first_characters
|
|
|
|
Get list of first characters in this section
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getFirstCharacters" method="get" path="/library/sections/{sectionId}/firstCharacters" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_first_characters(request={
|
|
"section_id": 3947,
|
|
"media_query": {
|
|
"type": components.MediaType.EPISODE,
|
|
"source_type": 2,
|
|
"sort": "duration:desc,index",
|
|
},
|
|
})
|
|
|
|
assert res.object is not None
|
|
|
|
# Handle response
|
|
print(res.object)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetFirstCharactersRequest](../../models/operations/getfirstcharactersrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetFirstCharactersResponse](../../models/operations/getfirstcharactersresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## delete_indexes
|
|
|
|
Delete all the indexes in a section
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="deleteIndexes" method="delete" path="/library/sections/{sectionId}/indexes" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.delete_indexes(request={
|
|
"section_id": 588437,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
| `request` | [operations.DeleteIndexesRequest](../../models/operations/deleteindexesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.DeleteIndexesResponse](../../models/operations/deleteindexesresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## delete_intros
|
|
|
|
Delete all the intro markers in a section
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="deleteIntros" method="delete" path="/library/sections/{sectionId}/intros" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.delete_intros(request={
|
|
"section_id": 498656,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
| `request` | [operations.DeleteIntrosRequest](../../models/operations/deleteintrosrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.DeleteIntrosResponse](../../models/operations/deleteintrosresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_section_preferences
|
|
|
|
Get the prefs for a section by id and potentially overriding the agent
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getSectionPreferences" method="get" path="/library/sections/{sectionId}/prefs" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_section_preferences(request={
|
|
"section_id": 754869,
|
|
})
|
|
|
|
assert res.media_container_with_settings is not None
|
|
|
|
# Handle response
|
|
print(res.media_container_with_settings)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetSectionPreferencesRequest](../../models/operations/getsectionpreferencesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetSectionPreferencesResponse](../../models/operations/getsectionpreferencesresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## set_section_preferences
|
|
|
|
Set the prefs for a section by id
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="setSectionPreferences" method="put" path="/library/sections/{sectionId}/prefs" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.set_section_preferences(request={
|
|
"section_id": 349936,
|
|
"prefs": {},
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.SetSectionPreferencesRequest](../../models/operations/setsectionpreferencesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.SetSectionPreferencesResponse](../../models/operations/setsectionpreferencesresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## cancel_refresh
|
|
|
|
Cancel the refresh of a section
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="cancelRefresh" method="delete" path="/library/sections/{sectionId}/refresh" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.cancel_refresh(request={
|
|
"section_id": 326852,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
| `request` | [operations.CancelRefreshRequest](../../models/operations/cancelrefreshrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.CancelRefreshResponse](../../models/operations/cancelrefreshresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## refresh_section
|
|
|
|
Start a refresh of this section
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="refreshSection" method="post" path="/library/sections/{sectionId}/refresh" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.refresh_section(request={
|
|
"section_id": 450300,
|
|
"force": components.BoolInt.TRUE,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.RefreshSectionRequest](../../models/operations/refreshsectionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.RefreshSectionResponse](../../models/operations/refreshsectionresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_available_sorts
|
|
|
|
Get the sort mechanisms available in a section
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getAvailableSorts" method="get" path="/library/sections/{sectionId}/sorts" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_available_sorts(request={
|
|
"section_id": 212498,
|
|
})
|
|
|
|
assert res.object is not None
|
|
|
|
# Handle response
|
|
print(res.object)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.GetAvailableSortsRequest](../../models/operations/getavailablesortsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetAvailableSortsResponse](../../models/operations/getavailablesortsresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_stream_levels
|
|
|
|
The the loudness of a stream in db, one entry per 100ms
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getStreamLevels" method="get" path="/library/streams/{streamId}/levels" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_stream_levels(request={
|
|
"stream_id": 447611,
|
|
})
|
|
|
|
assert res.object is not None
|
|
|
|
# Handle response
|
|
print(res.object)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetStreamLevelsRequest](../../models/operations/getstreamlevelsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetStreamLevelsResponse](../../models/operations/getstreamlevelsresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_stream_loudness
|
|
|
|
The the loudness of a stream in db, one number per line, one entry per 100ms
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getStreamLoudness" method="get" path="/library/streams/{streamId}/loudness" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_stream_loudness(request={
|
|
"stream_id": 277271,
|
|
})
|
|
|
|
assert res.res is not None
|
|
|
|
# Handle response
|
|
print(res.res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.GetStreamLoudnessRequest](../../models/operations/getstreamloudnessrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetStreamLoudnessResponse](../../models/operations/getstreamloudnessresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_chapter_image
|
|
|
|
Get a single chapter image for a piece of media
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getChapterImage" method="get" path="/library/media/{mediaId}/chapterImages/{chapter}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_chapter_image(request={
|
|
"media_id": 892563,
|
|
"chapter": 48348,
|
|
})
|
|
|
|
assert res.response_stream is not None
|
|
|
|
# Handle response
|
|
print(res.response_stream)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetChapterImageRequest](../../models/operations/getchapterimagerequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetChapterImageResponse](../../models/operations/getchapterimageresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## set_item_artwork
|
|
|
|
Set the artwork, thumb, element for a metadata item
|
|
Generally only the admin can perform this action. The exception is if the metadata is a playlist created by the user
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="setItemArtwork" method="post" path="/library/metadata/{ids}/{element}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components, operations
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.set_item_artwork(request={
|
|
"ids": "<value>",
|
|
"element": operations.Element.BANNER,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.SetItemArtworkRequest](../../models/operations/setitemartworkrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.SetItemArtworkResponse](../../models/operations/setitemartworkresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## update_item_artwork
|
|
|
|
Set the artwork, thumb, element for a metadata item
|
|
Generally only the admin can perform this action. The exception is if the metadata is a playlist created by the user
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="updateItemArtwork" method="put" path="/library/metadata/{ids}/{element}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components, operations
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.update_item_artwork(request={
|
|
"ids": "<value>",
|
|
"element": operations.PathParamElement.CLEAR_LOGO,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.UpdateItemArtworkRequest](../../models/operations/updateitemartworkrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.UpdateItemArtworkResponse](../../models/operations/updateitemartworkresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## delete_marker
|
|
|
|
Delete a marker for this user on the metadata item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="deleteMarker" method="delete" path="/library/metadata/{ids}/marker/{marker}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.delete_marker(request={
|
|
"ids": "<value>",
|
|
"marker": "<value>",
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
| `request` | [operations.DeleteMarkerRequest](../../models/operations/deletemarkerrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.DeleteMarkerResponse](../../models/operations/deletemarkerresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## edit_marker
|
|
|
|
Edit a marker for this user on the metadata item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="editMarker" method="put" path="/library/metadata/{ids}/marker/{marker}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.edit_marker(request={
|
|
"ids": "<value>",
|
|
"marker": "<value>",
|
|
"type": 884347,
|
|
"start_time_offset": 517251,
|
|
"attributes": {},
|
|
})
|
|
|
|
assert res.post_responses_200 is not None
|
|
|
|
# Handle response
|
|
print(res.post_responses_200)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
| `request` | [operations.EditMarkerRequest](../../models/operations/editmarkerrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.EditMarkerResponse](../../models/operations/editmarkerresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## delete_media_item
|
|
|
|
Delete a single media from a metadata item in the library
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="deleteMediaItem" method="delete" path="/library/metadata/{ids}/media/{mediaItem}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.delete_media_item(request={
|
|
"ids": "<value>",
|
|
"media_item": "<value>",
|
|
"proxy": components.BoolInt.TRUE,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.DeleteMediaItemRequest](../../models/operations/deletemediaitemrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.DeleteMediaItemResponse](../../models/operations/deletemediaitemresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_part_index
|
|
|
|
Get BIF index for a part by index type
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getPartIndex" method="get" path="/library/parts/{partId}/indexes/{index}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components, operations
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_part_index(request={
|
|
"part_id": 724750,
|
|
"index": operations.Index.SD,
|
|
})
|
|
|
|
assert res.response_stream is not None
|
|
|
|
# Handle response
|
|
print(res.response_stream)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetPartIndexRequest](../../models/operations/getpartindexrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetPartIndexResponse](../../models/operations/getpartindexresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## delete_collection
|
|
|
|
Delete a library collection from the PMS
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="deleteCollection" method="delete" path="/library/sections/{sectionId}/collection/{collectionId}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.delete_collection(request={
|
|
"section_id": 283619,
|
|
"collection_id": 680895,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.DeleteCollectionRequest](../../models/operations/deletecollectionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.DeleteCollectionResponse](../../models/operations/deletecollectionresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_section_image
|
|
|
|
Get a composite image of images in this section
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getSectionImage" method="get" path="/library/sections/{sectionId}/composite/{updatedAt}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_section_image(request={
|
|
"section_id": 925611,
|
|
"updated_at": 117413,
|
|
"media_query": {
|
|
"type": components.MediaType.EPISODE,
|
|
"source_type": 2,
|
|
"sort": "duration:desc,index",
|
|
},
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetSectionImageRequest](../../models/operations/getsectionimagerequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetSectionImageResponse](../../models/operations/getsectionimageresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## delete_stream
|
|
|
|
Delete a stream. Only applies to downloaded subtitle streams or a sidecar subtitle when media deletion is enabled.
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="deleteStream" method="delete" path="/library/streams/{streamId}.{ext}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.delete_stream(request={
|
|
"stream_id": 841510,
|
|
"ext": "<value>",
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
| `request` | [operations.DeleteStreamRequest](../../models/operations/deletestreamrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.DeleteStreamResponse](../../models/operations/deletestreamresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_stream
|
|
|
|
Get a stream (such as a sidecar subtitle stream)
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getStream" method="get" path="/library/streams/{streamId}.{ext}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_stream(request={
|
|
"stream_id": 314506,
|
|
"ext": "<value>",
|
|
"auto_adjust_subtitle": components.BoolInt.TRUE,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetStreamRequest](../../models/operations/getstreamrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetStreamResponse](../../models/operations/getstreamresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## set_stream_offset
|
|
|
|
Set a stream offset in ms. This may not be respected by all clients
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="setStreamOffset" method="put" path="/library/streams/{streamId}.{ext}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.set_stream_offset(request={
|
|
"stream_id": 606295,
|
|
"ext": "<value>",
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.SetStreamOffsetRequest](../../models/operations/setstreamoffsetrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.SetStreamOffsetResponse](../../models/operations/setstreamoffsetresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_item_artwork
|
|
|
|
Get the artwork, thumb, element for a metadata item
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getItemArtwork" method="get" path="/library/metadata/{ids}/{element}/{timestamp}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components, operations
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_item_artwork(request={
|
|
"ids": "<value>",
|
|
"element": operations.GetItemArtworkPathParamElement.POSTER,
|
|
"timestamp": 999555,
|
|
})
|
|
|
|
assert res.two_hundred_audio_mpeg3_response_stream is not None
|
|
|
|
# Handle response
|
|
print(res.two_hundred_audio_mpeg3_response_stream)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.GetItemArtworkRequest](../../models/operations/getitemartworkrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetItemArtworkResponse](../../models/operations/getitemartworkresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_media_part
|
|
|
|
Get a media part for streaming or download.
|
|
- streaming: This is the default scenario. Bandwidth usage on this endpoint will be guaranteed (on the server's end) to be at least the bandwidth reservation given in the decision. If no decision exists, an ad-hoc decision will be created if sufficient bandwidth exists. Clients should not rely on ad-hoc decisions being made as this may be removed in the future.
|
|
- download: Indicated if the query parameter indicates this is a download. Bandwidth will be prioritized behind playbacks and will get a fair share of what remains.
|
|
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getMediaPart" method="get" path="/library/parts/{partId}/{changestamp}/{filename}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_media_part(request={
|
|
"part_id": 877105,
|
|
"changestamp": 970622,
|
|
"filename": "example.file",
|
|
"download": components.BoolInt.TRUE,
|
|
})
|
|
|
|
assert res is not None
|
|
|
|
# Handle response
|
|
print(res)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetMediaPartRequest](../../models/operations/getmediapartrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetMediaPartResponse](../../models/operations/getmediapartresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
|
|
## get_image_from_bif
|
|
|
|
Extract an image from the BIF for a part at a particular offset
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="python" operationID="getImageFromBif" method="get" path="/library/parts/{partId}/indexes/{index}/{offset}" -->
|
|
```python
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import components, operations
|
|
|
|
|
|
with PlexAPI(
|
|
accepts=components.Accepts.APPLICATION_XML,
|
|
client_identifier="abc123",
|
|
product="Plex for Roku",
|
|
version="2.4.1",
|
|
platform="Roku",
|
|
platform_version="4.3 build 1057",
|
|
device="Roku 3",
|
|
model="4200X",
|
|
device_vendor="Roku",
|
|
device_name="Living Room TV",
|
|
marketplace="googlePlay",
|
|
token="<YOUR_API_KEY_HERE>",
|
|
) as plex_api:
|
|
|
|
res = plex_api.library.get_image_from_bif(request={
|
|
"part_id": 304273,
|
|
"index": operations.PathParamIndex.SD,
|
|
"offset": 939569,
|
|
})
|
|
|
|
assert res.response_stream is not None
|
|
|
|
# Handle response
|
|
print(res.response_stream)
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
| `request` | [operations.GetImageFromBifRequest](../../models/operations/getimagefrombifrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
|
|
|
### Response
|
|
|
|
**[operations.GetImageFromBifResponse](../../models/operations/getimagefrombifresponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| --------------- | --------------- | --------------- |
|
|
| errors.SDKError | 4XX, 5XX | \*/\* | |