plex-api-client 0.6.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. plex_api/__init__.py +4 -0
  2. plex_api/_hooks/__init__.py +5 -0
  3. plex_api/_hooks/registration.py +13 -0
  4. plex_api/_hooks/sdkhooks.py +57 -0
  5. plex_api/_hooks/types.py +74 -0
  6. plex_api/activities.py +151 -0
  7. plex_api/authentication.py +146 -0
  8. plex_api/butler.py +333 -0
  9. plex_api/hubs.py +158 -0
  10. plex_api/library.py +808 -0
  11. plex_api/log.py +225 -0
  12. plex_api/media.py +210 -0
  13. plex_api/models/__init__.py +4 -0
  14. plex_api/models/components/__init__.py +5 -0
  15. plex_api/models/components/security.py +11 -0
  16. plex_api/models/errors/__init__.py +63 -0
  17. plex_api/models/errors/addplaylistcontents.py +32 -0
  18. plex_api/models/errors/applyupdates.py +32 -0
  19. plex_api/models/errors/cancelserveractivities.py +32 -0
  20. plex_api/models/errors/checkforupdates.py +32 -0
  21. plex_api/models/errors/clearplaylistcontents.py +32 -0
  22. plex_api/models/errors/createplaylist.py +32 -0
  23. plex_api/models/errors/deletelibrary.py +32 -0
  24. plex_api/models/errors/deleteplaylist.py +32 -0
  25. plex_api/models/errors/enablepapertrail.py +32 -0
  26. plex_api/models/errors/getavailableclients.py +32 -0
  27. plex_api/models/errors/getbutlertasks.py +32 -0
  28. plex_api/models/errors/getdevices.py +32 -0
  29. plex_api/models/errors/getfilehash.py +32 -0
  30. plex_api/models/errors/getglobalhubs.py +32 -0
  31. plex_api/models/errors/getlibraries.py +32 -0
  32. plex_api/models/errors/getlibrary.py +32 -0
  33. plex_api/models/errors/getlibraryhubs.py +32 -0
  34. plex_api/models/errors/getmetadata.py +32 -0
  35. plex_api/models/errors/getmetadatachildren.py +32 -0
  36. plex_api/models/errors/getmyplexaccount.py +32 -0
  37. plex_api/models/errors/getondeck.py +32 -0
  38. plex_api/models/errors/getpin.py +32 -0
  39. plex_api/models/errors/getplaylist.py +32 -0
  40. plex_api/models/errors/getplaylistcontents.py +32 -0
  41. plex_api/models/errors/getplaylists.py +32 -0
  42. plex_api/models/errors/getrecentlyadded.py +32 -0
  43. plex_api/models/errors/getresizedphoto.py +32 -0
  44. plex_api/models/errors/getsearchresults.py +32 -0
  45. plex_api/models/errors/getserveractivities.py +32 -0
  46. plex_api/models/errors/getservercapabilities.py +32 -0
  47. plex_api/models/errors/getserveridentity.py +32 -0
  48. plex_api/models/errors/getserverlist.py +32 -0
  49. plex_api/models/errors/getserverpreferences.py +32 -0
  50. plex_api/models/errors/getsessionhistory.py +32 -0
  51. plex_api/models/errors/getsessions.py +32 -0
  52. plex_api/models/errors/getsourceconnectioninformation.py +32 -0
  53. plex_api/models/errors/getstatistics.py +32 -0
  54. plex_api/models/errors/gettimeline.py +32 -0
  55. plex_api/models/errors/gettoken.py +32 -0
  56. plex_api/models/errors/gettranscodesessions.py +32 -0
  57. plex_api/models/errors/gettransienttoken.py +32 -0
  58. plex_api/models/errors/getupdatestatus.py +32 -0
  59. plex_api/models/errors/logline.py +32 -0
  60. plex_api/models/errors/logmultiline.py +32 -0
  61. plex_api/models/errors/markplayed.py +32 -0
  62. plex_api/models/errors/markunplayed.py +32 -0
  63. plex_api/models/errors/performsearch.py +32 -0
  64. plex_api/models/errors/performvoicesearch.py +32 -0
  65. plex_api/models/errors/refreshlibrary.py +32 -0
  66. plex_api/models/errors/sdkerror.py +24 -0
  67. plex_api/models/errors/startalltasks.py +32 -0
  68. plex_api/models/errors/starttask.py +32 -0
  69. plex_api/models/errors/startuniversaltranscode.py +32 -0
  70. plex_api/models/errors/stopalltasks.py +32 -0
  71. plex_api/models/errors/stoptask.py +32 -0
  72. plex_api/models/errors/stoptranscodesession.py +32 -0
  73. plex_api/models/errors/updateplaylist.py +32 -0
  74. plex_api/models/errors/updateplayprogress.py +32 -0
  75. plex_api/models/errors/uploadplaylist.py +32 -0
  76. plex_api/models/operations/__init__.py +64 -0
  77. plex_api/models/operations/addplaylistcontents.py +74 -0
  78. plex_api/models/operations/applyupdates.py +39 -0
  79. plex_api/models/operations/cancelserveractivities.py +25 -0
  80. plex_api/models/operations/checkforupdates.py +32 -0
  81. plex_api/models/operations/clearplaylistcontents.py +25 -0
  82. plex_api/models/operations/createplaylist.py +91 -0
  83. plex_api/models/operations/deletelibrary.py +25 -0
  84. plex_api/models/operations/deleteplaylist.py +25 -0
  85. plex_api/models/operations/enablepapertrail.py +17 -0
  86. plex_api/models/operations/getavailableclients.py +58 -0
  87. plex_api/models/operations/getbutlertasks.py +52 -0
  88. plex_api/models/operations/getdevices.py +53 -0
  89. plex_api/models/operations/getfilehash.py +28 -0
  90. plex_api/models/operations/getglobalhubs.py +100 -0
  91. plex_api/models/operations/getlibraries.py +79 -0
  92. plex_api/models/operations/getlibrary.py +153 -0
  93. plex_api/models/operations/getlibraryhubs.py +205 -0
  94. plex_api/models/operations/getlibraryitems.py +227 -0
  95. plex_api/models/operations/getmetadata.py +264 -0
  96. plex_api/models/operations/getmetadatachildren.py +115 -0
  97. plex_api/models/operations/getmyplexaccount.py +50 -0
  98. plex_api/models/operations/getondeck.py +166 -0
  99. plex_api/models/operations/getpin.py +86 -0
  100. plex_api/models/operations/getplaylist.py +70 -0
  101. plex_api/models/operations/getplaylistcontents.py +178 -0
  102. plex_api/models/operations/getplaylists.py +85 -0
  103. plex_api/models/operations/getrecentlyadded.py +166 -0
  104. plex_api/models/operations/getresizedphoto.py +48 -0
  105. plex_api/models/operations/getsearchresults.py +182 -0
  106. plex_api/models/operations/getserveractivities.py +63 -0
  107. plex_api/models/operations/getservercapabilities.py +99 -0
  108. plex_api/models/operations/getserveridentity.py +42 -0
  109. plex_api/models/operations/getserverlist.py +53 -0
  110. plex_api/models/operations/getserverpreferences.py +57 -0
  111. plex_api/models/operations/getsessionhistory.py +67 -0
  112. plex_api/models/operations/getsessions.py +185 -0
  113. plex_api/models/operations/getsourceconnectioninformation.py +25 -0
  114. plex_api/models/operations/getstatistics.py +93 -0
  115. plex_api/models/operations/gettimeline.py +50 -0
  116. plex_api/models/operations/gettoken.py +35 -0
  117. plex_api/models/operations/gettranscodesessions.py +71 -0
  118. plex_api/models/operations/gettransienttoken.py +36 -0
  119. plex_api/models/operations/getupdatestatus.py +57 -0
  120. plex_api/models/operations/logline.py +50 -0
  121. plex_api/models/operations/logmultiline.py +17 -0
  122. plex_api/models/operations/markplayed.py +25 -0
  123. plex_api/models/operations/markunplayed.py +25 -0
  124. plex_api/models/operations/performsearch.py +30 -0
  125. plex_api/models/operations/performvoicesearch.py +30 -0
  126. plex_api/models/operations/refreshlibrary.py +25 -0
  127. plex_api/models/operations/searchlibrary.py +96 -0
  128. plex_api/models/operations/startalltasks.py +17 -0
  129. plex_api/models/operations/starttask.py +43 -0
  130. plex_api/models/operations/startuniversaltranscode.py +56 -0
  131. plex_api/models/operations/stopalltasks.py +17 -0
  132. plex_api/models/operations/stoptask.py +43 -0
  133. plex_api/models/operations/stoptranscodesession.py +25 -0
  134. plex_api/models/operations/updateplaylist.py +30 -0
  135. plex_api/models/operations/updateplayprogress.py +29 -0
  136. plex_api/models/operations/uploadplaylist.py +47 -0
  137. plex_api/playlists.py +629 -0
  138. plex_api/plex.py +154 -0
  139. plex_api/sdk.py +180 -0
  140. plex_api/sdkconfiguration.py +52 -0
  141. plex_api/search.py +232 -0
  142. plex_api/server.py +525 -0
  143. plex_api/sessions.py +272 -0
  144. plex_api/statistics.py +86 -0
  145. plex_api/updater.py +212 -0
  146. plex_api/utils/__init__.py +4 -0
  147. plex_api/utils/retries.py +120 -0
  148. plex_api/utils/utils.py +898 -0
  149. plex_api/video.py +136 -0
  150. plex_api_client-0.6.1.dist-info/LICENSE.md +21 -0
  151. plex_api_client-0.6.1.dist-info/METADATA +397 -0
  152. plex_api_client-0.6.1.dist-info/RECORD +154 -0
  153. plex_api_client-0.6.1.dist-info/WHEEL +5 -0
  154. plex_api_client-0.6.1.dist-info/top_level.txt +1 -0
plex_api/video.py ADDED
@@ -0,0 +1,136 @@
1
+ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""
2
+
3
+ import requests as requests_http
4
+ from .sdkconfiguration import SDKConfiguration
5
+ from plex_api import utils
6
+ from plex_api._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext
7
+ from plex_api.models import errors, operations
8
+
9
+ class Video:
10
+ r"""API Calls that perform operations with Plex Media Server Videos"""
11
+ sdk_configuration: SDKConfiguration
12
+
13
+ def __init__(self, sdk_config: SDKConfiguration) -> None:
14
+ self.sdk_configuration = sdk_config
15
+
16
+
17
+
18
+ def get_timeline(self, request: operations.GetTimelineRequest) -> operations.GetTimelineResponse:
19
+ r"""Get the timeline for a media item
20
+ Get the timeline for a media item
21
+ """
22
+ hook_ctx = HookContext(operation_id='getTimeline', oauth2_scopes=[], security_source=self.sdk_configuration.security)
23
+ base_url = utils.template_url(*self.sdk_configuration.get_server_details())
24
+
25
+ url = base_url + '/:/timeline'
26
+
27
+ if callable(self.sdk_configuration.security):
28
+ headers, query_params = utils.get_security(self.sdk_configuration.security())
29
+ else:
30
+ headers, query_params = utils.get_security(self.sdk_configuration.security)
31
+
32
+ query_params = { **utils.get_query_params(operations.GetTimelineRequest, request, self.sdk_configuration.globals), **query_params }
33
+ headers['Accept'] = 'application/json'
34
+ headers['user-agent'] = self.sdk_configuration.user_agent
35
+ client = self.sdk_configuration.client
36
+
37
+ try:
38
+ req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers))
39
+ req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req)
40
+ http_res = client.send(req)
41
+ except Exception as e:
42
+ _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e)
43
+ if e is not None:
44
+ raise e
45
+
46
+ if utils.match_status_codes(['400','401','4XX','5XX'], http_res.status_code):
47
+ result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None)
48
+ if e is not None:
49
+ raise e
50
+ if result is not None:
51
+ http_res = result
52
+ else:
53
+ http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res)
54
+
55
+
56
+
57
+ res = operations.GetTimelineResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res)
58
+
59
+ if http_res.status_code == 200:
60
+ pass
61
+ elif http_res.status_code == 400 or http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600:
62
+ raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res)
63
+ elif http_res.status_code == 401:
64
+ if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'):
65
+ out = utils.unmarshal_json(http_res.text, errors.GetTimelineResponseBody)
66
+ out.raw_response = http_res
67
+ raise out
68
+ else:
69
+ content_type = http_res.headers.get('Content-Type')
70
+ raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res)
71
+ else:
72
+ raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res)
73
+
74
+ return res
75
+
76
+
77
+
78
+ def start_universal_transcode(self, request: operations.StartUniversalTranscodeRequest) -> operations.StartUniversalTranscodeResponse:
79
+ r"""Start Universal Transcode
80
+ Begin a Universal Transcode Session
81
+ """
82
+ hook_ctx = HookContext(operation_id='startUniversalTranscode', oauth2_scopes=[], security_source=self.sdk_configuration.security)
83
+ base_url = utils.template_url(*self.sdk_configuration.get_server_details())
84
+
85
+ url = base_url + '/video/:/transcode/universal/start.mpd'
86
+
87
+ if callable(self.sdk_configuration.security):
88
+ headers, query_params = utils.get_security(self.sdk_configuration.security())
89
+ else:
90
+ headers, query_params = utils.get_security(self.sdk_configuration.security)
91
+
92
+ query_params = { **utils.get_query_params(operations.StartUniversalTranscodeRequest, request, self.sdk_configuration.globals), **query_params }
93
+ headers['Accept'] = 'application/json'
94
+ headers['user-agent'] = self.sdk_configuration.user_agent
95
+ client = self.sdk_configuration.client
96
+
97
+ try:
98
+ req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers))
99
+ req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req)
100
+ http_res = client.send(req)
101
+ except Exception as e:
102
+ _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e)
103
+ if e is not None:
104
+ raise e
105
+
106
+ if utils.match_status_codes(['400','401','4XX','5XX'], http_res.status_code):
107
+ result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None)
108
+ if e is not None:
109
+ raise e
110
+ if result is not None:
111
+ http_res = result
112
+ else:
113
+ http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res)
114
+
115
+
116
+
117
+ res = operations.StartUniversalTranscodeResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res)
118
+
119
+ if http_res.status_code == 200:
120
+ pass
121
+ elif http_res.status_code == 400 or http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600:
122
+ raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res)
123
+ elif http_res.status_code == 401:
124
+ if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'):
125
+ out = utils.unmarshal_json(http_res.text, errors.StartUniversalTranscodeResponseBody)
126
+ out.raw_response = http_res
127
+ raise out
128
+ else:
129
+ content_type = http_res.headers.get('Content-Type')
130
+ raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res)
131
+ else:
132
+ raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res)
133
+
134
+ return res
135
+
136
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 LukeHagar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,397 @@
1
+ Metadata-Version: 2.1
2
+ Name: plex-api-client
3
+ Version: 0.6.1
4
+ Summary: Python Client SDK Generated by Speakeasy
5
+ Home-page: https://github.com/LukeHagar/plexpy.git
6
+ Author: LukeHagar
7
+ License: UNKNOWN
8
+ Platform: UNKNOWN
9
+ Requires-Python: >=3.8
10
+ Description-Content-Type: text/markdown
11
+ Requires-Dist: certifi >=2023.7.22
12
+ Requires-Dist: charset-normalizer >=3.2.0
13
+ Requires-Dist: dataclasses-json >=0.6.4
14
+ Requires-Dist: idna >=3.4
15
+ Requires-Dist: jsonpath-python >=1.0.6
16
+ Requires-Dist: marshmallow >=3.19.0
17
+ Requires-Dist: mypy-extensions >=1.0.0
18
+ Requires-Dist: packaging >=23.1
19
+ Requires-Dist: python-dateutil >=2.8.2
20
+ Requires-Dist: requests >=2.31.0
21
+ Requires-Dist: six >=1.16.0
22
+ Requires-Dist: typing-inspect >=0.9.0
23
+ Requires-Dist: typing-extensions >=4.7.1
24
+ Requires-Dist: urllib3 >=1.26.18
25
+ Provides-Extra: dev
26
+ Requires-Dist: pylint ==2.16.2 ; extra == 'dev'
27
+
28
+ # plexpy
29
+
30
+ <div align="left">
31
+ <a href="https://speakeasyapi.dev/"><img src="https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge&logoColor=FBE331&logo=speakeasy&labelColor=545454" /></a>
32
+ <a href="https://opensource.org/licenses/MIT">
33
+ <img src="https://img.shields.io/badge/License-MIT-blue.svg" style="width: 100px; height: 28px;" />
34
+ </a>
35
+ </div>
36
+
37
+ <!-- Start SDK Installation [installation] -->
38
+ ## SDK Installation
39
+
40
+ ```bash
41
+ pip install plex-api-client
42
+ ```
43
+ <!-- End SDK Installation [installation] -->
44
+
45
+ <!-- Start SDK Example Usage [usage] -->
46
+ ## SDK Example Usage
47
+
48
+ ### Example
49
+
50
+ ```python
51
+ import plex_api
52
+
53
+ s = plex_api.PlexAPI(
54
+ access_token="<YOUR_API_KEY_HERE>",
55
+ x_plex_client_identifier='<value>',
56
+ )
57
+
58
+
59
+ res = s.server.get_server_capabilities()
60
+
61
+ if res.object is not None:
62
+ # handle response
63
+ pass
64
+
65
+ ```
66
+ <!-- End SDK Example Usage [usage] -->
67
+
68
+ <!-- Start Available Resources and Operations [operations] -->
69
+ ## Available Resources and Operations
70
+
71
+ ### [server](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md)
72
+
73
+ * [get_server_capabilities](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md#get_server_capabilities) - Server Capabilities
74
+ * [get_server_preferences](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md#get_server_preferences) - Get Server Preferences
75
+ * [get_available_clients](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md#get_available_clients) - Get Available Clients
76
+ * [get_devices](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md#get_devices) - Get Devices
77
+ * [get_server_identity](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md#get_server_identity) - Get Server Identity
78
+ * [get_my_plex_account](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md#get_my_plex_account) - Get MyPlex Account
79
+ * [get_resized_photo](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md#get_resized_photo) - Get a Resized Photo
80
+ * [get_server_list](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md#get_server_list) - Get Server List
81
+
82
+ ### [media](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/media/README.md)
83
+
84
+ * [mark_played](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/media/README.md#mark_played) - Mark Media Played
85
+ * [mark_unplayed](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/media/README.md#mark_unplayed) - Mark Media Unplayed
86
+ * [update_play_progress](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/media/README.md#update_play_progress) - Update Media Play Progress
87
+
88
+ ### [video](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/video/README.md)
89
+
90
+ * [get_timeline](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/video/README.md#get_timeline) - Get the timeline for a media item
91
+ * [start_universal_transcode](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/video/README.md#start_universal_transcode) - Start Universal Transcode
92
+
93
+ ### [activities](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/activities/README.md)
94
+
95
+ * [get_server_activities](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/activities/README.md#get_server_activities) - Get Server Activities
96
+ * [cancel_server_activities](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/activities/README.md#cancel_server_activities) - Cancel Server Activities
97
+
98
+ ### [butler](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/butler/README.md)
99
+
100
+ * [get_butler_tasks](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/butler/README.md#get_butler_tasks) - Get Butler tasks
101
+ * [start_all_tasks](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/butler/README.md#start_all_tasks) - Start all Butler tasks
102
+ * [stop_all_tasks](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/butler/README.md#stop_all_tasks) - Stop all Butler tasks
103
+ * [start_task](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/butler/README.md#start_task) - Start a single Butler task
104
+ * [stop_task](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/butler/README.md#stop_task) - Stop a single Butler task
105
+
106
+ ### [hubs](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/hubs/README.md)
107
+
108
+ * [get_global_hubs](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/hubs/README.md#get_global_hubs) - Get Global Hubs
109
+ * [get_library_hubs](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/hubs/README.md#get_library_hubs) - Get library specific hubs
110
+
111
+ ### [search](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/search/README.md)
112
+
113
+ * [perform_search](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/search/README.md#perform_search) - Perform a search
114
+ * [perform_voice_search](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/search/README.md#perform_voice_search) - Perform a voice search
115
+ * [get_search_results](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/search/README.md#get_search_results) - Get Search Results
116
+
117
+ ### [library](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md)
118
+
119
+ * [get_file_hash](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#get_file_hash) - Get Hash Value
120
+ * [get_recently_added](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#get_recently_added) - Get Recently Added
121
+ * [get_libraries](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#get_libraries) - Get All Libraries
122
+ * [get_library](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#get_library) - Get Library Details
123
+ * [delete_library](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#delete_library) - Delete Library Section
124
+ * [get_library_items](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#get_library_items) - Get Library Items
125
+ * [refresh_library](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#refresh_library) - Refresh Library
126
+ * [search_library](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#search_library) - Search Library
127
+ * [get_metadata](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#get_metadata) - Get Items Metadata
128
+ * [get_metadata_children](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#get_metadata_children) - Get Items Children
129
+ * [get_on_deck](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#get_on_deck) - Get On Deck
130
+
131
+ ### [log](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/log/README.md)
132
+
133
+ * [log_line](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/log/README.md#log_line) - Logging a single line message.
134
+ * [log_multi_line](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/log/README.md#log_multi_line) - Logging a multi-line message
135
+ * [enable_paper_trail](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/log/README.md#enable_paper_trail) - Enabling Papertrail
136
+
137
+ ### [plex](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/plex/README.md)
138
+
139
+ * [get_pin](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/plex/README.md#get_pin) - Get a Pin
140
+ * [get_token](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/plex/README.md#get_token) - Get Access Token
141
+
142
+ ### [playlists](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md)
143
+
144
+ * [create_playlist](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#create_playlist) - Create a Playlist
145
+ * [get_playlists](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#get_playlists) - Get All Playlists
146
+ * [get_playlist](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#get_playlist) - Retrieve Playlist
147
+ * [delete_playlist](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#delete_playlist) - Deletes a Playlist
148
+ * [update_playlist](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#update_playlist) - Update a Playlist
149
+ * [get_playlist_contents](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#get_playlist_contents) - Retrieve Playlist Contents
150
+ * [clear_playlist_contents](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#clear_playlist_contents) - Delete Playlist Contents
151
+ * [add_playlist_contents](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#add_playlist_contents) - Adding to a Playlist
152
+ * [upload_playlist](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#upload_playlist) - Upload Playlist
153
+
154
+ ### [authentication](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/authentication/README.md)
155
+
156
+ * [get_transient_token](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/authentication/README.md#get_transient_token) - Get a Transient Token.
157
+ * [get_source_connection_information](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/authentication/README.md#get_source_connection_information) - Get Source Connection Information
158
+
159
+ ### [statistics](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/statistics/README.md)
160
+
161
+ * [get_statistics](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/statistics/README.md#get_statistics) - Get Media Statistics
162
+
163
+ ### [sessions](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/sessions/README.md)
164
+
165
+ * [get_sessions](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/sessions/README.md#get_sessions) - Get Active Sessions
166
+ * [get_session_history](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/sessions/README.md#get_session_history) - Get Session History
167
+ * [get_transcode_sessions](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/sessions/README.md#get_transcode_sessions) - Get Transcode Sessions
168
+ * [stop_transcode_session](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/sessions/README.md#stop_transcode_session) - Stop a Transcode Session
169
+
170
+ ### [updater](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/updater/README.md)
171
+
172
+ * [get_update_status](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/updater/README.md#get_update_status) - Querying status of updates
173
+ * [check_for_updates](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/updater/README.md#check_for_updates) - Checking for updates
174
+ * [apply_updates](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/updater/README.md#apply_updates) - Apply Updates
175
+ <!-- End Available Resources and Operations [operations] -->
176
+
177
+ <!-- Start Error Handling [errors] -->
178
+ ## Error Handling
179
+
180
+ Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.
181
+
182
+ | Error Object | Status Code | Content Type |
183
+ | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
184
+ | errors.GetServerCapabilitiesResponseBody | 401 | application/json |
185
+ | errors.SDKError | 4xx-5xx | */* |
186
+
187
+ ### Example
188
+
189
+ ```python
190
+ import plex_api
191
+ from plex_api.models import errors
192
+
193
+ s = plex_api.PlexAPI(
194
+ access_token="<YOUR_API_KEY_HERE>",
195
+ x_plex_client_identifier='<value>',
196
+ )
197
+
198
+
199
+ res = None
200
+ try:
201
+ res = s.server.get_server_capabilities()
202
+ except errors.GetServerCapabilitiesResponseBody as e:
203
+ # handle exception
204
+ raise(e)
205
+ except errors.SDKError as e:
206
+ # handle exception
207
+ raise(e)
208
+
209
+ if res.object is not None:
210
+ # handle response
211
+ pass
212
+
213
+ ```
214
+ <!-- End Error Handling [errors] -->
215
+
216
+ <!-- Start Server Selection [server] -->
217
+ ## Server Selection
218
+
219
+ ### Select Server by Index
220
+
221
+ You can override the default server globally by passing a server index to the `server_idx: int` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
222
+
223
+ | # | Server | Variables |
224
+ | - | ------ | --------- |
225
+ | 0 | `{protocol}://{ip}:{port}` | `protocol` (default is `http`), `ip` (default is `10.10.10.47`), `port` (default is `32400`) |
226
+
227
+ #### Example
228
+
229
+ ```python
230
+ import plex_api
231
+
232
+ s = plex_api.PlexAPI(
233
+ server_idx=0,
234
+ access_token="<YOUR_API_KEY_HERE>",
235
+ x_plex_client_identifier='<value>',
236
+ )
237
+
238
+
239
+ res = s.server.get_server_capabilities()
240
+
241
+ if res.object is not None:
242
+ # handle response
243
+ pass
244
+
245
+ ```
246
+
247
+ #### Variables
248
+
249
+ Some of the server options above contain variables. If you want to set the values of those variables, the following optional parameters are available when initializing the SDK client instance:
250
+ * `protocol: models.ServerProtocol`
251
+ * `ip: str`
252
+ * `port: str`
253
+
254
+ ### Override Server URL Per-Client
255
+
256
+ The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
257
+ ```python
258
+ import plex_api
259
+
260
+ s = plex_api.PlexAPI(
261
+ server_url="{protocol}://{ip}:{port}",
262
+ access_token="<YOUR_API_KEY_HERE>",
263
+ x_plex_client_identifier='<value>',
264
+ )
265
+
266
+
267
+ res = s.server.get_server_capabilities()
268
+
269
+ if res.object is not None:
270
+ # handle response
271
+ pass
272
+
273
+ ```
274
+
275
+ ### Override Server URL Per-Operation
276
+
277
+ The server URL can also be overridden on a per-operation basis, provided a server list was specified for the operation. For example:
278
+ ```python
279
+ import plex_api
280
+
281
+ s = plex_api.PlexAPI(
282
+ x_plex_client_identifier='<value>',
283
+ )
284
+
285
+
286
+ res = s.plex.get_pin(server_url="https://plex.tv/api/v2", strong=False, x_plex_client_identifier='<value>')
287
+
288
+ if res.object is not None:
289
+ # handle response
290
+ pass
291
+
292
+ ```
293
+ <!-- End Server Selection [server] -->
294
+
295
+ <!-- Start Custom HTTP Client [http-client] -->
296
+ ## Custom HTTP Client
297
+
298
+ The Python SDK makes API calls using the [requests](https://pypi.org/project/requests/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `requests.Session` object.
299
+
300
+ For example, you could specify a header for every request that this sdk makes as follows:
301
+ ```python
302
+ import plex_api
303
+ import requests
304
+
305
+ http_client = requests.Session()
306
+ http_client.headers.update({'x-custom-header': 'someValue'})
307
+ s = plex_api.PlexAPI(client=http_client)
308
+ ```
309
+ <!-- End Custom HTTP Client [http-client] -->
310
+
311
+ <!-- Start Authentication [security] -->
312
+ ## Authentication
313
+
314
+ ### Per-Client Security Schemes
315
+
316
+ This SDK supports the following security scheme globally:
317
+
318
+ | Name | Type | Scheme |
319
+ | -------------- | -------------- | -------------- |
320
+ | `access_token` | apiKey | API key |
321
+
322
+ To authenticate with the API the `access_token` parameter must be set when initializing the SDK client instance. For example:
323
+ ```python
324
+ import plex_api
325
+
326
+ s = plex_api.PlexAPI(
327
+ access_token="<YOUR_API_KEY_HERE>",
328
+ x_plex_client_identifier='<value>',
329
+ )
330
+
331
+
332
+ res = s.server.get_server_capabilities()
333
+
334
+ if res.object is not None:
335
+ # handle response
336
+ pass
337
+
338
+ ```
339
+ <!-- End Authentication [security] -->
340
+
341
+ <!-- Start Global Parameters [global-parameters] -->
342
+ ## Global Parameters
343
+
344
+ A parameter is configured globally. This parameter must be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.
345
+
346
+ For example, you can set `X-Plex-Client-Identifier` to `'<value>'` at SDK initialization and then you do not have to pass the same value on calls to operations like `get_pin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
347
+
348
+
349
+ ### Available Globals
350
+
351
+ The following global parameter is available. The required parameter must be set when you initialize the SDK client.
352
+
353
+ | Name | Type | Required | Description |
354
+ | ---- | ---- |:--------:| ----------- |
355
+ | x_plex_client_identifier | str | ✔️ | The unique identifier for the client application
356
+ This is used to track the client application and its usage
357
+ (UUID, serial number, or other number unique per device)
358
+ |
359
+
360
+
361
+ ### Example
362
+
363
+ ```python
364
+ import plex_api
365
+
366
+ s = plex_api.PlexAPI(
367
+ x_plex_client_identifier='<value>',
368
+ )
369
+
370
+
371
+ res = s.plex.get_pin(strong=False, x_plex_client_identifier='<value>')
372
+
373
+ if res.object is not None:
374
+ # handle response
375
+ pass
376
+
377
+ ```
378
+ <!-- End Global Parameters [global-parameters] -->
379
+
380
+ <!-- Placeholder for Future Speakeasy SDK Sections -->
381
+
382
+ # Development
383
+
384
+ ## Maturity
385
+
386
+ This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
387
+ to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
388
+ looking for the latest version.
389
+
390
+ ## Contributions
391
+
392
+ While we value open-source contributions to this SDK, this library is generated programmatically.
393
+ Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!
394
+
395
+ ### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)
396
+
397
+