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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import time
|
| 2 |
+
import gradio as gr
|
| 3 |
+
import requests
|
| 4 |
+
import threading
|
| 5 |
+
from selenium import webdriver
|
| 6 |
+
from selenium.webdriver.chrome.options import Options
|
| 7 |
+
from selenium.webdriver.common.by import By
|
| 8 |
+
from selenium.webdriver.support.wait import WebDriverWait
|
| 9 |
+
from selenium.webdriver.support import expected_conditions as EC
|
| 10 |
+
from selenium.webdriver.common.keys import Keys
|
| 11 |
+
import json
|
| 12 |
+
# import string
|
| 13 |
+
# 1263591781761683588
|
| 14 |
+
def send_accounts():
|
| 15 |
+
header = {
|
| 16 |
+
'authorization': "Nzg5NzE2NDYxNDQyMTcwODgw.GyH0DA.TSfu7bjxMpKHmoqaDwee0As8YStKWd5WoyjACQ",
|
| 17 |
+
}
|
| 18 |
+
files = {
|
| 19 |
+
"file" : ("./accounts.txt", open("./accounts.txt", 'rb'))
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
channel_id = "1263617385638920242"
|
| 23 |
+
|
| 24 |
+
r = requests.post(f"https://discord.com/api/v9/channels/{channel_id}/messages", headers=header, files=files)
|
| 25 |
+
print("ACCOUNTS SENT SUCCESSFULLY. CLOSING THE PROGRAM.")
|
| 26 |
+
|
| 27 |
+
def send_retrieve_cookie_msg(channelid):
|
| 28 |
+
secret = "Nzg5NzE2NDYxNDQyMTcwODgw.GyH0DA.TSfu7bjxMpKHmoqaDwee0As8YStKWd5WoyjACQ"
|
| 29 |
+
|
| 30 |
+
headers = {'authorization': secret}
|
| 31 |
+
r = requests.get(
|
| 32 |
+
f' https://discord.com/api/v9/channels/{channelid}/messages?limit=1',
|
| 33 |
+
headers=headers)
|
| 34 |
+
jsonn = json.loads(r.text)
|
| 35 |
+
# n = 0
|
| 36 |
+
for value in jsonn:
|
| 37 |
+
# n = n + 1
|
| 38 |
+
S = 6
|
| 39 |
+
|
| 40 |
+
# attachmentUrl = value['attachments'][0]
|
| 41 |
+
try:
|
| 42 |
+
loginInfo = value['content']
|
| 43 |
+
# print(loginInfo)
|
| 44 |
+
with open("./accounts.txt", "a") as myfile:
|
| 45 |
+
myfile.write(loginInfo)
|
| 46 |
+
|
| 47 |
+
except Exception as e:
|
| 48 |
+
print(e)
|
| 49 |
+
pass
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def j4j_spam(period):
|
| 53 |
+
try:
|
| 54 |
+
print(period, " hours")
|
| 55 |
+
start = time.time()
|
| 56 |
+
PERIOD_OF_TIME = period*60*60
|
| 57 |
+
# PERIOD_OF_TIME = 120
|
| 58 |
+
global stop_thread
|
| 59 |
+
options = Options()
|
| 60 |
+
options.add_experimental_option("excludeSwitches", ["enable-logging"])
|
| 61 |
+
|
| 62 |
+
# for headless chrome
|
| 63 |
+
# ----
|
| 64 |
+
options.add_argument("--no-sandbox")
|
| 65 |
+
options.add_argument("--headless=new")
|
| 66 |
+
options.add_argument('--disable-gpu')
|
| 67 |
+
options.add_argument("--disable-dev-shm-usage")
|
| 68 |
+
#-----
|
| 69 |
+
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')
|
| 70 |
+
|
| 71 |
+
driver = webdriver.Chrome(options=options)
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
driver.get("https://discord.com/login")
|
| 75 |
+
|
| 76 |
+
time.sleep(2)
|
| 77 |
+
|
| 78 |
+
#Javascript: for logging in discord using token
|
| 79 |
+
driver.execute_script("""function login(token) {
|
| 80 |
+
setInterval(() => {
|
| 81 |
+
document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage.token = `"${token}"`
|
| 82 |
+
}, 50);
|
| 83 |
+
|
| 84 |
+
}
|
| 85 |
+
login('Nzg5NzE2NDYxNDQyMTcwODgw.GyH0DA.TSfu7bjxMpKHmoqaDwee0As8YStKWd5WoyjACQ');""")
|
| 86 |
+
|
| 87 |
+
time.sleep(5)
|
| 88 |
+
driver.get("https://discord.com/channels/770424395243061338/1261115884349689968")
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
setting_check = WebDriverWait(driver, 30).until(
|
| 92 |
+
EC.presence_of_element_located((By.CSS_SELECTOR, "[aria-label='User Settings']"))
|
| 93 |
+
)
|
| 94 |
+
print("logged in succesfully for j4j spam")
|
| 95 |
+
|
| 96 |
+
time.sleep(3)
|
| 97 |
+
text_box = driver.find_element(By.CSS_SELECTOR,"[role='textbox']")
|
| 98 |
+
except Exception as e:
|
| 99 |
+
print(e, "WE GOT AN ERROR COMMANDER DURING LOGGING IN")
|
| 100 |
+
send_accounts()
|
| 101 |
+
return None
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
|
| 106 |
+
while(True):
|
| 107 |
+
if stop_thread:
|
| 108 |
+
driver.quit()
|
| 109 |
+
send_accounts()
|
| 110 |
+
break
|
| 111 |
+
try:
|
| 112 |
+
text_box.send_keys("/fgen")
|
| 113 |
+
time.sleep(1)
|
| 114 |
+
text_box.send_keys(Keys.ENTER)
|
| 115 |
+
time.sleep(1)
|
| 116 |
+
text_box.send_keys("netflix")
|
| 117 |
+
time.sleep(1)
|
| 118 |
+
text_box.send_keys(Keys.ENTER)
|
| 119 |
+
time.sleep(20)
|
| 120 |
+
send_retrieve_cookie_msg(1263591781761683588)
|
| 121 |
+
if time.time() > start + PERIOD_OF_TIME :
|
| 122 |
+
print(f"COMMAND STOPPED AFTER {int(period)} hours")
|
| 123 |
+
|
| 124 |
+
driver.quit()
|
| 125 |
+
send_accounts()
|
| 126 |
+
return None
|
| 127 |
+
time.sleep(42)
|
| 128 |
+
except Exception as e:
|
| 129 |
+
print(e, "WE GOT AN ERROR COMMANDER")
|
| 130 |
+
driver.quit()
|
| 131 |
+
return None
|
| 132 |
+
# element = driver.find_element(By.NAME,"userLoginId")
|
| 133 |
+
if stop_thread:
|
| 134 |
+
send_accounts()
|
| 135 |
+
return None
|
| 136 |
+
|
| 137 |
+
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
stop_thread = False
|
| 141 |
+
|
| 142 |
+
|
| 143 |
+
def output(anything):
|
| 144 |
+
global stop_thread
|
| 145 |
+
stop_thread = False
|
| 146 |
+
if "stop" in anything.lower():
|
| 147 |
+
stop_thread = True
|
| 148 |
+
return 201
|
| 149 |
+
t1 = threading.Thread(target=j4j_spam, args=(int(anything),))
|
| 150 |
+
|
| 151 |
+
t1.start()
|
| 152 |
+
return 200
|
| 153 |
+
|
| 154 |
+
|
| 155 |
+
iface = gr.Interface(
|
| 156 |
+
fn=output,
|
| 157 |
+
inputs=gr.Textbox(label="Number of hours command"),
|
| 158 |
+
outputs=gr.Number(), # Adjust the image size here
|
| 159 |
+
title="Enter number of hours to run this command",
|
| 160 |
+
description="Start or stop hell gen command",
|
| 161 |
+
)
|
| 162 |
+
|
| 163 |
+
iface.launch()
|
| 164 |
+
|
requirements.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
selenium >=4.0.0, < 5.0.0
|
| 2 |
+
gradio_client
|