Skip to content

Commit 66189af

Browse files
committed
Merge branch 'master' of github.com:pkkid/python-plexapi
2 parents ac471ec + 0f9cb40 commit 66189af

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

docs/configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ are optional. An example config.ini file may look like the following with all po
2121
client_baseurl = http://127.0.0.1:32433
2222
client_token = BDFSLCNSNL789FH7
2323
24-
[headers]
24+
[header]
2525
identifier = 0x485b314307f3L
2626
platorm = Linux
2727
platform_version = 4.4.0-62-generic

plexapi/server.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,12 @@ def account(self):
182182
""" Returns the :class:`~plexapi.server.Account` object this server belongs to. """
183183
data = self.query(Account.key)
184184
return Account(self, data)
185-
185+
186+
def createToken(self, type='delegation', scope='all'):
187+
"""Create a temp access token for the server."""
188+
q = self.query('/security/token?type=%s&scope=%s' % (type, scope))
189+
return q.attrib.get('token')
190+
186191
def systemAccounts(self):
187192
""" Returns the :class:`~plexapi.server.SystemAccounts` objects this server contains. """
188193
accounts = []
@@ -325,7 +330,7 @@ def history(self, maxresults=9999999, mindate=None):
325330
326331
Parameters:
327332
maxresults (int): Only return the specified number of results (optional).
328-
mindate (datetime): Min datetime to return results from. This really helps speed
333+
mindate (datetime): Min datetime to return results from. This really helps speed
329334
up the result listing. For example: datetime.now() - timedelta(days=7)
330335
"""
331336
results, subresults = [], '_init'

0 commit comments

Comments
 (0)