Update server.py

add a way to get a transit token. Dunno about the name.
This commit is contained in:
Hellowlol 2019-06-29 22:16:55 +02:00
parent 2b45284c3d
commit 4c04b76690

View file

@ -183,6 +183,11 @@ class PlexServer(PlexObject):
data = self.query(Account.key)
return Account(self, data)
def createToken(self, type='delegation', scope='all'):
"""Create a temp access token for the server."""
q = self.query('/security/token?type=%s&scope=%s' % (type, scope))
return q.attrib.get('token')
def systemAccounts(self):
""" Returns the :class:`~plexapi.server.SystemAccounts` objects this server contains. """
accounts = []