def get_auth_token(self):
'''check for valid credentials and grab token'''
auth_token = None
username = self.addon.getSetting("username").decode("utf-8")
password = self.addon.getSetting("password").decode("utf-8")
if username and password:
self.spotty.username = username
self.spotty.password = password
auth_token = get_token(self.spotty)
if auth_token:
log_msg("Retrieved auth token")
# store authtoken as window prop for easy access by plugin entry
xbmc.executebuiltin("SetProperty(spotify-token, %s, Home)" % auth_token['access_token'])
return auth_token
评论列表
文章目录