|
|
import time
|
|
|
from utils.utils import generar_contrasena, generar_nombre_completo, enviar_formulario, obtener_sitio_web_aleatorio
|
|
|
from utils.auth import send_auth_code, login_to_vidu
|
|
|
from utils.email_utils import get_verification_code, delete_temp_mail
|
|
|
|
|
|
|
|
|
password_segura = generar_contrasena()
|
|
|
url = 'https://email-fake.com/'
|
|
|
|
|
|
|
|
|
datos = {'campo_correo': 'ejemplo@dominio.com'}
|
|
|
|
|
|
|
|
|
response = enviar_formulario(url, datos)
|
|
|
|
|
|
|
|
|
sitio_domain = obtener_sitio_web_aleatorio(response.text)
|
|
|
|
|
|
|
|
|
nombre_completo = generar_nombre_completo()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
time.sleep(3)
|
|
|
|
|
|
email_reg = f"{nombre_completo}@{sitio_domain}"
|
|
|
|
|
|
send_auth_code(email_reg)
|
|
|
print("60 seconds")
|
|
|
time.sleep(1)
|
|
|
|
|
|
|
|
|
verification_code = None
|
|
|
identifier = None
|
|
|
attempts = 6
|
|
|
for attempt in range(attempts):
|
|
|
print(f"Attempt {attempt + 1} from {attempts}...")
|
|
|
|
|
|
|
|
|
verification_code, identifier = get_verification_code(nombre_completo, sitio_domain)
|
|
|
|
|
|
if verification_code and identifier:
|
|
|
print(f"C贸digo de verificaci贸n encontrado: {verification_code}")
|
|
|
break
|
|
|
|
|
|
time.sleep(10)
|
|
|
|
|
|
if verification_code and identifier:
|
|
|
print(f"C贸digo de verificaci贸n: {verification_code}")
|
|
|
print(f"Identificador: {identifier}")
|
|
|
time.sleep(3)
|
|
|
print("Login...")
|
|
|
|
|
|
|
|
|
response, jwt_token = login_to_vidu(email_reg, verification_code)
|
|
|
|
|
|
if jwt_token:
|
|
|
print("Login exitoso. Token obtenido.")
|
|
|
|
|
|
with open('/tmp/jwt_token.txt', 'w') as f:
|
|
|
f.write(jwt_token)
|
|
|
else:
|
|
|
print("No se pudieron encontrar los datos necesarios.")
|
|
|
|
|
|
time.sleep(3)
|
|
|
|
|
|
|
|
|
delete_temp_mail(nombre_completo, sitio_domain, identifier)
|
|
|
|