From 3f3badfd992d0802d1b84a38e8f35a18029ccd7b Mon Sep 17 00:00:00 2001 From: bigboy-baby <63435309+bigboy-baby@users.noreply.github.com> Date: Fri, 10 Feb 2023 10:44:10 -0500 Subject: [PATCH] Add files via upload --- Blooker/__init__.py | 62 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Blooker/__init__.py diff --git a/Blooker/__init__.py b/Blooker/__init__.py new file mode 100644 index 0000000..18b5e12 --- /dev/null +++ b/Blooker/__init__.py @@ -0,0 +1,62 @@ +import threading +import requests, websocket, json, random, string + +status = "" + +def __init__(): + pass + +class bot: + def join_e(code, name, blook): + rnd = ('').join(random.choices(string.digits, k=5)) + gameName = f"{name}_{rnd}" + d = {"id":code,"name":gameName} + s = requests.session() + s.get("https://play.blooket.com/play") + r = s.put("https://fb.blooket.com/c/firebase/join", json=d) + res = r.json() + verif = res["fbToken"] + end_part = res["fbShardURL"] + end_part2 = end_part.replace("https://", "") + ns = end_part2.replace(".firebaseio.com/", "") + + d2 = {"token":verif,"returnSecureToken":True} + r2 = s.post("https://identitytoolkit.googleapis.com/v1/accounts:signInWithCustomToken?key=AIzaSyCA-cTOnX19f6LFnDVVsHXya3k6ByP_MnU", json=d2) + res2 = r2.json() + cred = res2["idToken"] + + ws1 = websocket.WebSocket() + ws1.connect(f'wss://s-usc1c-nss-200.firebaseio.com/.ws?v=5&ns={ns}') + dat = json.loads(ws1.recv()) + ws1.close() + server = dat["d"]["d"] + newUrl = f"wss://{server}/.ws?v=5&p=1:741533559105:web:b8cbb10e6123f2913519c0&ns={ns}" + ws = websocket.WebSocket() + ws.connect(newUrl) + msg1 = {"t":"d","d":{"r":1,"a":"s","b":{"c":{"sdk.js.9-16-0":1}}}} + ws.send(json.dumps(msg1)) + msg2 = {"t":"d","d":{"r":2,"a":"auth","b":{"cred":cred}}} + ws.send(json.dumps(msg2)) + msg3 = {"t":"d","d":{"r":3,"a":"q","b":{"p":f"/{code}","h":""}}} + ws.send(json.dumps(msg3)) + msg4 = {"t":"d","d":{"r":4,"a":"n","b":{"p":f"/{code}"}}} + ws.send(json.dumps(msg4)) + msg5 = {"t":"d","d":{"r":5,"a":"p","b":{"p":f"/{code}/c/{gameName}","d":{"b":blook}}}} + ws.send(json.dumps(msg5)) + msg6 = {"t":"d","d":{"r":6,"a":"q","b":{"p":f"/{code}/c","h":""}}} + ws.send(json.dumps(msg6)) + msg7 = {"t":"d","d":{"r":7,"a":"q","b":{"p":f"/{code}/stg","h":""}}} + ws.send(json.dumps(msg7)) + msg8 = {"t":"d","d":{"r":8,"a":"p","b":{"p":f"/{code}/c/{gameName}","d":{"b":blook}}}} + ws.send(json.dumps(msg8)) + ws.close() + + def join(code, name, blook): + try: + x = threading.Thread(target=bot.join_e, args=(code,name,blook)) + x.start() + return True + except: + pass + return False + \ No newline at end of file