commentaar toegevoegd
This commit is contained in:
parent
3d52e89df1
commit
457269fc01
11
steam_api.py
11
steam_api.py
@ -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
|
||||||
|
Reference in New Issue
Block a user