mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-22 19:53:17 +00:00
Update server.py
add a way to get a transit token. Dunno about the name.
This commit is contained in:
parent
2b45284c3d
commit
4c04b76690
1 changed files with 7 additions and 2 deletions
|
@ -182,7 +182,12 @@ class PlexServer(PlexObject):
|
||||||
""" Returns the :class:`~plexapi.server.Account` object this server belongs to. """
|
""" Returns the :class:`~plexapi.server.Account` object this server belongs to. """
|
||||||
data = self.query(Account.key)
|
data = self.query(Account.key)
|
||||||
return Account(self, data)
|
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):
|
def systemAccounts(self):
|
||||||
""" Returns the :class:`~plexapi.server.SystemAccounts` objects this server contains. """
|
""" Returns the :class:`~plexapi.server.SystemAccounts` objects this server contains. """
|
||||||
accounts = []
|
accounts = []
|
||||||
|
@ -325,7 +330,7 @@ class PlexServer(PlexObject):
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
maxresults (int): Only return the specified number of results (optional).
|
maxresults (int): Only return the specified number of results (optional).
|
||||||
mindate (datetime): Min datetime to return results from. This really helps speed
|
mindate (datetime): Min datetime to return results from. This really helps speed
|
||||||
up the result listing. For example: datetime.now() - timedelta(days=7)
|
up the result listing. For example: datetime.now() - timedelta(days=7)
|
||||||
"""
|
"""
|
||||||
results, subresults = [], '_init'
|
results, subresults = [], '_init'
|
||||||
|
|
Loading…
Reference in a new issue