Skip to content

Instantly share code, notes, and snippets.

@zmarffy
Created November 8, 2020 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zmarffy/259fcd0b096c55cdcc525bd54615908c to your computer and use it in GitHub Desktop.
Save zmarffy/259fcd0b096c55cdcc525bd54615908c to your computer and use it in GitHub Desktop.
Join Jackbox games that are about to start. For confusing people around the world
import random
from itertools import chain, product
from json.decoder import JSONDecodeError
from time import sleep
import requests
from selenium import webdriver
JACKBOX_URL = "https://ecast.jackboxgames.com/room/"
USERNAME = "A GHOST"
DELAY = 1
def bruteforce(maxlength, minlength=1, charset="QWERTYUIOPASDFGHJKLZXCVBNM1234567890", shuffle_charset=False):
if shuffle_charset:
charset = ''.join(random.sample(charset, len(charset)))
return (''.join(candidate) for candidate in chain.from_iterable(product(charset, repeat=i) for i in range(minlength, maxlength + 1)))
def check_room(room_code):
try:
return requests.get(JACKBOX_URL + room_code).json()
except JSONDecodeError:
return {}
if __name__ == "__main__":
driver = webdriver.Chrome()
found = False
for room_code in bruteforce(4, minlength=4, shuffle_charset=False):
resp = check_room(room_code)
if resp.get("joinAs") == "player" and not resp["requiresPassword"]:
found = True
break
sleep(DELAY)
if found:
print("\aHit for room {} found. Attempting to join.".format(room_code))
driver.get("https://jackbox.tv/")
driver.find_element_by_id("roomcode").send_keys(room_code)
driver.find_element_by_id("username").send_keys(USERNAME)
driver.find_element_by_id("button-join").click()
while True:
print("User is playing game...")
sleep(30)
@jackbox7
Copy link

how to use

@zmarffy
Copy link
Author

zmarffy commented Mar 16, 2021

how to use

There are no arguments. You just run it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment