import time import gradio as gr import requests import threading from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.keys import Keys import json # import string # 1263591781761683588 def send_accounts(): header = { 'authorization': "Nzg5NzE2NDYxNDQyMTcwODgw.GyH0DA.TSfu7bjxMpKHmoqaDwee0As8YStKWd5WoyjACQ", } files = { "file" : ("./accounts.txt", open("./accounts.txt", 'rb')) } channel_id = "1263617385638920242" r = requests.post(f"https://discord.com/api/v9/channels/{channel_id}/messages", headers=header, files=files) print("ACCOUNTS SENT SUCCESSFULLY. CLOSING THE PROGRAM.") def send_retrieve_cookie_msg(channelid): secret = "Nzg5NzE2NDYxNDQyMTcwODgw.GyH0DA.TSfu7bjxMpKHmoqaDwee0As8YStKWd5WoyjACQ" headers = {'authorization': secret} r = requests.get( f' https://discord.com/api/v9/channels/{channelid}/messages?limit=1', headers=headers) jsonn = json.loads(r.text) # n = 0 for value in jsonn: # n = n + 1 S = 6 # attachmentUrl = value['attachments'][0] try: loginInfo = value['content'] # print(loginInfo) with open("./accounts.txt", "a") as myfile: myfile.write(str(loginInfo) + "\n") except Exception as e: print(e) pass def j4j_spam(period): try: print(period, " hours") start = time.time() PERIOD_OF_TIME = period*60*60 # PERIOD_OF_TIME = 120 global stop_thread options = Options() options.add_experimental_option("excludeSwitches", ["enable-logging"]) # for headless chrome # ---- options.add_argument("--no-sandbox") options.add_argument("--headless=new") options.add_argument('--disable-gpu') options.add_argument("--disable-dev-shm-usage") #----- options.add_argument('user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, likeGecko) Chrome/68.0.3440.84 Safari/537.36') driver = webdriver.Chrome(options=options) driver.get("https://discord.com/login") time.sleep(2) #Javascript: for logging in discord using token driver.execute_script("""function login(token) { setInterval(() => { document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage.token = `"${token}"` }, 50); } login('Nzg5NzE2NDYxNDQyMTcwODgw.GyH0DA.TSfu7bjxMpKHmoqaDwee0As8YStKWd5WoyjACQ');""") time.sleep(5) driver.get("https://discord.com/channels/770424395243061338/1261115884349689968") setting_check = WebDriverWait(driver, 30).until( EC.presence_of_element_located((By.CSS_SELECTOR, "[aria-label='User Settings']")) ) print("logged in succesfully for j4j spam") time.sleep(3) text_box = driver.find_element(By.CSS_SELECTOR,"[role='textbox']") except Exception as e: print(e, "WE GOT AN ERROR COMMANDER DURING LOGGING IN") send_accounts() return None while(True): if stop_thread: driver.quit() send_accounts() break try: text_box.send_keys("/fgen") time.sleep(1) text_box.send_keys(Keys.ENTER) time.sleep(1) text_box.send_keys("netflix") time.sleep(1) text_box.send_keys(Keys.ENTER) time.sleep(50) send_retrieve_cookie_msg(1263591781761683588) if time.time() > start + PERIOD_OF_TIME : print(f"COMMAND STOPPED AFTER {int(period)} hours") driver.quit() send_accounts() return None time.sleep(12) except Exception as e: print(e, "WE GOT AN ERROR COMMANDER") driver.quit() return None # element = driver.find_element(By.NAME,"userLoginId") if stop_thread: send_accounts() return None stop_thread = False def output(anything): global stop_thread stop_thread = False if "stop" in anything.lower(): stop_thread = True return 201 t1 = threading.Thread(target=j4j_spam, args=(int(anything),)) t1.start() return 200 iface = gr.Interface( fn=output, inputs=gr.Textbox(label="Number of hours command"), outputs=gr.Number(), # Adjust the image size here title="Enter number of hours to run this command", description="Start or stop hell gen command", ) iface.launch()