Handle new zKillboard API format

Closes #872
This commit is contained in:
Adarnof
2017-10-01 12:53:03 -04:00
parent 0145ea82c8
commit 313cac6ac7
2 changed files with 9 additions and 9 deletions

View File

@@ -27,11 +27,11 @@ class srpManager:
r = requests.get(url, headers=headers)
result = r.json()[0]
if result:
ship_type = result['victim']['shipTypeID']
logger.debug("Ship type for kill ID %s is determined to be %s" % (kill_id, ship_type))
ship_type = result['victim']['ship_type_id']
logger.debug("Ship type for kill ID %s is %s" % (kill_id, ship_type))
ship_value = result['zkb']['totalValue']
logger.debug("total loss value for kill id %s is %s" % (kill_id, ship_value))
victim_name = result['victim']['characterName']
return ship_type, ship_value, victim_name
logger.debug("Total loss value for kill id %s is %s" % (kill_id, ship_value))
victim_id = result['victim']['character_id']
return ship_type, ship_value, victim_id
else:
raise ValueError("Invalid Kill ID")