Rollbackpunkt, alles außer TikTok geht, die wollen wieder so eine extra locke bei Login
Dieser Commit ist enthalten in:
@ -133,7 +133,7 @@ class BaseAccountCreationWorkerThread(QThread):
|
||||
register_params.update(self.params["additional_params"])
|
||||
|
||||
result = automation.register_account(**register_params)
|
||||
|
||||
|
||||
if result["success"]:
|
||||
# Stelle sicher, dass die Datenstruktur kompatibel ist
|
||||
if "account_data" not in result:
|
||||
@ -144,19 +144,48 @@ class BaseAccountCreationWorkerThread(QThread):
|
||||
"email": result.get("email", ""),
|
||||
"phone": result.get("phone", "")
|
||||
}
|
||||
|
||||
|
||||
# KRITISCHE VALIDIERUNG: Prüfe PFLICHTFELDER vor Weitergabe
|
||||
account_data = result.get("account_data", {})
|
||||
validation_errors = []
|
||||
|
||||
# Prüfe Username
|
||||
if not account_data.get("username") or account_data["username"] == "":
|
||||
validation_errors.append("Username fehlt oder ist leer")
|
||||
|
||||
# Prüfe Password
|
||||
if not account_data.get("password") or account_data["password"] == "":
|
||||
validation_errors.append("Passwort fehlt oder ist leer")
|
||||
|
||||
# Prüfe Email oder Phone (mindestens eins muss vorhanden sein)
|
||||
if not account_data.get("email") and not account_data.get("phone"):
|
||||
validation_errors.append("Weder E-Mail noch Telefon vorhanden")
|
||||
|
||||
# Wenn Validierungsfehler existieren, markiere als Fehler
|
||||
if validation_errors:
|
||||
error_msg = f"Account-Daten unvollständig: {', '.join(validation_errors)}"
|
||||
self.log_signal.emit(f"VALIDIERUNGSFEHLER: {error_msg}")
|
||||
self.log_signal.emit(f"Account-Daten: {account_data}")
|
||||
self.error_signal.emit(error_msg)
|
||||
self.progress_signal.emit(0)
|
||||
return # Breche ab - sende KEIN finished_signal
|
||||
|
||||
fingerprint_data = self.params.get("fingerprint")
|
||||
# Handle BrowserFingerprint object vs dict
|
||||
if fingerprint_data and hasattr(fingerprint_data, 'to_dict'):
|
||||
result["fingerprint"] = fingerprint_data.to_dict()
|
||||
else:
|
||||
result["fingerprint"] = fingerprint_data
|
||||
|
||||
self.log_signal.emit("Account erfolgreich erstellt!")
|
||||
self.finished_signal.emit(result)
|
||||
self.progress_signal.emit(100)
|
||||
|
||||
# Session-Speicherung wenn verfügbar
|
||||
self._save_session_if_available(result)
|
||||
|
||||
# Session-Speicherung vor Benachrichtigung durchführen
|
||||
save_result = self._save_session_if_available(result)
|
||||
if save_result is not None:
|
||||
result["save_result"] = save_result
|
||||
|
||||
self.finished_signal.emit(result)
|
||||
else:
|
||||
error_msg = result.get("error", "Unbekannter Fehler")
|
||||
interpreted_error = self._interpret_error(error_msg)
|
||||
@ -184,12 +213,13 @@ class BaseAccountCreationWorkerThread(QThread):
|
||||
return f"Fehler bei der Registrierung: {error_message}"
|
||||
|
||||
|
||||
def _save_session_if_available(self, result: Dict[str, Any]):
|
||||
"""Speichert Session wenn Controller verfügbar"""
|
||||
def _save_session_if_available(self, result: Dict[str, Any]) -> Optional[Dict[str, Any]]:
|
||||
"""Speichert Session wenn Controller verfügbar und gibt das Ergebnis zurück"""
|
||||
save_result: Optional[Dict[str, Any]] = None
|
||||
|
||||
# Session über SessionController speichern wenn verfügbar
|
||||
if hasattr(self, 'session_controller') and self.session_controller:
|
||||
try:
|
||||
# Verwende den SessionController direkt für Clean Architecture
|
||||
if hasattr(self.session_controller, 'create_and_save_account'):
|
||||
# Account-Daten aus dem korrekten Pfad extrahieren
|
||||
if "account_data" in result:
|
||||
@ -201,25 +231,30 @@ class BaseAccountCreationWorkerThread(QThread):
|
||||
'email': result.get("email"),
|
||||
'phone': result.get("phone")
|
||||
}
|
||||
|
||||
|
||||
save_result = self.session_controller.create_and_save_account(
|
||||
platform=self.platform_name,
|
||||
account_data=account_data
|
||||
)
|
||||
|
||||
|
||||
if save_result.get('success'):
|
||||
self.log_signal.emit(f"Session erfolgreich gespeichert")
|
||||
self.log_signal.emit("Session erfolgreich gespeichert")
|
||||
else:
|
||||
self.log_signal.emit(f"Warnung: Session konnte nicht gespeichert werden")
|
||||
|
||||
self.log_signal.emit("Warnung: Session konnte nicht gespeichert werden")
|
||||
|
||||
except Exception as e:
|
||||
self.log_signal.emit(f"Warnung: Session konnte nicht gespeichert werden: {e}")
|
||||
|
||||
error_msg = f"Warnung: Session konnte nicht gespeichert werden: {e}"
|
||||
self.log_signal.emit(error_msg)
|
||||
save_result = {
|
||||
'success': False,
|
||||
'error': str(e),
|
||||
'message': error_msg
|
||||
}
|
||||
|
||||
# Alternativ: Signal an Generator Tab senden
|
||||
elif hasattr(self, 'generator_tab') and self.generator_tab:
|
||||
try:
|
||||
if hasattr(self.generator_tab, 'account_created'):
|
||||
# Account-Daten aus dem korrekten Pfad extrahieren
|
||||
if "account_data" in result:
|
||||
account_data = result["account_data"]
|
||||
else:
|
||||
@ -232,8 +267,10 @@ class BaseAccountCreationWorkerThread(QThread):
|
||||
self.generator_tab.account_created.emit(self.platform_name, account_data)
|
||||
except Exception as e:
|
||||
self.log_signal.emit(f"Warnung: Konnte Account-Daten nicht an UI senden: {e}")
|
||||
|
||||
return save_result
|
||||
|
||||
def stop(self):
|
||||
"""Stoppt den Thread"""
|
||||
self.running = False
|
||||
self.terminate()
|
||||
self.terminate()
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren