Thank You ! It helped me debug and finde the issue. I did as @Justinas said:
try:
httprequest = Request(base_url + end_point, data=postdata, method="POST", headers=headers)
with urlopen(httprequest) as response:
responddata = json.loads(response.read().decode())
AccessToken = responddata['AccessToken']
ServerId = responddata['ServerId']
UserId = responddata['User']['Id']
except:
AccessToken = "null"
ServerId = "null"
UserId = "null"
return {"ak_proxy": {"user_attributes": {"additionalHeaders": {"X-Emby-Token": AccessToken, "X-Emby-ServerId": ServerId, "X-Emby-UserId": UserId}}}}
I seperated each output and the issue was with the Value of ID. JSON Data is an array and the value if ID is part of User.