Files
plexpy/codeSamples.yaml

1773 lines
50 KiB
YAML

overlay: 1.0.0
info:
title: CodeSamples overlay for python target
version: 0.0.0
actions:
- target: $["paths"]["/"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.server.get_server_capabilities()
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/:/prefs"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.server.get_server_preferences()
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/:/progress"]["post"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.media.update_play_progress(key="<key>", time=90000, state="played")
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/:/scrobble"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.media.mark_played(key=59398)
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/:/timeline"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.video.get_timeline(request={
"rating_key": 23409,
"key": "/library/metadata/23409",
"state": operations.State.PLAYING,
"has_mde": 1,
"time": 2000,
"duration": 10000,
"context": "home:hub.continueWatching",
"play_queue_item_id": 1,
"play_back_time": 2000,
"row": 1,
})
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/:/unscrobble"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.media.mark_unplayed(key=59398)
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/activities"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.activities.get_server_activities()
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/activities/{activityUUID}"]["delete"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.activities.cancel_server_activities(activity_uuid="25b71ed5-0f9d-461c-baa7-d404e9e10d3e")
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/butler"]["delete"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.butler.stop_all_tasks()
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/butler"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.butler.get_butler_tasks()
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/butler"]["post"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.butler.start_all_tasks()
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/butler/{taskName}"]["delete"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.butler.stop_task(task_name=operations.PathParamTaskName.CLEAN_OLD_CACHE_FILES)
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/butler/{taskName}"]["post"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.butler.start_task(task_name=operations.TaskName.REFRESH_PERIODIC_METADATA)
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/clients"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.server.get_available_clients()
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/companions"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.plex.get_companions_data()
assert res.response_bodies is not None
# Handle response
print(res.response_bodies)
- target: $["paths"]["/devices"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.server.get_devices()
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/friends"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.plex.get_user_friends()
assert res.friends is not None
# Handle response
print(res.friends)
- target: $["paths"]["/geoip"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI() as plex_api:
res = plex_api.plex.get_geo_data()
assert res.geo_data is not None
# Handle response
print(res.geo_data)
- target: $["paths"]["/home"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.plex.get_home_data()
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/hubs"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.hubs.get_global_hubs()
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/hubs/home/recentlyAdded"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.hubs.get_recently_added(request={
"content_directory_id": 39486,
"section_id": 2,
"type": operations.Type.TV_SHOW,
"include_meta": operations.IncludeMeta.ENABLE,
})
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/hubs/search"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.search.perform_search(query="arnold", limit=5)
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/hubs/search/voice"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.search.perform_voice_search(query="dead+poop", limit=5)
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/hubs/sections/{sectionId}"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.hubs.get_library_hubs(section_id=492.74)
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/identity"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI() as plex_api:
res = plex_api.server.get_server_identity()
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/library/all/top"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_top_watched_content(type_=operations.GetTopWatchedContentQueryParamType.TV_SHOW, include_guids=operations.GetTopWatchedContentQueryParamIncludeGuids.ENABLE)
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/library/hashes"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_file_hash(url="file://C:\\Image.png&type=13")
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/library/metadata/{ratingKey}"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_media_meta_data(request={
"rating_key": "21119,21617",
"include_concerts": True,
"include_extras": True,
"include_on_deck": True,
"include_popular_leaves": True,
"include_preferences": True,
"include_reviews": True,
"include_chapters": True,
"include_stations": True,
"include_external_media": True,
"async_augment_metadata": True,
"async_check_files": True,
"async_refresh_analysis": True,
"async_refresh_local_media_agent": True,
})
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/library/metadata/{ratingKey}/arts"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_media_arts(rating_key=16099)
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/library/metadata/{ratingKey}/arts"]["post"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.post_media_arts(rating_key=2268, url="https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b")
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/library/metadata/{ratingKey}/banner"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.media.get_banner_image(request={
"rating_key": 9518,
"width": 396,
"height": 396,
"min_size": 1,
"upscale": 1,
"x_plex_token": "CV5xoxjTpFKUzBTShsaf",
})
assert res.response_stream is not None
# Handle response
print(res.response_stream)
- target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_metadata_children(rating_key=2403.67, include_elements="Stream")
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/library/metadata/{ratingKey}/posters"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_media_posters(rating_key=16099)
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/library/metadata/{ratingKey}/posters"]["post"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.post_media_poster(rating_key=2268, url="https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b")
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/library/metadata/{ratingKey}/thumb"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.media.get_thumb_image(request={
"rating_key": 9518,
"width": 396,
"height": 396,
"min_size": 1,
"upscale": 1,
"x_plex_token": "CV5xoxjTpFKUzBTShsaf",
})
assert res.response_stream is not None
# Handle response
print(res.response_stream)
- target: $["paths"]["/library/recentlyAdded"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_recently_added_library(request={
"content_directory_id": 2,
"pinned_content_directory_id": [
3,
5,
7,
13,
12,
1,
6,
14,
2,
10,
16,
17,
],
"section_id": 2,
"type": operations.QueryParamType.TV_SHOW,
"include_meta": operations.QueryParamIncludeMeta.ENABLE,
})
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/library/search"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_search_all_libraries(request={
"query": "<value>",
"client_id": "3381b62b-9ab7-4e37-827b-203e9809eb58",
"search_types": [
operations.SearchTypes.PEOPLE,
],
"include_collections": operations.GetSearchAllLibrariesQueryParamIncludeCollections.ENABLE,
"include_external_media": operations.GetSearchAllLibrariesQueryParamIncludeExternalMedia.ENABLE,
})
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/library/sections"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_all_libraries()
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/library/sections/watchlist/{filter}"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.watchlist.get_watch_list(request={
"filter_": operations.Filter.RELEASED,
"x_plex_token": "CV5xoxjTpFKUzBTShsaf",
})
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/library/sections/{sectionKey}"]["delete"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.delete_library(section_key=9518)
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/library/sections/{sectionKey}"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_library_details(section_key=9518, include_details=operations.IncludeDetails.ZERO)
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/library/sections/{sectionKey}/actor"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_actors_library(section_key=9518, type_=operations.GetActorsLibraryQueryParamType.TV_SHOW)
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/library/sections/{sectionKey}/all"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_library_sections_all(request={
"section_key": 9518,
"type": operations.GetLibrarySectionsAllQueryParamType.TV_SHOW,
"include_meta": operations.GetLibrarySectionsAllQueryParamIncludeMeta.ENABLE,
"include_guids": operations.QueryParamIncludeGuids.ENABLE,
"include_advanced": operations.IncludeAdvanced.ENABLE,
"include_collections": operations.QueryParamIncludeCollections.ENABLE,
"include_external_media": operations.QueryParamIncludeExternalMedia.ENABLE,
})
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/library/sections/{sectionKey}/country"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_countries_library(section_key=9518, type_=operations.GetCountriesLibraryQueryParamType.TV_SHOW)
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/library/sections/{sectionKey}/genre"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_genres_library(section_key=9518, type_=operations.GetGenresLibraryQueryParamType.TV_SHOW)
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/library/sections/{sectionKey}/refresh"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_refresh_library_metadata(section_key=9518, force=operations.Force.ZERO)
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/library/sections/{sectionKey}/search"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_search_library(section_key=9518, type_=operations.GetSearchLibraryQueryParamType.TV_SHOW)
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/library/sections/{sectionKey}/{tag}"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_library_items(request={
"tag": operations.Tag.NEWEST,
"include_guids": operations.IncludeGuids.ENABLE,
"type": operations.GetLibraryItemsQueryParamType.TV_SHOW,
"section_key": 9518,
"include_meta": operations.GetLibraryItemsQueryParamIncludeMeta.ENABLE,
})
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/log"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.log.log_line(level=operations.Level.THREE, message="Test log message", source="Postman")
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/log"]["post"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.log.log_multi_line(request=("level=4&message=Test%20message%201&source=postman\n"
"level=3&message=Test%20message%202&source=postman\n"
"level=1&message=Test%20message%203&source=postman"))
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/log/networked"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.log.enable_paper_trail()
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/media/providers"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.server.get_media_providers(x_plex_token="CV5xoxjTpFKUzBTShsaf")
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/myplex/account"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.server.get_my_plex_account()
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/photo/:/transcode"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.server.get_resized_photo(request={
"width": 110,
"height": 165,
"blur": 0,
"min_size": operations.MinSize.ZERO,
"upscale": operations.Upscale.ZERO,
"url": "/library/metadata/49564/thumb/1654258204",
})
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/pins"]["post"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI() as plex_api:
res = plex_api.plex.get_pin(request={
"client_id": "3381b62b-9ab7-4e37-827b-203e9809eb58",
"client_name": "Plex for Roku",
"device_nickname": "Roku 3",
"client_version": "2.4.1",
"platform": "Roku",
})
assert res.auth_pin_container is not None
# Handle response
print(res.auth_pin_container)
- target: $["paths"]["/pins/{pinID}"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI() as plex_api:
res = plex_api.plex.get_token_by_pin_id(request={
"pin_id": 232248,
"client_id": "3381b62b-9ab7-4e37-827b-203e9809eb58",
"client_name": "Plex for Roku",
"device_nickname": "Roku 3",
"client_version": "2.4.1",
"platform": "Roku",
})
assert res.auth_pin_container is not None
# Handle response
print(res.auth_pin_container)
- target: $["paths"]["/playlists"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.playlists.get_playlists()
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/playlists"]["post"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.playlists.create_playlist(request={
"title": "<value>",
"type": operations.CreatePlaylistQueryParamType.AUDIO,
"smart": operations.Smart.ONE,
"uri": "https://short-term-disconnection.name/",
})
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/playlists/upload"]["post"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.playlists.upload_playlist(path="/home/barkley/playlist.m3u", force=operations.QueryParamForce.ONE, section_id=1)
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/playlists/{playlistID}"]["delete"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.playlists.delete_playlist(playlist_id=3432.93)
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/playlists/{playlistID}"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.playlists.get_playlist(playlist_id=8419.53)
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/playlists/{playlistID}"]["put"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.playlists.update_playlist(playlist_id=1579.66)
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/playlists/{playlistID}/items"]["delete"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.playlists.clear_playlist_contents(playlist_id=4137.37)
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/playlists/{playlistID}/items"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.playlists.get_playlist_contents(playlist_id=5535.42, type_=operations.GetPlaylistContentsQueryParamType.TV_SHOW)
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/playlists/{playlistID}/items"]["put"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.playlists.add_playlist_contents(playlist_id=7013.44, uri="server://12345/com.plexapp.plugins.library/library/metadata/1", play_queue_id=123)
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/resources"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.plex.get_server_resources(client_id="3381b62b-9ab7-4e37-827b-203e9809eb58", include_https=operations.IncludeHTTPS.ENABLE, include_relay=operations.IncludeRelay.ENABLE, include_i_pv6=operations.IncludeIPv6.ENABLE)
assert res.plex_devices is not None
# Handle response
print(res.plex_devices)
- target: $["paths"]["/search"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.search.get_search_results(query="110")
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/security/resources"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.authentication.get_source_connection_information(source="server://client-identifier")
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/security/token"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.authentication.get_transient_token(type_=operations.GetTransientTokenQueryParamType.DELEGATION, scope=operations.Scope.ALL)
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/servers"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.server.get_server_list()
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/statistics/bandwidth"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.statistics.get_bandwidth_statistics(timespan=4)
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/statistics/media"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.statistics.get_statistics(timespan=4)
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/statistics/resources"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.statistics.get_resources_statistics(timespan=4)
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/status/sessions"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.sessions.get_sessions()
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/status/sessions/history/all"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.sessions.get_session_history(sort="viewedAt:desc", account_id=1, filter_={}, library_section_id=12)
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/transcode/sessions"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.sessions.get_transcode_sessions()
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.sessions.stop_transcode_session(session_key="zz7llzqlx8w9vnrsbnwhbmep")
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/updater/apply"]["put"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.updater.apply_updates(tonight=operations.Tonight.ONE, skip=operations.Skip.ONE)
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/updater/check"]["put"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.updater.check_for_updates(download=operations.Download.ONE)
assert res is not None
# Handle response
print(res)
- target: $["paths"]["/updater/status"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.updater.get_update_status()
assert res.object is not None
# Handle response
print(res.object)
- target: $["paths"]["/user"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.authentication.get_token_details()
assert res.user_plex_account is not None
# Handle response
print(res.user_plex_account)
- target: $["paths"]["/users"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI() as plex_api:
res = plex_api.users.get_users(request={
"client_id": "3381b62b-9ab7-4e37-827b-203e9809eb58",
"client_name": "Plex for Roku",
"device_nickname": "Roku 3",
"device_name": "Chrome",
"device_screen_resolution": "1487x1165,2560x1440",
"client_version": "2.4.1",
"platform": "Roku",
"client_features": "external-media,indirect-media,hub-style-list",
"model": "4200X",
"x_plex_session_id": "97e136ef-4ddd-4ff3-89a7-a5820c96c2ca",
"x_plex_language": "en",
"platform_version": "4.3 build 1057",
"x_plex_token": "CV5xoxjTpFKUzBTShsaf",
})
assert res.body is not None
# Handle response
print(res.body)
- target: $["paths"]["/users/signin"]["post"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI() as plex_api:
res = plex_api.authentication.post_users_sign_in_data(request={
"client_id": "3381b62b-9ab7-4e37-827b-203e9809eb58",
"client_name": "Plex for Roku",
"device_nickname": "Roku 3",
"client_version": "2.4.1",
"platform": "Roku",
"request_body": {
"login": "username@email.com",
"password": "password123",
"verification_code": "123456",
},
})
assert res.user_plex_account is not None
# Handle response
print(res.user_plex_account)
- target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"]
update:
x-codeSamples:
- lang: python
label: PlexPy
source: |-
from plex_api_client import PlexAPI
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.video.start_universal_transcode(request={
"has_mde": 1,
"path": "/library/metadata/23409",
"media_index": 0,
"part_index": 0,
"protocol": "hls",
"fast_seek": 0,
"direct_play": 0,
"direct_stream": 0,
"subtitle_size": 100,
"subtites": "burn",
"audio_boost": 100,
"location": "lan",
"media_buffer_size": 102400,
"session": "zvcage8b7rkioqcm8f4uns4c",
"add_debug_overlay": 0,
"auto_adjust_quality": 0,
})
assert res is not None
# Handle response
print(res)