File size: 4,704 Bytes
435848d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2f39c6b
435848d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c051dfb
435848d
 
 
 
 
 
 
c051dfb
435848d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
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()