def two_step_verification(self, ticket_uuid):
dialog = xbmcgui.Dialog()
code = dialog.input(self.localized(30204), type=xbmcgui.INPUT_ALPHANUM)
if code == '': sys.exit()
url = self.api_url + '/ssocookie'
headers = {
"Accept": "*/*",
"Content-type": "application/x-www-form-urlencoded",
"Origin": "https://id.sonyentertainmentnetwork.com",
"Accept-Language": "en-US,en;q=0.8",
"Accept-Encoding": "deflate",
"User-Agent": self.ua_android_tv,
"Connection": "Keep-Alive",
"Referer": "https://id.sonyentertainmentnetwork.com/signin/?service_entity=urn:service-entity:psn&ui=pr&service_logo=ps&response_type=code&scope=psn:s2s&client_id="+self.req_client_id+"&request_locale=en_US&redirect_uri=https://io.playstation.com/playstation/psn/acceptLogin&error=login_required&error_code=4165&error_description=User+is+not+authenticated"
}
payload = 'authentication_type=two_step&ticket_uuid='+ticket_uuid+'&code='+code+'&client_id='+self.login_client_id
r = requests.post(url, headers=headers, cookies=self.load_cookies(), data=payload, verify=self.verify)
json_source = r.json()
self.save_cookies(r.cookies)
if 'npsso' in json_source:
npsso = json_source['npsso']
self.addon.setSetting(id='npsso', value=npsso)
elif 'error_description' in json_source:
msg = json_source['error_description']
self.notification_msg(self.localized(30200), msg)
sys.exit()
else:
# Something went wrong during login
self.notification_msg(self.localized(30200), self.localized(30201))
sys.exit()
评论列表
文章目录