1
Fork 0

commentaar toegevoegd

This commit is contained in:
Ventilaar 2021-01-18 12:04:55 +01:00
parent 3d52e89df1
commit 457269fc01
1 changed files with 6 additions and 5 deletions

View File

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