ImM0B / WuolahMiner

Script hecho en Python para minar wuolahCoins invitando amigos con correos desechables
1 stars 0 forks source link

Tengo este error, ayuda xfa #1

Closed luccas46 closed 7 months ago

luccas46 commented 7 months ago

Tengo este error:

[٭] WuolahCoins minadas esta sesión : 0

Traceback (most recent call last): File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connection.py", line 198, in _new_conn sock = connection.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\util\connection.py", line 85, in create_connection raise err File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\util\connection.py", line 73, in create_connection sock.connect(sa) TimeoutError: timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connectionpool.py", line 793, in urlopen response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connectionpool.py", line 491, in _make_request raise new_e File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connectionpool.py", line 467, in _make_request self._validate_conn(conn) File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connectionpool.py", line 1099, in _validate_conn conn.connect() File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connection.py", line 616, in connect self.sock = sock = self._new_conn() ^^^^^^^^^^^^^^^^ File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connection.py", line 207, in _new_conn raise ConnectTimeoutError( urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x0000020A986086D0>, 'Connection to api.mail.tm timed out. (connect timeout=5)')

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\requests\adapters.py", line 486, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connectionpool.py", line 847, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\util\retry.py", line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.mail.tm', port=443): Max retries exceeded with url: /accounts (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000020A986086D0>, 'Connection to api.mail.tm timed out. (connect timeout=5)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\Users\WASSS\Downloads\WuolahMiner-main\WuolahMiner-main\wuolahMiner.py", line 49, in result = session.post(f"{mail_url}/accounts", json=payload, headers=header ,timeout=5) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\requests\sessions.py", line 637, in post return self.request("POST", url, data=data, json=json, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\requests\sessions.py", line 589, in request resp = self.send(prep, send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\requests\sessions.py", line 703, in send r = adapter.send(request, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\requests\adapters.py", line 507, in send raise ConnectTimeout(e, request=request) requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='api.mail.tm', port=443): Max retries exceeded with url: /accounts (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000020A986086D0>, 'Connection to api.mail.tm timed out. (connect timeout=5)'))

Que debo hacer?

luccas46 commented 7 months ago

además, a veces tengo el "fallo al crear el Mail" "Saliendo"

ImM0B commented 7 months ago

Acabo de probar el script y sigue funcionando. Todavía no he sacado el README de este script pero cuando lo haga se entenderá mejor como usarlo, has de asegurarte de tener el driver de selenium y de indicar la ruta en la variable "driver_path" además el dominio de mail.tm usado para crear los correos desechables lo van cambiando, para ver cual es el actual tienes que irte a https://mail.tm/es/ y crear cuenta, verás que el dominio que está empleando mail.tm para crear los nuevos correos desechables actualmente es "yogirt.com" por lo que en la variable "mail_domain" tendrás que indicar "yogirt" Cuando saque el README quedará todo mucho más claro.

luccas46 commented 7 months ago

bien, ahora me ocurre este error: [٭] WuolahCoins minadas esta sesión : 0

[1] Mail Desechable Creado [2] Token Extraído Traceback (most recent call last): File "c:\Users\WASSS\Downloads\WuolahMiner-main\WuolahMiner-main\wuolahMiner.py", line 65, in options.headless = False ; service = Service(driver_path) ; driver = webdriver.Firefox(service=service,options=options) ; driver.get(invite_link) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\selenium\webdriver\firefox\webdriver.py", line 59, in init self.service.path = DriverFinder.get_path(self.service, options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\WASSS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\selenium\webdriver\common\driver_finder.py", line 44, in get_path raise NoSuchDriverException(f"Unable to locate or obtain driver for {options.capabilities['browserName']}") selenium.common.exceptions.NoSuchDriverException: Message: Unable to locate or obtain driver for firefox; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location

Estoy poniendo correctamente la ruta de geckodriver. El geckodriver tiene que ser compatible con la version de firefox (tengo la ultima version de geckodriver y de firefox). Además, añadí geckodriver al PATH.

ImM0B commented 7 months ago

Pues mira , se trata de un problema de compatibilidad entre geckodriver y mozilla, aquí tienes una página en la que sale las compatibilidades entre ambos : https://firefox-source-docs.mozilla.org/testing/geckodriver/Support.html Yo uso Mozilla Firefox 115.6.0esr con la última versión de geckodriver 0.34, creo recordar que le hice downgrade a la versión de firefox para que me funcionara, quizás con chrome y su respectivo driver tengas menos problemas, eso último no lo he probado.

luccas46 commented 7 months ago

está totalmente automatizado o solo llega hasta aquí?

image

Este es el code que uso:

!/usr/bin/env python3

import requests, sys, signal, time, colorama,json, selenium,re,os from selenium.webdriver.firefox.service import Service from selenium.webdriver.firefox.options import Options from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from colorama import Fore, Style, init from bs4 import BeautifulSoup init()

def sig_handler(sig, frame): print(Fore.RED + "\n\n[!] Saliendo...\n") sys.exit(0)

signal.signal(signal.SIGINT, sig_handler)

Variables Globales

password = "wuolahwuolah1234" invite_link= "https://www.wuolah.com/join-ur724737" #AQUÍ TU LINK DE INVITACIÓN driver_path='C:\DRIVERS\geckodriver.exe' #AQUÍ EL PATH DE TU DRIVER DE SELENIUM userID="coinsfreefasw" #AQUÍ TU NOMBRE PARA CREAR LAS CUENTAS DE WUOLAH (<=13 caracteres) mail_url= "https://api.mail.tm" mail_domain="yogirt" #ESTE DOMINIO LO SUELEN CAMBIAR, en mail.tm sale el actual header={"Content-Type":"application/json"} options = Options() #Importa las opciones de selenium options.binary_location = r'C:\Program Files\Mozilla Firefox\firefox.exe'

coins = 0

while(True):

MAIN

os.system('clear')
print(Fore.GREEN + f"\n[٭] WuolahCoins minadas esta sesión : {coins} \n")
session = requests.Session()

#CREAR CUENTA MAIL
with open('mailNumber.txt','r+') as file :
    mailNumber=file.read()
    content_modified=int(mailNumber) + 1 #Castea el contenido como un entero
    file.seek(0)
    file.write(str(content_modified)) #Vuelve a castear el contenido a string, ya que file.write solo acepta cadenas
    file.truncate() #Elimina el  enter
mail= f"{userID}{mailNumber}@{mail_domain}.com"
payload= {"address" : f"{mail}" , "password" : f"{password}"}
result = session.post(f"{mail_url}/accounts", json=payload, headers=header ,timeout=5)
if result.status_code == 201:
    print(Fore.YELLOW + "[1] Mail Desechable Creado")
else:
    print(Fore.RED + "\n[!] Fallo al crear el Mail")
    sig_handler(None, None)

#EXTRAER TOKEN
result = session.post(f"{mail_url}/token",json=payload,headers=header,timeout=5)
result_dict= json.loads(result.text) #Crea un diccionario con el resultado en formato json
token= result_dict['token'] #Del diccionario selecciona el token
if result.status_code == 200:
    print(Fore.YELLOW + "[2] Token Extraído")
else:
    print(Fore.RED + "\n[!] Fallo al extraer el Token")
    sig_handler(None, None)

#CREAR CUENTA WUOLAH
options.headless = False ; service = Service(driver_path) ; driver = webdriver.Firefox(service=service,options=options) ; driver.get(invite_link)
wait = WebDriverWait(driver, 1000) ; button = wait.until(EC.presence_of_element_located((By.CLASS_NAME, "css-47sehv"))); button.click() #Cookies
wait = WebDriverWait(driver, 1000) ; button = wait.until(EC.presence_of_element_located((By.CLASS_NAME, "css-ai84mh"))) ; button.click() #Continue
wait = WebDriverWait(driver, 1000) ; button = wait.until(EC.presence_of_element_located((By.CLASS_NAME, "css-e0l6jx"))) ; button.click() #Mail
wait = WebDriverWait(driver, 1000) ; field = wait.until(EC.presence_of_element_located((By.ID, "email"))) ; field.send_keys(f"{mail}"); #Escribe Mail
wait = WebDriverWait(driver, 1000) ; field = wait.until(EC.presence_of_element_located((By.ID, "password"))) ; field.send_keys(f"{password}"); field.submit() #Escribe contraseña
#Ahora Resolver el captcha
wait = WebDriverWait(driver, 1000) ; button = wait.until(EC.presence_of_element_located((By.CLASS_NAME, "css-17t3rxq"))) ; button.click() #Spain
wait = WebDriverWait(driver, 1000) ; button = wait.until(EC.presence_of_element_located((By.CLASS_NAME, "css-160nu5g"))) ; button.click() #Aceptar
time.sleep(5);driver.quit();time.sleep(5)
print(Fore.YELLOW + "[3] Cuenta creada")

#VERIFICACIÓN
result = session.get(f"{mail_url}/messages",headers={"Content-Type":"application/json", "Authorization": f"Bearer {token}"},timeout=5)
result_dict= json.loads(result.text)
url_source = result_dict['hydra:member'][0]['downloadUrl'] #Accedemos al primer elemento de la lista hydra:member y extraemos downloadURL
result = session.get(f"{mail_url}{url_source}",headers={"Content-Type":"application/json", "Authorization": f"Bearer {token}"},timeout=5)
result = re.sub(r'=', '', result.text) ; result= re.findall(r'href3D"(.*?)"', result, re.DOTALL)
url_verification = result[2].replace("\n", "").replace("\r", "") # Elimina saltos de línea y retornos de carro 
options.headless = True ; service = Service(driver_path) ; driver = webdriver.Firefox(service=service,options=options) ; driver.get(url_verification) 
driver.quit() #Verifica Cuenta
print(Fore.YELLOW + "[4] Cuenta verificada")
time.sleep(1)
coins=coins+3

Le he implementado el binary.location de firefox y ahora al menos se abre, pero no se crea la cuenta de wuolah.

ImM0B commented 7 months ago

Pues mira, no se hasta que punto la clase de cada botón depende del navegador que se use, a mi me funciona perfectamente el script como está. SI lees el código verás que selenium va pulsando botones según la clase de estos. SI le haces clic derecho inspeccionar a cada botón verás su clase, lo puedes cambiar tú. Por ejemplo aquí apreta el botón continue :
wait = WebDriverWait(driver, 1000) ; button = wait.until(EC.presence_of_element_located((By.CLASS_NAME, "css-ai84mh"))) ; button.click() #Continue La clase del botón continue es "css-ai84mh", puedes editarlo si a ti no te funciona, de todas formas me parece raro que cambie el código dependiendo del navegador.