Update API docs

This commit is contained in:
JonnyWong16 2018-02-11 19:11:31 -08:00
parent 2a03ce757e
commit 503c249fc3
2 changed files with 912 additions and 243 deletions

706
API.md

File diff suppressed because it is too large Load diff

View file

@ -512,8 +512,6 @@ class WebInterface(object):
Optional parameters:
custom_thumb (str): The URL for the custom library thumbnail
do_notify (int): 0 or 1
do_notify_created (int): 0 or 1
keep_history (int): 0 or 1
Returns:
@ -624,7 +622,7 @@ class WebInterface(object):
Optional parameters:
section_type (str): "movie", "show", "artist", "photo"
order_column (str): "added_at", "title", "container", "bitrate", "video_codec",
order_column (str): "added_at", "sort_title", "container", "bitrate", "video_codec",
"video_resolution", "video_framerate", "audio_codec", "audio_channels",
"file_size", "last_played", "play_count"
order_dir (str): "desc" or "asc"
@ -981,7 +979,7 @@ class WebInterface(object):
else:
return {'message': 'no data received'}
else:
return {'message': 'Cannot refresh library while getting file sizes.'}
return {'message': 'Cannot delete media info cache while getting file sizes.'}
@cherrypy.expose
@cherrypy.tools.json_out()
@ -1130,9 +1128,8 @@ class WebInterface(object):
Optional paramters:
friendly_name(str): The friendly name of the user
custom_thumb (str): The URL for the custom user thumbnail
do_notify (int): 0 or 1
do_notify_created (int): 0 or 1
keep_history (int): 0 or 1
allow_guest (int): 0 or 1
Returns:
None
@ -3015,12 +3012,14 @@ class WebInterface(object):
Pass all the config options for the agent with the agent prefix:
e.g. For Telegram: telegram_bot_token
telegram_chat_id
disable_web_preview
html_support
incl_poster
incl_subject
Notify actions with 'trigger_' prefix (trigger_on_play, trigger_on_stop, etc.),
and notify text with 'text_' prefix (text_on_play_subject, text_on_play_body, etc.) are optional.
telegram_disable_web_preview
telegram_html_support
telegram_incl_poster
telegram_incl_subject
Notify actions (int): 0 or 1,
e.g. on_play, on_stop, etc.
Notify text (str):
e.g. on_play_subject, on_play_body, etc.
Returns:
None
@ -4118,11 +4117,15 @@ class WebInterface(object):
],
"added_at": "1461572396",
"art": "/library/metadata/1219/art/1462175063",
"audience_rating": "8",
"banner": "/library/metadata/1219/banner/1462175063",
"collections": [],
"content_rating": "TV-MA",
"directors": [
"Jeremy Podeswa"
],
"duration": "2998290",
"full_title": "Game of Thrones - The Red Woman",
"genres": [
"Adventure",
"Drama",
@ -4136,6 +4139,74 @@ class WebInterface(object):
"last_viewed_at": "1462165717",
"library_name": "TV Shows",
"media_index": "1",
"media_info": [
{
"aspect_ratio": "1.78",
"audio_channel_layout": "5.1",
"audio_channels": "6",
"audio_codec": "ac3",
"audio_profile": "",
"bitrate": "10617",
"container": "mkv",
"height": "1078",
"id": "257925",
"optimized_version": 0,
"parts": [
{
"file": "/media/TV Shows/Game of Thrones/Season 06/Game of Thrones - S06E01 - The Red Woman.mkv",
"file_size": "3979115377",
"id": "274169",
"indexes": 1,
"streams": [
{
"id": "511663",
"type": "1",
"video_bit_depth": "8",
"video_bitrate": "10233",
"video_codec": "h264",
"video_codec_level": "41",
"video_frame_rate": "23.976",
"video_height": "1078",
"video_language": "",
"video_language_code": "",
"video_profile": "high",
"video_ref_frames": "4",
"video_width": "1920"
},
{
"audio_bitrate": "384",
"audio_bitrate_mode": "",
"audio_channel_layout": "5.1(side)",
"audio_channels": "6",
"audio_codec": "ac3",
"audio_language": "",
"audio_language_code": "",
"audio_profile": "",
"audio_sample_rate": "48000",
"id": "511664",
"type": "2"
},
{
"id": "511953",
"subtitle_codec": "srt",
"subtitle_container": "",
"subtitle_forced": 0,
"subtitle_format": "srt",
"subtitle_language": "English",
"subtitle_language_code": "eng",
"subtitle_location": "external",
"type": "3"
}
]
}
],
"video_codec": "h264",
"video_framerate": "24p",
"video_profile": "high",
"video_resolution": "1080",
"width": "1920"
}
],
"media_type": "episode",
"originally_available_at": "2016-04-24",
"parent_media_index": "6",
@ -4145,11 +4216,13 @@ class WebInterface(object):
"rating": "7.8",
"rating_key": "153037",
"section_id": "2",
"sort_title": "Game of Thrones",
"studio": "HBO",
"summary": "Jon Snow is dead. Daenerys meets a strong man. Cersei sees her daughter again.",
"tagline": "",
"thumb": "/library/metadata/153037/thumb/1462175060",
"title": "The Red Woman",
"user_rating": "9.0",
"updated_at": "1462175060",
"writers": [
"David Benioff",
@ -4388,67 +4461,219 @@ class WebInterface(object):
Returns:
json:
{"stream_count": 3,
"sessions":
[{"art": "/library/metadata/1219/art/1462175063",
{"lan_bandwidth": 25318,
"sessions": [
{
"actors": [
"Kit Harington",
"Emilia Clarke",
"Isaac Hempstead-Wright",
"Maisie Williams",
"Liam Cunningham",
],
"added_at": "1461572396",
"allow_guest": 1,
"art": "/library/metadata/1219/art/1503306930",
"aspect_ratio": "1.78",
"audience_rating": "",
"audio_bitrate": "384",
"audio_bitrate_mode": "",
"audio_channel_layout": "5.1(side)",
"audio_channels": "6",
"audio_codec": "ac3",
"audio_decision": "transcode",
"bif_thumb": "/library/parts/274169/indexes/sd/",
"audio_decision": "direct play",
"audio_language": "",
"audio_language_code": "",
"audio_profile": "",
"audio_sample_rate": "48000",
"bandwidth": "25318",
"banner": "/library/metadata/1219/banner/1503306930",
"bif_thumb": "/library/parts/274169/indexes/sd/1000",
"bitrate": "10617",
"channel_stream": 0,
"collections": [],
"container": "mkv",
"content_rating": "TV-MA",
"duration": "2998290",
"friendly_name": "Mother of Dragons",
"deleted_user": 0,
"device": "Windows",
"directors": [
"Jeremy Podeswa"
],
"do_notify": 0,
"duration": "2998272",
"email": "Jon.Snow.1337@CastleBlack.com",
"file": "/media/TV Shows/Game of Thrones/Season 06/Game of Thrones - S06E01 - The Red Woman.mkv",
"file_size": "3979115377",
"friendly_name": "Jon Snow",
"full_title": "Game of Thrones - The Red Woman",
"genres": [
"Adventure",
"Drama",
"Fantasy"
],
"grandparent_rating_key": "1219",
"grandparent_thumb": "/library/metadata/1219/thumb/1462175063",
"grandparent_thumb": "/library/metadata/1219/thumb/1503306930",
"grandparent_title": "Game of Thrones",
"guid": "com.plexapp.agents.thetvdb://121361/6/1?lang=en",
"height": "1078",
"id": "",
"indexes": 1,
"ip_address": "xxx.xxx.xxx.xxx",
"ip_address": "10.10.10.1",
"ip_address_public": "64.123.23.111",
"is_admin": 1,
"is_allow_sync": null,
"is_home_user": 1,
"is_restricted": 0,
"keep_history": 1,
"labels": [],
"machine_id": "83f189w617623ccs6a1lqpby",
"last_viewed_at": "1462165717",
"library_name": "TV Shows",
"local": "1",
"location": "lan",
"machine_id": "lmd93nkn12k29j2lnm",
"media_index": "1",
"media_type": "episode",
"optimized_version": 0,
"optimized_version_profile": "",
"optimized_version_title": "",
"originally_available_at": "2016-04-24",
"parent_media_index": "6",
"parent_rating_key": "153036",
"parent_thumb": "/library/metadata/153036/thumb/1462175062",
"parent_title": "",
"platform": "Chrome",
"player": "Plex Web (Chrome)",
"parent_thumb": "/library/metadata/153036/thumb/1503889210",
"parent_title": "Season 6",
"platform": "Plex Media Player",
"platform_name": "plex",
"platform_version": "2.4.1.787-54a020cd",
"player": "Castle-PC",
"product": "Plex Media Player",
"product_version": "3.35.2",
"profile": "Konvergo",
"progress_percent": "0",
"quality_profile": "Original",
"rating": "7.8",
"rating_key": "153037",
"section_id": "2",
"session_key": "291",
"session_id": "helf15l3rxgw01xxe0jf3l3d",
"session_key": "27",
"shared_libraries": [
"10",
"1",
"4",
"5",
"15",
"20",
"2"
],
"sort_title": "Red Woman",
"state": "playing",
"throttled": "1",
"thumb": "/library/metadata/153037/thumb/1462175060",
"stream_aspect_ratio": "1.78",
"stream_audio_bitrate": "384",
"stream_audio_bitrate_mode": "",
"stream_audio_channel_layout": "5.1(side)",
"stream_audio_channel_layout_": "5.1(side)",
"stream_audio_channels": "6",
"stream_audio_codec": "ac3",
"stream_audio_decision": "direct play",
"stream_audio_language": "",
"stream_audio_language_code": "",
"stream_audio_sample_rate": "48000",
"stream_bitrate": "10617",
"stream_container": "mkv",
"stream_container_decision": "direct play",
"stream_duration": "2998272",
"stream_subtitle_codec": "",
"stream_subtitle_container": "",
"stream_subtitle_decision": "",
"stream_subtitle_forced": 0,
"stream_subtitle_format": "",
"stream_subtitle_language": "",
"stream_subtitle_language_code": "",
"stream_subtitle_location": "",
"stream_video_bit_depth": "8",
"stream_video_bitrate": "10233",
"stream_video_codec": "h264",
"stream_video_codec_level": "41",
"stream_video_decision": "direct play",
"stream_video_framerate": "24p",
"stream_video_height": "1078",
"stream_video_language": "",
"stream_video_language_code": "",
"stream_video_ref_frames": "4",
"stream_video_resolution": "1080",
"stream_video_width": "1920",
"studio": "HBO",
"subtitle_codec": "",
"subtitle_container": "",
"subtitle_decision": "",
"subtitle_forced": 0,
"subtitle_format": "",
"subtitle_language": "",
"subtitle_language_code": "",
"subtitle_location": "",
"subtitles": 0,
"summary": "Jon Snow is dead. Daenerys meets a strong man. Cersei sees her daughter again.",
"synced_version": 0,
"synced_version_profile": "",
"tagline": "",
"throttled": "0",
"thumb": "/library/metadata/153037/thumb/1503889207",
"title": "The Red Woman",
"transcode_audio_channels": "2",
"transcode_audio_codec": "aac",
"transcode_container": "mkv",
"transcode_height": "1078",
"transcode_key": "tiv5p524wcupe8nxegc26s9k9",
"transcode_progress": 2,
"transcode_protocol": "http",
"transcode_speed": "0.0",
"transcode_video_codec": "h264",
"transcode_width": "1920",
"user": "DanyKhaleesi69",
"user_id": 8008135,
"user_thumb": "https://plex.tv/users/568gwwoib5t98a3a/avatar",
"transcode_audio_channels": "",
"transcode_audio_codec": "",
"transcode_container": "",
"transcode_decision": "direct play",
"transcode_height": "",
"transcode_hw_decode": "",
"transcode_hw_decode_title": "",
"transcode_hw_decoding": 0,
"transcode_hw_encode": "",
"transcode_hw_encode_title": "",
"transcode_hw_encoding": 0,
"transcode_hw_full_pipeline": 0,
"transcode_hw_requested": 0,
"transcode_key": "",
"transcode_progress": 0,
"transcode_protocol": "",
"transcode_speed": "",
"transcode_throttled": 0,
"transcode_video_codec": "",
"transcode_width": "",
"type": "",
"updated_at": "1503889207",
"user": "LordCommanderSnow",
"user_id": 133788,
"user_rating": "",
"user_thumb": "https://plex.tv/users/k10w42309cynaopq/avatar",
"username": "LordCommanderSnow",
"video_bit_depth": "8",
"video_bitrate": "10233",
"video_codec": "h264",
"video_decision": "copy",
"video_codec_level": "41",
"video_decision": "direct play",
"video_frame_rate": "23.976",
"video_framerate": "24p",
"video_height": "1078",
"video_language": "",
"video_language_code": "",
"video_profile": "high",
"video_ref_frames": "4",
"video_resolution": "1080",
"view_offset": "",
"video_width": "1920",
"view_offset": "1000",
"width": "1920",
"writers": [
"David Benioff",
"D. B. Weiss"
],
"year": "2016"
},
{...},
{...}
]
}
],
"stream_count": "1",
"stream_count_direct_play": 1,
"stream_count_direct_stream": 0,
"stream_count_transcode": 0,
"total_bandwidth": 25318,
"wan_bandwidth": 0
}
```
"""
@ -4585,27 +4810,29 @@ class WebInterface(object):
Returns:
json:
[{"content_type": "video",
[{"audio_bitrate": "192",
"client_id": "95434se643fsf24f-com-plexapp-android",
"content_type": "video",
"device_name": "Tyrion's iPad",
"failure": "",
"friendly_name": "Tyrion Lannister",
"item_complete_count": "0",
"item_complete_count": "1",
"item_count": "1",
"item_downloaded_count": "0",
"item_downloaded_percent_complete": 0,
"item_downloaded_count": "1",
"item_downloaded_percent_complete": 100,
"metadata_type": "movie",
"music_bitrate": "192",
"photo_quality": "74",
"platform": "iOS",
"rating_key": "154092",
"root_title": "Deadpool",
"state": "pending",
"root_title": "Movies",
"state": "complete",
"sync_id": "11617019",
"title": "Deadpool",
"total_size": "0",
"sync_title": "Deadpool",
"total_size": "560718134",
"user": "DrukenDwarfMan",
"user_id": "696969",
"username": "DrukenDwarfMan",
"video_quality": "60"
"video_bitrate": "4000"
"video_quality": "100"
},
{...},
{...}