Files
AccountForger-neuerUpload/social_networks/facebook/IMPROVEMENT_SUGGESTIONS.md

103 Zeilen
3.1 KiB
Markdown

# Facebook-Modul Verbesserungsvorschläge
## 1. Facebook Login noch nicht implementiert
**Problem:** `facebook_login.py` enthält nur einen Platzhalter
```python
def login_account(self, email_or_phone: str, password: str, **kwargs) -> Dict[str, Any]:
logger.warning("Facebook-Login noch nicht vollständig implementiert")
return {"success": False, "error": "Login-Funktion noch nicht implementiert"}
```
**Lösung:** Vollständige Login-Implementation analog zu Registration
## 2. Fehlende Browser-Verfügbarkeitsprüfung
**Problem:** In `facebook_ui_helper.py` wird `_ensure_browser()` verwendet, aber nicht konsistent in allen Methoden
**Empfehlung:** Decorator-Pattern für Browser-Checks implementieren:
```python
def requires_browser(func):
def wrapper(self, *args, **kwargs):
if not self._ensure_browser():
return False
return func(self, *args, **kwargs)
return wrapper
```
## 3. Hardcodierte Timeouts
**Problem:** Viele hardcodierte Timeout-Werte (1000ms, 2000ms, etc.)
**Empfehlung:** Zentrale Timeout-Konfiguration:
```python
class FacebookTimeouts:
SHORT = 1000
MEDIUM = 3000
LONG = 5000
VERIFICATION = 120000
```
## 4. Unvollständige SMS-Verifikation
**Problem:** `handle_sms_verification()` in `facebook_verification.py` ist nicht implementiert
**Empfehlung:** SMS-Service Integration planen oder als "nicht unterstützt" markieren
## 5. Fehlende Unit-Tests
**Problem:** Keine Test-Dateien für das Facebook-Modul gefunden
**Empfehlung:** Test-Suite erstellen mit pytest:
- test_facebook_selectors.py
- test_facebook_registration.py
- test_facebook_utils.py
## 6. Redundanter Code in Selektoren
**Problem:** Viele alternative Selektoren könnten in Listen organisiert werden
**Empfehlung:**
```python
class FacebookSelectors:
FIRSTNAME_SELECTORS = [
"input[name='firstname']",
"input[aria-label='Vorname']",
"input[placeholder*='Vorname']"
]
```
## 7. Fehlende Retry-Logik
**Problem:** Workflow definiert `retry` Werte, aber keine Implementation dafür
**Empfehlung:** Retry-Decorator implementieren:
```python
@retry(max_attempts=3, delay=1.0)
def _open_registration_form(self):
# ...
```
## 8. Unvollständige Captcha-Behandlung
**Problem:** `handle_captcha()` erkennt nur Captchas, löst sie aber nicht
**Empfehlung:**
- 2Captcha/Anti-Captcha Service Integration
- Oder manuellen Modus mit Benachrichtigung implementieren
## 9. Fehlende Konfigurationsdatei
**Problem:** Keine zentrale Konfiguration für Facebook-spezifische Settings
**Empfehlung:** `facebook_config.py` erstellen:
```python
class FacebookConfig:
BASE_URL = "https://www.facebook.com"
SUPPORTED_LANGUAGES = ["de", "en"]
MIN_PASSWORD_LENGTH = 6
VERIFICATION_CODE_LENGTH = 5
```
## 10. Unvollständige Internationalisierung
**Problem:** Texte sind teilweise hardcodiert auf Deutsch
**Empfehlung:** i18n-Support verbessern mit Language-Dictionary
## Priorität der Verbesserungen:
1. **Hoch:** Facebook Login implementieren
2. **Hoch:** Retry-Logik implementieren
3. **Mittel:** Timeout-Konfiguration zentralisieren
4. **Mittel:** Unit-Tests hinzufügen
5. **Niedrig:** Code-Redundanz reduzieren