mirror of
https://github.com/LukeHagar/plexpy.git
synced 2025-12-06 12:47:44 +00:00
1776 lines
55 KiB
YAML
1776 lines
55 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: getServerCapabilities
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.server.get_server_capabilities()
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/:/prefs"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getServerPreferences
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.server.get_server_preferences()
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/:/progress"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: updatePlayProgress
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.media.update_play_progress(key="<key>", time=90000, state="played")
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/:/scrobble"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: markPlayed
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.media.mark_played(key=59398)
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/:/timeline"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getTimeline
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.video.get_timeline(request={
|
|
"rating_key": 23409,
|
|
"key": "/library/metadata/23409",
|
|
"state": operations.State.PLAYING,
|
|
"has_mde": 1,
|
|
"time": 2000,
|
|
"duration": 10000,
|
|
"context": "home:hub.continueWatching",
|
|
"play_queue_item_id": 1,
|
|
"play_back_time": 2000,
|
|
"row": 1,
|
|
})
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/:/unscrobble"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: markUnplayed
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.media.mark_unplayed(key=59398)
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/activities"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getServerActivities
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.activities.get_server_activities()
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/activities/{activityUUID}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: cancelServerActivities
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.activities.cancel_server_activities(activity_uuid="25b71ed5-0f9d-461c-baa7-d404e9e10d3e")
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/butler"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: stopAllTasks
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.butler.stop_all_tasks()
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/butler"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getButlerTasks
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.butler.get_butler_tasks()
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/butler"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: startAllTasks
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.butler.start_all_tasks()
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/butler/{taskName}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: stopTask
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.butler.stop_task(task_name=operations.PathParamTaskName.BACKUP_DATABASE)
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/butler/{taskName}"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: startTask
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.butler.start_task(task_name=operations.TaskName.CLEAN_OLD_BUNDLES)
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/clients"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getAvailableClients
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.server.get_available_clients()
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/companions"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getCompanionsData
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.plex.get_companions_data()
|
|
|
|
if res.response_bodies is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/devices"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getDevices
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.server.get_devices()
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/friends"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getUserFriends
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.plex.get_user_friends()
|
|
|
|
if res.friends is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/geoip"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getGeoData
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.plex.get_geo_data()
|
|
|
|
if res.geo_data is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/home"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getHomeData
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.plex.get_home_data()
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/hubs"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getGlobalHubs
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.hubs.get_global_hubs()
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/hubs/home/recentlyAdded"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: added
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.hubs.get_recently_added(request={
|
|
"content_directory_id": 470161,
|
|
"section_id": 2,
|
|
"type": operations.Type.TV_SHOW,
|
|
"include_meta": operations.IncludeMeta.ENABLE,
|
|
"x_plex_container_start": 0,
|
|
"x_plex_container_size": 50,
|
|
})
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/hubs/search"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: performSearch
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.search.perform_search(query="dylan", limit=5)
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/hubs/search/voice"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: performVoiceSearch
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.search.perform_voice_search(query="dead+poop", limit=5)
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/hubs/sections/{sectionId}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getLibraryHubs
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.hubs.get_library_hubs(section_id=6728.76)
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/identity"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: identity
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.server.get_server_identity()
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/library/all/top"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getTopWatchedContent
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.library.get_top_watched_content(type_=operations.GetTopWatchedContentQueryParamType.TV_SHOW, include_guids=1)
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/library/hashes"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getFileHash
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.library.get_file_hash(url="file://C:\Image.png&type=13")
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/library/metadata/{ratingKey}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: key
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.library.get_meta_data_by_rating_key(rating_key=9518)
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/library/metadata/{ratingKey}/banner"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: image
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.media.get_banner_image(request={
|
|
"rating_key": 9518,
|
|
"width": 396,
|
|
"height": 396,
|
|
"min_size": 1,
|
|
"upscale": 1,
|
|
"x_plex_token": "CV5xoxjTpFKUzBTShsaf",
|
|
})
|
|
|
|
if res.response_stream is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getMetadataChildren
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.library.get_metadata_children(rating_key=1539.15, include_elements="Stream")
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/library/metadata/{ratingKey}/thumb"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: image
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.media.get_thumb_image(request={
|
|
"rating_key": 9518,
|
|
"width": 396,
|
|
"height": 396,
|
|
"min_size": 1,
|
|
"upscale": 1,
|
|
"x_plex_token": "CV5xoxjTpFKUzBTShsaf",
|
|
})
|
|
|
|
if res.response_stream is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/library/onDeck"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getOnDeck
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.library.get_on_deck()
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/library/recentlyAdded"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: library
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.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,
|
|
"x_plex_container_start": 0,
|
|
"x_plex_container_size": 50,
|
|
})
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/library/sections"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: libraries
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.library.get_all_libraries()
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/library/sections/watchlist/{filter}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: list
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.watchlist.get_watch_list(request={
|
|
"filter_": operations.Filter.AVAILABLE,
|
|
"x_plex_container_start": 0,
|
|
"x_plex_container_size": 50,
|
|
"x_plex_token": "CV5xoxjTpFKUzBTShsaf",
|
|
})
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/library/sections/{sectionKey}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: deleteLibrary
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.library.delete_library(section_key=9518)
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/library/sections/{sectionKey}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: details
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.library.get_library_details(section_key=9518)
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/library/sections/{sectionKey}/refresh"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: metadata
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.library.get_refresh_library_metadata(section_key=9518, force=operations.Force.ONE)
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/library/sections/{sectionKey}/search"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: library
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.library.get_search_library(section_key=9518, type_=operations.GetSearchLibraryQueryParamType.TV_SHOW)
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/library/sections/{sectionKey}/{tag}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: items
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.library.get_library_items(request={
|
|
"section_key": 9518,
|
|
"tag": operations.Tag.EDITION,
|
|
"include_guids": operations.IncludeGuids.ENABLE,
|
|
"type": operations.GetLibraryItemsQueryParamType.TV_SHOW,
|
|
"include_meta": operations.GetLibraryItemsQueryParamIncludeMeta.ENABLE,
|
|
"x_plex_container_start": 0,
|
|
"x_plex_container_size": 50,
|
|
})
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/log"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: logLine
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.log.log_line(level=operations.Level.THREE, message="Test log message", source="Postman")
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/log"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: logMultiLine
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.log.log_multi_line(request="level=4&message=Test%20message%201&source=postman\n" +
|
|
"level=3&message=Test%20message%202&source=postman\n" +
|
|
"level=1&message=Test%20message%203&source=postman")
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/log/networked"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: enablePaperTrail
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.log.enable_paper_trail()
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/media/providers"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: providers
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.server.get_media_providers(x_plex_token="CV5xoxjTpFKUzBTShsaf")
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/myplex/account"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getMyPlexAccount
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.server.get_my_plex_account()
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/photo/:/transcode"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getResizedPhoto
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.server.get_resized_photo(request={
|
|
"width": 110,
|
|
"height": 165,
|
|
"opacity": 100,
|
|
"blur": 0,
|
|
"min_size": operations.MinSize.ONE,
|
|
"upscale": operations.Upscale.ONE,
|
|
"url": "/library/metadata/49564/thumb/1654258204",
|
|
})
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/pins"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getPin
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.plex.get_pin(request={})
|
|
|
|
if res.auth_pin_container is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/pins/{pinID}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getTokenByPinId
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.plex.get_token_by_pin_id(request={
|
|
"pin_id": 408895,
|
|
})
|
|
|
|
if res.auth_pin_container is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/playlists"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getPlaylists
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.playlists.get_playlists()
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/playlists"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: createPlaylist
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.playlists.create_playlist(request={
|
|
"title": "<value>",
|
|
"type": operations.CreatePlaylistQueryParamType.PHOTO,
|
|
"smart": operations.Smart.ONE,
|
|
"uri": "https://hoarse-testing.info/",
|
|
})
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/playlists/upload"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: uploadPlaylist
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.playlists.upload_playlist(path="/home/barkley/playlist.m3u", force=operations.QueryParamForce.ZERO, section_id=1)
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/playlists/{playlistID}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: deletePlaylist
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.playlists.delete_playlist(playlist_id=216.22)
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/playlists/{playlistID}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getPlaylist
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.playlists.get_playlist(playlist_id=4109.48)
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/playlists/{playlistID}"]["put"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: updatePlaylist
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.playlists.update_playlist(playlist_id=3915.00)
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/playlists/{playlistID}/items"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: clearPlaylistContents
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.playlists.clear_playlist_contents(playlist_id=1893.18)
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/playlists/{playlistID}/items"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getPlaylistContents
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.playlists.get_playlist_contents(playlist_id=5004.46, type_=operations.GetPlaylistContentsQueryParamType.TV_SHOW)
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/playlists/{playlistID}/items"]["put"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: addPlaylistContents
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.playlists.add_playlist_contents(playlist_id=8502.00, uri="server://12345/com.plexapp.plugins.library/library/metadata/1", play_queue_id=123)
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/resources"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: resources
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.plex.get_server_resources(include_https=operations.IncludeHTTPS.ENABLE, include_relay=operations.IncludeRelay.ENABLE, include_i_pv6=operations.IncludeIPv6.ENABLE)
|
|
|
|
if res.plex_devices is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/search"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getSearchResults
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.search.get_search_results(query="110")
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/security/resources"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getSourceConnectionInformation
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.authentication.get_source_connection_information(source="provider://provider-identifier")
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/security/token"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getTransientToken
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.authentication.get_transient_token(type_=operations.GetTransientTokenQueryParamType.DELEGATION, scope=operations.Scope.ALL)
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/servers"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getServerList
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.server.get_server_list()
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/statistics/bandwidth"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getBandwidthStatistics
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.statistics.get_bandwidth_statistics(timespan=4)
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/statistics/media"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getStatistics
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.statistics.get_statistics(timespan=4)
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/statistics/resources"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getResourcesStatistics
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.statistics.get_resources_statistics(timespan=4)
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/status/sessions"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getSessions
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.sessions.get_sessions()
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/status/sessions/history/all"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getSessionHistory
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.sessions.get_session_history(sort="viewedAt:desc", account_id=1, filter_={}, library_section_id=12)
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/transcode/sessions"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getTranscodeSessions
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.sessions.get_transcode_sessions()
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: stopTranscodeSession
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.sessions.stop_transcode_session(session_key="zz7llzqlx8w9vnrsbnwhbmep")
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/updater/apply"]["put"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: applyUpdates
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.updater.apply_updates(tonight=operations.Tonight.ONE, skip=operations.Skip.ONE)
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/updater/check"]["put"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: checkForUpdates
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.updater.check_for_updates(download=operations.Download.ONE)
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/updater/status"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getUpdateStatus
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.updater.get_update_status()
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/user"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: getTokenDetails
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.authentication.get_token_details()
|
|
|
|
if res.user_plex_account is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/users/signin"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: data
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.authentication.post_users_sign_in_data(request={
|
|
"request_body": {
|
|
"login": "username@email.com",
|
|
"password": "password123",
|
|
"verification_code": "123456",
|
|
},
|
|
})
|
|
|
|
if res.user_plex_account is not None:
|
|
# handle response
|
|
pass
|
|
- target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: startUniversalTranscode
|
|
source: |-
|
|
from plex_api_client import PlexAPI
|
|
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
client_id="gcgzw5rz2xovp84b4vha3a40",
|
|
client_name="Plex Web",
|
|
client_version="4.133.0",
|
|
client_platform="Chrome",
|
|
device_name="Linux",
|
|
)
|
|
|
|
res = s.video.start_universal_transcode(request={
|
|
"has_mde": 1,
|
|
"path": "/library/metadata/23409",
|
|
"media_index": 0,
|
|
"part_index": 0,
|
|
"protocol": "hls",
|
|
"fast_seek": 0,
|
|
"direct_play": 0,
|
|
"direct_stream": 0,
|
|
"subtitle_size": 100,
|
|
"subtites": "burn",
|
|
"audio_boost": 100,
|
|
"location": "lan",
|
|
"media_buffer_size": 102400,
|
|
"session": "zvcage8b7rkioqcm8f4uns4c",
|
|
"add_debug_overlay": 0,
|
|
"auto_adjust_quality": 0,
|
|
})
|
|
|
|
if res is not None:
|
|
# handle response
|
|
pass
|