mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-06 15:16:20 +01:00
@@ -34,20 +34,3 @@ class srpManager:
|
||||
return ship_type, ship_value
|
||||
else:
|
||||
raise ValueError("Invalid Kill ID")
|
||||
|
||||
@staticmethod
|
||||
def get_ship_name(ship_type):
|
||||
url = ("https://jetbalsa.com/api/json.php/invTypes/%s" % ship_type)
|
||||
headers = {
|
||||
'User-Agent': "%s Alliance Auth" % settings.DOMAIN,
|
||||
'Content-Type': 'application/json',
|
||||
}
|
||||
r = requests.get(url, headers=headers)
|
||||
result = r.json()
|
||||
if result:
|
||||
ship_name = result['typeName']
|
||||
logger.debug("ship type %s determined to be %s" % (ship_type, ship_name))
|
||||
return ship_name
|
||||
else:
|
||||
logger.debug("ship type %s is invalid" % ship_type)
|
||||
raise ValueError("Cannot get ship name")
|
||||
|
||||
Reference in New Issue
Block a user