def __get_token(self): pin = self.pin_edit_control.getText().strip() if pin: try: trakt_api = Trakt_API(use_https=use_https, timeout=trakt_timeout) result = trakt_api.get_token(pin=pin) _SALTS.set_setting('trakt_oauth_token', result['access_token']) _SALTS.set_setting('trakt_refresh_token', result['refresh_token']) return True except: return False return False
def __get_token(self): pin = self.pin_edit_control.getText().strip() if pin: try: trakt_api = Trakt_API(use_https=use_https, timeout=trakt_timeout) result = trakt_api.get_token(pin=pin) kodi.set_setting('trakt_oauth_token', result['access_token']) kodi.set_setting('trakt_refresh_token', result['refresh_token']) return True except: return False return False
def __get_token(self): pin = self.pin_edit_control.getText().strip() if pin: try: trakt_api = Trakt_API(use_https=use_https, timeout=trakt_timeout) result = trakt_api.get_token(pin=pin) kodi.set_setting('trakt_oauth_token', result['access_token']) kodi.set_setting('trakt_refresh_token', result['refresh_token']) profile = trakt_api.get_user_profile(cached=False) kodi.set_setting('trakt_user', '%s (%s)' % (profile['username'], profile['name'])) return True except: return False return False
def __get_token(self): pin = self.pin_edit_control.getText().strip() if pin: try: trakt_api = Trakt_API(use_https=use_https, timeout=trakt_timeout) result = trakt_api.get_token(pin=pin) kodi.set_setting('trakt_oauth_token', result['access_token']) kodi.set_setting('trakt_refresh_token', result['refresh_token']) profile = trakt_api.get_user_profile(cached=False) kodi.set_setting( 'trakt_user', '%s (%s)' % (profile['username'], profile['name'])) return True except: return False return False