La alerta del 23-jul (5/12 jobs, "empty response body") no era la API
fallando: un vídeo subido (stand-up con contenido explícito) devuelve
prompt_feedback.block_reason=PROHIBITED_CONTENT en ~300ms, de forma
determinista — verificado con la transcripción real, y BLOCK_NONE en
safety_settings NO lo levanta (es el filtro de política de Google, no
configurable). Reintentábamos 3 veces algo imposible, el error parecía
un fallo nuestro, y el usuario reintegró el mismo vídeo varias veces
inflando la tasa de fallos.
- gemini_worker: GeminiBlockedError + raise_if_blocked() (block_reason
del prompt y finish_reason SAFETY/PROHIBITED_CONTENT/... del candidato).
- main: _run_gemini_stage falla rápido sin reintentos ante bloqueo (0.5s
vs ~15s) y propaga el motivo real hasta el log del job en ambas vías
(transcript y visión); ya no se convierte en el genérico "no clips".
- alerts: categoría propia "blocked content (user video)" para que la
alerta no se lea como caída del servicio.
El error del admin ('High download failure rate... rebuild image') era
engañoso: el fallo real no era descarga sino transcripción de un vídeo SUBIDO
sin pista de audio (un clip generado por IA, Gen-4 de Runway). faster-whisper
revienta dentro de libav con 'tuple index out of range' cuando el fichero no
tiene audio.
- transcribe_media detecta la ausencia de pista de audio (ffprobe) ANTES de
transcribir y lanza NoAudioError con mensaje claro; main.py lo convierte en
un fallo user-facing ('NO_AUDIO: este vídeo no tiene audio...') en vez de un
traceback. Verificado en contenedor con vídeo con/sin audio.
- La alerta de tasa de fallos ya no culpa siempre a la descarga: clasifica el
último error (proxy / youtube download / no audio / transcription / gemini /
ffmpeg) y lo pone en el título.
123 tests (nuevos: vídeo mudo + clasificación de fallos).
El chat de Telegram es compartido con Upload-Post y otros productos, así que
cada mensaje de OpenShorts se marca con el nombre para distinguirlos de un
vistazo. Aplicado en send_telegram, cubre todas las alertas (pagos, subs,
churn, clips).
- alerts.py: _looks_like_proxy_error only matches genuine proxy/download-stage
signatures (407, ProxyError, tunnel failed, 402/out-of-credits) instead of a
bare "proxy"/"credit"/"balance" substring — a job that failed in processing (or
a video titled with one of those words) no longer fires a false "out of credits"
alert. Real proxy failures still alert.
- app.py: _scrub_secrets() masks user:pass in any URL before a subprocess line is
printed or stored, so the residential proxy URL yt-dlp echoes in verbose debug
never lands in the server console or job log.
- app.py: _visible_logs() — cloud (BILLING on) surfaces only the pipeline's own
friendly progress lines (emoji-prefixed + worker start/finish) and hides the raw
yt-dlp/ffmpeg/debug spew from paying users; self-host still shows everything.
- config: TELEGRAM_BOT_TOKEN / TELEGRAM_CHAT_ID + telegram_configured
- alerts: send_telegram(); send_admin_alert now pushes to Telegram + email
(so existing proxy-out-of-credits and high-failure alerts hit Telegram too)
- billing webhook: alert on new subscription, trial→paid conversion, and top-up
- .env.cloud.example documents the Telegram vars
Verified end-to-end: alert delivered to the admin group via the same
send_admin_alert path the webhook uses. Token stays in gitignored .env.
- main.py / metering.py: try the HD (bgutil/720p) strategy first, fall back to
the conservative (360p) clients on any failure, so a YouTube/yt-dlp change
degrades gracefully instead of failing the whole job.
- cloud/alerts.py: in-memory tracking of managed-job outcomes; emails the admin
(ADMIN_EMAIL) when a proxy/credit error appears or when many jobs fail in a
row, with a 1h per-alert cooldown. Wired into run_job_wrapper.
- Email switched from Resend to SMTP (cloud/emails.py) for magic link + alerts
(Namecheap Private Email). Config via SMTP_* / EMAIL_FROM / ADMIN_EMAIL in the
mounted .env (kept out of compose so the password's $/* aren't mangled).
SMTP send verified from host and from the backend container.