diff --git a/web.py b/web.py index 42d8c0b..93517ae 100755 --- a/web.py +++ b/web.py @@ -92,7 +92,10 @@ def home(): #update cc avi too r = requests.get("https://curiouscat.me/api/v2/profile?username={}".format(session['cc'])) j = r.json() - session['ccavi'] = j['userData']['avatar'] + try: + session['ccavi'] = j['userData']['avatar'] + except: + return json.dumps(j) c.execute("UPDATE data SET avi = %s, ccavi = %s WHERE client_id = %s AND instance = %s", (session['avi'], session['ccavi'], session['client_id'], session['instance'])) else: c.execute("UPDATE data SET avi = %s WHERE client_id = %s AND instance = %s", (session['avi'], session['client_id'], session['instance']))