Backup automatico script del 2026-01-18 07:00

This commit is contained in:
2026-01-18 07:00:02 +01:00
parent 4555d6615e
commit 9dbe0cfa93
8 changed files with 339 additions and 57 deletions

View File

@@ -138,6 +138,10 @@ def telegram_send_html(message_html: str, chat_ids: Optional[List[str]] = None)
message_html: Messaggio HTML da inviare
chat_ids: Lista di chat IDs (default: TELEGRAM_CHAT_IDS)
"""
# Sanitize unsupported HTML tags (Telegram non supporta <br>)
if message_html:
message_html = re.sub(r"<\s*br\s*/?\s*>", "\n", message_html, flags=re.IGNORECASE)
token = load_bot_token()
if not token:
LOGGER.warning("Token Telegram assente. Nessun invio effettuato.")
@@ -363,8 +367,8 @@ def main(chat_ids: Optional[List[str]] = None, debug_mode: bool = False):
else:
LOGGER.warning("Invio debug non riuscito (token mancante o errore Telegram).")
else:
LOGGER.info("Nessuna allerta nelle zone monitorate. Nessuna notifica inviata.")
return
LOGGER.info("Nessuna allerta nelle zone monitorate. Nessuna notifica inviata.")
return
sig = build_signature(parsed)
state = load_state()