Spaces:
Paused
Paused
Update main.py
Browse files
main.py
CHANGED
|
@@ -13,25 +13,35 @@ PASS_TORN = "Miau.1996"
|
|
| 13 |
|
| 14 |
def log(acao, status="INFO"):
|
| 15 |
agora = datetime.now().strftime("%H:%M:%S")
|
| 16 |
-
icons = {"STATUS": "📊", "LOGIN": "🔑", "SISTEMA": "⚙️", "WAIT": "⏳", "SUCESSO": "✅", "ALERTA": "⚠️", "
|
| 17 |
print(f"[{agora}] [{icons.get(status, 'ℹ️')}] {acao}", flush=True)
|
| 18 |
|
| 19 |
class ServidorFalso(BaseHTTPRequestHandler):
|
| 20 |
def do_GET(self):
|
| 21 |
self.send_response(200); self.end_headers()
|
| 22 |
-
self.wfile.write(b"Bot Torn City v1.
|
| 23 |
def log_message(self, format, *args): pass
|
| 24 |
|
| 25 |
def realizar_login(driver):
|
| 26 |
-
log("
|
| 27 |
-
driver.get("https://www.torn.com/login.php")
|
| 28 |
-
time.sleep(10) # Tempo vital para o Cloudflare validar a ligação
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
try:
|
| 31 |
-
|
|
|
|
| 32 |
|
| 33 |
-
#
|
| 34 |
-
|
| 35 |
var userField = document.querySelector('input[placeholder*="Email"], input[type="email"], input[type="text"]');
|
| 36 |
var passField = document.querySelector('input[placeholder*="Password"], input[type="password"]');
|
| 37 |
|
|
@@ -43,39 +53,34 @@ def realizar_login(driver):
|
|
| 43 |
return false;
|
| 44 |
""")
|
| 45 |
|
| 46 |
-
if not
|
| 47 |
-
|
| 48 |
-
texto_tela = driver.find_element(By.TAG_NAME, "body").text[:150].replace('\n', ' | ')
|
| 49 |
-
log(f"Campos ocultos. O bot está a ver: {texto_tela}", "ALERTA")
|
| 50 |
return False
|
| 51 |
|
| 52 |
-
log("Credenciais
|
| 53 |
-
time.sleep(
|
| 54 |
|
| 55 |
-
log("Enviando comando de Log In...", "LOGIN")
|
| 56 |
-
# Clica no botão de login
|
| 57 |
driver.execute_script("""
|
| 58 |
var btn = document.querySelector('button[type="submit"], input[value*="Log In"], .login-btn');
|
| 59 |
if(btn) btn.click();
|
| 60 |
""")
|
| 61 |
|
| 62 |
-
|
| 63 |
-
log("PAUSA ESTRATÉGICA (15s) para validação do servidor...", "WAIT")
|
| 64 |
time.sleep(15)
|
| 65 |
|
| 66 |
if "logout" in driver.page_source.lower() or driver.is_element_visible('a[href*="logout"]'):
|
| 67 |
log("ACESSO TOTAL LIBERADO!", "SUCESSO")
|
| 68 |
return True
|
| 69 |
|
| 70 |
-
log("Login não confirmou. Possível captcha detetado após o clique.", "ALERTA")
|
| 71 |
return False
|
| 72 |
|
| 73 |
except Exception as e:
|
| 74 |
-
log(f"Crash
|
| 75 |
return False
|
| 76 |
|
| 77 |
def executar_farm(driver):
|
| 78 |
-
|
|
|
|
| 79 |
time.sleep(7)
|
| 80 |
|
| 81 |
driver.execute_script("jQuery('.msg-close, .tutorial-skip, .x-close').click();")
|
|
@@ -87,16 +92,16 @@ def executar_farm(driver):
|
|
| 87 |
nv: document.querySelector('span[class*="nerve___"]') ? document.querySelector('span[class*="nerve___"]').innerText : '0'
|
| 88 |
};
|
| 89 |
""")
|
| 90 |
-
log(f"STATUS ->
|
| 91 |
|
| 92 |
if int(stats['en']) >= 10:
|
| 93 |
-
driver.
|
| 94 |
time.sleep(5)
|
| 95 |
driver.execute_script("document.querySelector('button[aria-label*=\"Strength\"]').click();")
|
| 96 |
log("Treino de Força executado.", "SUCESSO")
|
| 97 |
|
| 98 |
except:
|
| 99 |
-
log("
|
| 100 |
|
| 101 |
def iniciar():
|
| 102 |
display = Display(visible=0, size=(1920, 1080)); display.start()
|
|
@@ -110,10 +115,9 @@ def iniciar():
|
|
| 110 |
time.sleep(300)
|
| 111 |
if "login" in driver.current_url: break
|
| 112 |
else:
|
| 113 |
-
log("
|
| 114 |
time.sleep(20)
|
| 115 |
-
|
| 116 |
-
except Exception as e: log(f"Crash: {e}", "ALERTA")
|
| 117 |
finally: driver.quit(); display.stop()
|
| 118 |
|
| 119 |
if __name__ == "__main__":
|
|
|
|
| 13 |
|
| 14 |
def log(acao, status="INFO"):
|
| 15 |
agora = datetime.now().strftime("%H:%M:%S")
|
| 16 |
+
icons = {"STATUS": "📊", "LOGIN": "🔑", "SISTEMA": "⚙️", "WAIT": "⏳", "SUCESSO": "✅", "ALERTA": "⚠️", "HACK": "🏴☠️"}
|
| 17 |
print(f"[{agora}] [{icons.get(status, 'ℹ️')}] {acao}", flush=True)
|
| 18 |
|
| 19 |
class ServidorFalso(BaseHTTPRequestHandler):
|
| 20 |
def do_GET(self):
|
| 21 |
self.send_response(200); self.end_headers()
|
| 22 |
+
self.wfile.write(b"Bot Torn City v1.8 - Cloudflare Bypass")
|
| 23 |
def log_message(self, format, *args): pass
|
| 24 |
|
| 25 |
def realizar_login(driver):
|
| 26 |
+
log("Enfrentando o Cloudflare (Bypass Mode)...", "HACK")
|
|
|
|
|
|
|
| 27 |
|
| 28 |
+
# 🏴☠️ O COMANDO MÁGICO: Abre, engana o Cloudflare e reconecta
|
| 29 |
+
driver.uc_open_with_reconnect("https://www.torn.com/login.php", 6)
|
| 30 |
+
time.sleep(10)
|
| 31 |
+
|
| 32 |
+
try:
|
| 33 |
+
# Se ainda houver um botão de captcha na tela, tenta clicar nele
|
| 34 |
+
driver.uc_gui_click_captcha()
|
| 35 |
+
time.sleep(5)
|
| 36 |
+
except:
|
| 37 |
+
pass # Se não houver captcha clicável, segue em frente
|
| 38 |
+
|
| 39 |
try:
|
| 40 |
+
titulo = driver.title
|
| 41 |
+
log(f"Barreira ultrapassada. Título atual: {titulo}", "SISTEMA")
|
| 42 |
|
| 43 |
+
# Injeção de Código Blindada
|
| 44 |
+
sucesso = driver.execute_script(f"""
|
| 45 |
var userField = document.querySelector('input[placeholder*="Email"], input[type="email"], input[type="text"]');
|
| 46 |
var passField = document.querySelector('input[placeholder*="Password"], input[type="password"]');
|
| 47 |
|
|
|
|
| 53 |
return false;
|
| 54 |
""")
|
| 55 |
|
| 56 |
+
if not sucesso:
|
| 57 |
+
log("Campos de login ainda não visíveis.", "ALERTA")
|
|
|
|
|
|
|
| 58 |
return False
|
| 59 |
|
| 60 |
+
log("Credenciais inseridas! Disparando botão...", "SUCESSO")
|
| 61 |
+
time.sleep(3)
|
| 62 |
|
|
|
|
|
|
|
| 63 |
driver.execute_script("""
|
| 64 |
var btn = document.querySelector('button[type="submit"], input[value*="Log In"], .login-btn');
|
| 65 |
if(btn) btn.click();
|
| 66 |
""")
|
| 67 |
|
| 68 |
+
log("Aguardando validação de entrada (15s)...", "WAIT")
|
|
|
|
| 69 |
time.sleep(15)
|
| 70 |
|
| 71 |
if "logout" in driver.page_source.lower() or driver.is_element_visible('a[href*="logout"]'):
|
| 72 |
log("ACESSO TOTAL LIBERADO!", "SUCESSO")
|
| 73 |
return True
|
| 74 |
|
|
|
|
| 75 |
return False
|
| 76 |
|
| 77 |
except Exception as e:
|
| 78 |
+
log(f"Crash: {str(e)[:50]}", "ALERTA")
|
| 79 |
return False
|
| 80 |
|
| 81 |
def executar_farm(driver):
|
| 82 |
+
# Usa o mesmo método seguro para navegar
|
| 83 |
+
driver.uc_open_with_reconnect("https://www.torn.com/index.php", 4)
|
| 84 |
time.sleep(7)
|
| 85 |
|
| 86 |
driver.execute_script("jQuery('.msg-close, .tutorial-skip, .x-close').click();")
|
|
|
|
| 92 |
nv: document.querySelector('span[class*="nerve___"]') ? document.querySelector('span[class*="nerve___"]').innerText : '0'
|
| 93 |
};
|
| 94 |
""")
|
| 95 |
+
log(f"STATUS -> Energia: {stats['en']} | Nervos: {stats['nv']}", "STATUS")
|
| 96 |
|
| 97 |
if int(stats['en']) >= 10:
|
| 98 |
+
driver.uc_open_with_reconnect("https://www.torn.com/gym.php", 4)
|
| 99 |
time.sleep(5)
|
| 100 |
driver.execute_script("document.querySelector('button[aria-label*=\"Strength\"]').click();")
|
| 101 |
log("Treino de Força executado.", "SUCESSO")
|
| 102 |
|
| 103 |
except:
|
| 104 |
+
log("Sincronizando interface...", "SISTEMA")
|
| 105 |
|
| 106 |
def iniciar():
|
| 107 |
display = Display(visible=0, size=(1920, 1080)); display.start()
|
|
|
|
| 115 |
time.sleep(300)
|
| 116 |
if "login" in driver.current_url: break
|
| 117 |
else:
|
| 118 |
+
log("Cloudflare resistiu. Tentando nova rota em 20s...", "WAIT")
|
| 119 |
time.sleep(20)
|
| 120 |
+
except Exception as e: log(f"Erro fatal: {e}", "ALERTA")
|
|
|
|
| 121 |
finally: driver.quit(); display.stop()
|
| 122 |
|
| 123 |
if __name__ == "__main__":
|