Fixed some plex.tv token issue

This commit is contained in:
tomkat83 2016-03-17 12:45:38 +01:00
parent 71492af87f
commit 9f8343113a
3 changed files with 3 additions and 4 deletions

View file

@ -1179,7 +1179,6 @@ class PlexAPI():
for the machineIdentifier that was chosen
}
Also sets the settings variable settings('accessToken'),
settings('userid') and settings('username') with new plex token
"""
url = 'https://plex.tv/api/home/users/' + userId + '/switch'

View file

@ -54,8 +54,8 @@ class InitialSetup():
if (plexToken and myplexlogin == 'true' and forcePlexTV is False):
chk = self.plx.CheckConnection('plex.tv', plexToken)
# HTTP Error: unauthorized. Token is no longer valid
if chk == 401:
self.logMsg('plex.tv connection returned HTTP 401', 0)
if chk == 401 or chk == 403:
self.logMsg('plex.tv connection returned HTTP %s' % chk, 0)
# Delete token in the settings
utils.settings('plexToken', value='')
# Could not login, please try again

View file

@ -198,7 +198,7 @@ class UserClient(threading.Thread):
window('pms_token', value=self.currToken)
# This is the token for plex.tv for the current user
# Is only '' if user is not signed in to plex.tv
window('plex_token', value=settings('accessToken'))
window('plex_token', value=settings('plexToken'))
window('pms_server', value=self.currServer)
window('plex_machineIdentifier', value=self.machineIdentifier)
window('plex_servername', value=self.servername)