1

commentaar toegevoegd

This commit is contained in:
Ventilaar 2021-01-18 12:04:55 +01:00
parent 3d52e89df1
commit 457269fc01

View File

@ -401,14 +401,15 @@ def getappdata(appid):
} }
} }
""" """
try: try: # proberen appid geforceerd in een integer om te zetten
appid = int(appid) appid = int(appid)
except ValueError: except ValueError: # als het niet mogelijk is False returnen
return False return False
# Steam api opvragen voor appid
r = requests.get('http://store.steampowered.com/api/appdetails', params={'appids': appid}) r = requests.get('http://store.steampowered.com/api/appdetails', params={'appids': appid})
if r.status_code != 200: if r.status_code != 200: # als de request niet is gelukt
return False return False # False returnen
return r.json() return r.json() # return de gekregen json zonder check