(self)
| 13598 | } |
| 13599 | |
| 13600 | def ghunt_login_status(self): |
| 13601 | try: |
| 13602 | creds_path = Path.home() / ".malfrats" / "ghunt" / "creds.m" |
| 13603 | if not creds_path.exists(): |
| 13604 | return {"status": "not_authenticated", "message": "Sessione GHunt non trovata. Esegui GHunt login."} |
| 13605 | |
| 13606 | raw = creds_path.read_text(encoding="utf-8", errors="ignore") |
| 13607 | data = json.loads(base64.b64decode(raw).decode("utf-8", errors="ignore")) |
| 13608 | cookies = data.get("cookies", {}) if isinstance(data, dict) else {} |
| 13609 | osids = data.get("osids", {}) if isinstance(data, dict) else {} |
| 13610 | android = data.get("android", {}) if isinstance(data, dict) else {} |
| 13611 | master_token = android.get("master_token", "") if isinstance(android, dict) else "" |
| 13612 | |
| 13613 | if cookies and osids and master_token: |
| 13614 | return {"status": "authenticated", "message": "Autenticato. Puoi avviare la ricerca Gmail/GAIA."} |
| 13615 | return {"status": "partial", "message": "Sessione GHunt incompleta. Ripeti il login GHunt."} |
| 13616 | except Exception: |
| 13617 | return {"status": "error", "message": "Impossibile leggere la sessione GHunt. Ripeti il login."} |
| 13618 | |
| 13619 | def ghunt_login_method2(self, cookie_code): |
| 13620 | code = (cookie_code or "").strip() |
no outgoing calls
no test coverage detected