(self, code, phone)
| 13684 | return "error", "Invio OTP non riuscito. Verifica API ID, API HASH e telefono." |
| 13685 | |
| 13686 | async def tg_verify_code(self, code, phone): |
| 13687 | global temp_tg_client, temp_phone_hash |
| 13688 | try: |
| 13689 | code = str(code or "").strip() |
| 13690 | phone = str(phone or "").strip() |
| 13691 | if not code: |
| 13692 | return "error", "Inserisci il codice OTP ricevuto." |
| 13693 | if temp_tg_client is None or temp_phone_hash is None: |
| 13694 | return "error", "Richiedi prima il codice OTP." |
| 13695 | if not phone: |
| 13696 | return "error", "Numero di telefono mancante. Richiedi di nuovo l'OTP." |
| 13697 | await temp_tg_client.sign_in(phone, code, phone_code_hash=temp_phone_hash.phone_code_hash) |
| 13698 | _store_tg_session(temp_tg_client.session.save()); self.creds.pop("tg_session", None); self.save_creds(self.creds); await temp_tg_client.disconnect(); temp_tg_client = None; return "ok", "Successo" |
| 13699 | except Exception as e: |
| 13700 | print(f"[!] Telegram OTP verify failed: {type(e).__name__}") |
| 13701 | return "error", "Verifica OTP non riuscita. Controlla il codice e riprova." |
| 13702 | |
| 13703 | # --- RICERCA TELEGRAM GLOBALE CON API --- |
| 13704 | async def _parse_tg_entity(self, client, entity, base_icon, query, exact=False): |
no test coverage detected