Four new layouts, all off by default, plus a picker that decides which one a
video gets.
- SPLIT (split_layout.py): two speakers stacked. The test is COEXISTENCE in the
same frame, not presence measured separately: BlazeFace loses faces in
profile, which is how someone sits while listening, so a presence test
rejects conversations for looking like conversations. Coexistence also
separates a two-shot from a shot/reverse-shot, where stacking would show the
same person twice.
- SCREENCAST / WIDE (screencast_layout.py): content over the presenter, or full
width when the content fills the frame and the presenter is composited on top
of it (stacking there shows the same thing twice).
- ALTERNATE (active_speaker.py): hard cuts to whoever is talking. Mouth activity
must be normalised per speaker against their own resting state; raw magnitude
scales with contrast and lighting and handed one person 90-100% of the scene.
- Punch-in (punch_in.py): a 12% push on the beats, riding the TRACK path by
widening its per-frame crop command from x-only to w/h/x/y.
layout_picker.py chooses between none/screencast/split with one Gemini call per
source video. Measured over the 48-clip corpus against hand-checked labels:
94/92/96% across three runs, 0-1 false positives out of 28, and 2 clips of 48
changing answer between runs. The key is asking for a DECISION between closed
options rather than a measurement: the four previous attempts (Canny, MSER,
coverage, width) all asked for a number and none separated a spreadsheet from a
corner scoreboard.
app.py exposes all of it per job through `layouts` on /api/process. Without that
field the pipeline behaves exactly as before.
83 new tests, 315 green.
Auto-captions have been silently failing in prod on any video whose title
contains an apostrophe — constant in English ("Earth's", "Don't"). The clip
that surfaced it: "Inside Earth's Most Mysterious Temple". Four failures in a
two-hour window, each swallowed by the guard that ships the clip uncaptioned,
so nothing alerted.
The .ass path is interpolated INTO a filter string (-vf ass='...'), where a
literal apostrophe closes the quote and truncates the filter. /api/subtitle has
always been safe because it names its file subs_<i>_<ts>.ass; shipping captions
by default introduced a name built from the clip stem, which carries the title.
So the .ass name drops the stem. It also gains a uuid: clips render in parallel
under CLIP_WORKERS, and a bare timestamp would let two clips in the same second
write the same file and burn each other's captions. The OUTPUT name keeps the
stem, and must — the modal's walk-back and _canonical_clip_file reconstruct the
clean original from it — but that one is only ever an argv element, never
inside a filter.
Smarter escaping was tried first and is worse, so the reasoning is recorded in
_escape_ffmpeg_filter_value rather than left for someone to rediscover: the
shell idiom "'\''" is not understood by ffmpeg's filtergraph parser, which
dropped the apostrophe AND swallowed the following option, resolving
ass='…Earth'\''s.ass':fontsdir='…' to a filename of "…Earths.ass:fontsdir=…".
An apostrophe in a filter path cannot be escaped; it has to be absent.
Verified in the prod image against the failing filename: the burn now produces
a 540x960 clip where it previously errored.
The rule was meant to route a screencast that happens to contain one face to
GENERAL, so its headlines don't get cropped mid-word. Testing it against the
case it exists for showed it does the opposite of what it claims.
Measured on a constructed talking-head-beside-a-chart, and the same shot without
the panels:
with text panels density 0.012 -> TRACK (rule missed it)
same shot, no panels density 0.029 -> TRACK (scored HIGHER)
Canny counts edges, and a flat panel of text has far fewer of them than ordinary
scene detail like foliage or clothing — so the signal measures visual busyness,
not text. The threshold was wrong too: across 151 frames of real footage the
density ran median 0.007 / p90 0.018 / max 0.068, so 0.085 could never fire.
The underlying problem is real and still open. A fix needs an actual text
detector (MSER or EAST) validated against clips that contain the failure mode —
the current corpus is highlights and vlogs and has almost none, which is why the
broad run only reclassified 2 of 438 scenes and told us nothing.
Keeping a heuristic that has been shown not to work would only add risk, so it
comes out and the finding stays as a comment where the next attempt will read it.
Captions must always be the LAST layer. Editing or hooking a clip that already
had them burned in produced `edited_subtitled_<...>`, and the next subtitle pass
stacked a second caption layer on top of the first — visibly doubled and
unreadable in a real user clip found in prod today. /api/edit and /api/hook now
derive from the clean file and put captions back afterwards, so a restyle always
has an un-captioned base to burn onto. The latent bug predates auto-captions but
shipping them by default made it the normal path. The walk-back is now one
helper instead of being open-coded in the subtitle endpoint.
Loudness was uncontrolled. A clip inherited whatever its source was mastered at,
measured across real delivered clips from -13.8 LUFS on a loud upload down to
-28 on a quiet talk, while TikTok/Reels/Shorts all normalise playback to around
-14 — so the quiet ones just sound thin in the feed. loudnorm at the clip cut,
where the audio is already being encoded, so it costs nothing. Verified to pull
both extremes to target: -29.7 -> -13.7 and -10.1 -> -13.5. AUDIO_NORMALIZE=0.
The GENERAL layout wasted the frame. Fitting a 16:9 source to full width left
it 608px tall in a 1920 frame: 32% content, 68% blurred filler. Now scaled by
height to 42%, trimming the overflow. Deliberately conservative — GENERAL is
chosen for groups and landscapes, exactly where cropping the sides cuts someone
out, so 0.55 was tried and rejected for throwing away 42% of the width. 0.42
keeps ~76%. GENERAL_CONTENT_HEIGHT_RATIO=0.32 restores the old behaviour.
The TRACK/GENERAL classifier only counted faces, so a screencast that happened
to contain one face was cropped to it — real prod clips came out with headlines
cut mid-word and unreadable. A cheap Canny pass over the side thirds (the part a
9:16 crop discards), with face boxes blanked first, now routes text-dense scenes
to GENERAL instead. GRAPHIC_DENSITY_THRESHOLD=1.0 disables it.
The camera swung between subjects because a single detection could teleport the
target anywhere and the frame followed immediately. On real user footage pulled
from prod, 22% of target updates moved further than the entire safe zone.
A move that large is far more often a detector error — a second face, a false
positive, a box snapping to a different body part — than a person who actually
moved that far. It now has to repeat JUMP_CONFIRM_FRAMES (3) consecutive
detections before the camera commits; a wrong reading disappears on the next
detection and never moves the frame. Contradictory outliers cannot confirm each
other, so a detector flapping between two wrong places holds the frame still.
Measured over 262s of TRACK footage across 12 chunks of two real user videos,
counting only reversals INSIDE a scene (a cut is supposed to re-frame, so
scoring scene-change snaps would measure the feature, not the bug):
confirm=1 0.41 rev/s 91 px/s —
confirm=2 0.20 rev/s 76 px/s -51%
confirm=3 0.13 rev/s 60 px/s -69%
confirm=4 0.10 rev/s 48 px/s -76%
3 is the knee: 4 buys another 7 points of reversals for a third more latency.
Honest about the downside — per scene, travel gets calmer in 54 of 84 and is
unchanged in 23, but 7 get BUSIER (worst 59 -> 108px/s, and one dead-still scene
starts drifting at 31px/s), because committing later can leave the camera
further to travel. Net strongly positive, not universally so.
Tried and rejected: a 3s switch cooldown, which bought only -19% on its own and
is precisely what would make a two-person interview stop following the
conversation. JUMP_CONFIRM_FRAMES=1 restores the old behaviour without a deploy.
Methodology note: variants are compared by recording the detections once and
replaying them through the cameraman, so every variant sees identical input
rather than a fresh run of a non-deterministic detector.
/api/hook has been returning 500 in prod on any clip whose video title is
non-Latin: OSError 36, "File name too long". sanitize_filename() capped the
title at 100 CHARACTERS, but filesystems cap a name at 255 BYTES, and one
Bengali or Arabic character costs three — so a title was already ~300 bytes
before the pipeline decorated it.
Every derived name stacks on that stem: "_clip_10.mp4", "subtitled_<ts>_",
"temp_hook_<hex8>_", "autosubs_<ts>_.ass". Shipping captions by default added
one more layer, which is what pushed the borderline cases over and surfaced it.
- sanitize_filename now trims to MAX_TITLE_BYTES (120) via truncate_bytes(),
which never splits a multi-byte character. 120 leaves room for every
decoration stacked and still lands well under 255.
- The hook overlay stopped embedding the full source name: its uuid already
guarantees uniqueness, so the name rides along only as a debugging hint and
is trimmed to 80 bytes.
Deliberately NOT trimmed: the auto-caption output, which must stay exactly
"subtitled_<ts>_<clip filename>" because the subtitle modal's walk-back and
_canonical_clip_file both reconstruct the clean original from it. Length is
bounded upstream instead; a legacy clip that predates the budget raises
OSError 36, which the existing guard turns into "ship it uncaptioned".
The cooldown that keeps the camera from swinging between subjects only applied
when the active speaker happened to be detected in the current frame. If they
were missing — a blink, a head turn, one motion-blurred frame — the guard fell
through and switched immediately, so it only ever held when it wasn't needed.
Measured on a 12s clip: 3 of 7 target switches jumped the cooldown this way.
Now the cooldown holds regardless: it returns the active speaker's box when
visible and None otherwise, and the caller only calls update_target() on a
truthy box, so the camera keeps its target and finishes whatever move it was
making. The hold stays bounded by the cooldown, so a subject who really did
leave the shot is still released once the window expires.
Measured on the same clip: cooldown bypasses 3 -> 0, target switches 7 -> 5.
This does NOT by itself calm the camera down — reversals stayed at 13 over 12s.
The dominant driver is target jitter (p90 of 496px per update, 15 of 67 updates
alone exceeding the 101px safe zone) plus faces losing their identity on
re-detection, both of which need tuning against representative footage rather
than a screen recording.
Captions are what make a short readable with the sound off, and 91% of
delivered clips had none (35 subtitle jobs against 380 process jobs in the
25-jul-2026 prod audit) because they were opt-in behind a modal. Now every clip
comes out captioned and the modal becomes a re-style, not a discovery.
The look was picked by rendering four candidates on a real clip and comparing
them: white Anton uppercase, yellow active word, heavy black outline, gentle
pop. Yellow because it is the one colour that almost never occurs in footage,
so the active word reads instantly on any background. The base text stays fully
opaque — dimming it, which several caption tools do, tested worse over bright
scenes. Captured in AUTO_CAPTION_STYLE so there is one place to change it.
Two fixes fell out of rendering it for real:
- Captions sat at MarginV=25 (8.7% of frame height), underneath TikTok's and
Reels' own bottom chrome. Raised to a documented SAFE_MARGIN_V of ~15%, now
a parameter rather than a hardcoded literal.
- The pop effect scaled the active word 75->112, wide enough that any frame
caught mid-animation read as a sizing bug. Softened to 90->108.
Wiring follows the convention already used by /api/subtitle: the captioned file
is written as subtitled_<ts>_<clip>.mp4 next to the untouched original, so
re-styling from the modal replaces the captions instead of burning a second
layer over them (its existing walk-back resolves this unchanged). The places
that rebuild the canonical clip name from disk — restore after a restart, the
project reopen, the download bundle — now resolve through _canonical_clip_file
so a redeploy cannot silently serve the uncaptioned version. R2 uploads follow
video_url, so the durable library gets the captioned clip too.
Captions are applied after the watermark, never before, and any failure is
swallowed: a caption problem must not cost the user a clip they already paid
for. Silent videos have no transcript and are skipped. AUTO_CAPTIONS=0 is the
rollback lever.
Verified end to end in the container: burn produces the derived file, the app
resolves to it, the modal walks back to the clean original, silent input ships
uncaptioned, the kill switch works, and the newest styling wins.
An audit of 45 real user clips pulled from R2 on 25-jul-2026 found 86% below
1080 wide, 80% of them exactly 406x720 — well under what TikTok, Reels and
Shorts expect, so the platforms re-encode an already soft image. Two causes,
one on top of the other:
- The download capped format selection at 720p whenever PROXY_URL was set. The
cap exists to control paid-proxy bandwidth, but it was decided once from
`_proxy` rather than per attempt, so it also capped the DIRECT attempt — the
one that costs nothing and, with DIRECT_FIRST=1, serves most downloads. It is
now chosen per attempt: direct pulls up to 1080p, proxied stays at 720p.
- The reframe set out_h = orig_h, so a 720p source could only ever produce a
406x720 crop. `delivery_size()` now upscales to a 1080-wide floor and leaves
anything already above it untouched — a 4K source still delivers 1216x2160,
so no one loses resolution they supplied.
Applied to the v1 fallback too: an emergency render is still the clip the user
posts. Its frame loop already resizes to the target dims, so only the target
changed.
Crop geometry is unaffected — SmoothedCameraman derives the crop from the source
dimensions and never reads the output pair, which the call site now documents.
Verified end to end: a 1280x720 source that previously rendered 406x720 now
renders 1080x1920, correct aspect, no distortion.
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 concat de reframe_v2 (el camino real de prod) y el merge de
process_video_to_vertical escribían el moov atom al final del MP4. Sin
faststart el <video> del navegador no puede empezar a reproducir hasta
descargar el fichero entero → el preview se queda con el spinner eterno.
Descargar el clip funcionaba (por eso pasó desapercibido), pero
previsualizarlo en la app no.
Verificado con ffprobe: antes moov al 98%, ahora al frente. Bug
preexistente, no introducido por el scrub de metadata.
Los clips arrastraban el handler de stream "ISO Media file produced by
Google Inc." del vídeo original de YouTube: ffmpeg copia la metadata del
input por defecto, así que sobrevivía a todos los reencodes y acababa
publicado en la red social. Rastro innecesario del origen.
Se añade METADATA_SCRUB en ffmpeg_utils y se aplica en cada productor de
fichero final: el concat de reframe_v2 (el camino real de prod), el merge
de process_video_to_vertical, el passthrough horizontal, el watermark, y
los reencodes de subtítulos/hooks/editor.
Detalle que costó verificar: -map_metadata -1 global NO basta — el
handler_name a nivel de stream sobrevive a un -c copy. Hacen falta los
especificadores por stream (-map_metadata:s:v -1 -map_metadata:s:a -1);
son inofensivos cuando falta un stream. Verificado con ffprobe sobre un
clip real del pipeline completo: sin rastro de Google.
No promete boost de alcance (eso lo decide el fingerprint de contenido,
no los tags del fichero); es higiene y quitar el rastro del origen.
Tres jobs de prod murieron el 22-jul porque Gemini contestó 200 con el
cuerpo vacío. Eso revienta al parsear, no al llamar, así que se escapaba
del bucle de reintentos: un parpadeo de la API bastaba para perder el job.
El mismo payload funciona 5 de 5 al reintentarlo.
- gemini: el parseo pasa a estar dentro del bucle, y la respuesta vacía o
no parseable cuenta como error transitorio.
- descarga: reintento del 403 de YouTube, que casi siempre viene de que el
proxy residencial rota la IP de salida entre la extracción y la descarga
(3 de 62 descargas en 24h).
- se elimina el fallback de reframear el vídeo entero: no escribía
metadata.json, así que app.py marcaba el job como fallido igualmente
después de gastar GPU en un render que nadie llegaba a ver.
- alertas: la clasificación lee ahora las líneas de error del log en vez
de las 10 últimas, que eran ruido de progreso y hacían culpar al
subsistema equivocado (un parpadeo de Gemini se reportó como ffmpeg).
Validado en prod 21-jul: con cookies + PO token bgutil la IP del servidor
descarga directa de YouTube (~110 MiB/s); sin cookies YouTube la bloquea
tras la primera petición. El proxy residencial queda como fallback y
PROXY_BYTES solo se emite cuando el intento ganador usó el proxy.
Antes, un vídeo sin pista de audio (clip de IA tipo Runway/Sora, gameplay o
grabación de pantalla muda) fallaba porque todo el pipeline se guía por el
transcript. Ahora, al detectar que no hay audio, en vez de fallar se manda el
vídeo a Gemini multimodal (get_visual_clips): lo *mira* y elige los momentos
visualmente más potentes, devolviendo el mismo esquema de clips que la vía por
transcript. El resto del pipeline (corte, reframe vertical, watermark) es igual.
- gemini_worker: schema VisualClipModel/VisualResponse + VISUAL_PROMPT_TEMPLATE.
- main.py: get_visual_clips (sube el vídeo, poll a ACTIVE, análisis, borra el
fichero); el flujo cae a esta vía cuando transcribe_video lanza NoAudioError.
- Sin transcript => sin subtítulos (correcto, no hay habla).
Verificado end-to-end en el contenedor con un vídeo mudo real: Gemini eligió
clip + título + hook por $0.0007, y el pipeline generó el vertical con
watermark. Usa gemini-3.1-flash-lite (el mismo modelo barato).
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).
Al 40% quedaba demasiado dentro de la imagen; el usuario la quiere más arriba,
a un tercio de la altura. 0.34 es el punto donde empieza el contenido en un
16:9 letterboxed: la marca se apoya justo en el borde de la imagen, se lee
arriba pero ya pisa footage real, así que recortarla sigue costando cortar el
vídeo.
1. Watermark al 40% de la altura en vez de arriba del todo: ahí caía en la
banda negra/desenfocada del 9:16, espacio muerto que se recorta sin tocar
la imagen. Un 16:9 letterboxed ocupa del 34% al 66%, así que ahora quitarla
obliga a cortar vídeo de verdad.
2. OUTPUT_DIR no es durable en prod (cada redeploy lo vacía), y los endpoints
que leen ficheros del job devolvían 404 en proyectos que el usuario sigue
viendo en su biblioteca: transcript, download-all, subtítulos, hooks,
efectos, doblaje y publicación. Nuevo _ensure_job_files() que rehidrata
desde R2 bajo demanda reutilizando el flujo de /restore. Se deja fuera el
polling de /api/status para no machacar R2.
3. download-all no encontraba ningún clip en proyectos restaurados: el
metadata.json en disco nunca lleva video_url (se inyecta solo en memoria),
así que derivaba nombres vacíos. Ahora usa el registro en memoria (que
además refleja ediciones subtitled_/hook_) y cae al nombre canónico.
Verificado en local con docker compose contra R2 real: transcript 200 con 103
palabras y ZIP de 6,2 MB con los 4 clips, sobre un proyecto sin ficheros en
disco.
- La marca pasa de texto abajo-centrado a un lockup blanco (símbolo +
OpenShorts) superpuesto arriba a la izquierda: el borde inferior es lo
que se recorta al repostear, así que ahí la marca se quitaba gratis.
PNG pre-renderizado en assets/ para no depender de fuentes del contenedor.
- WatermarkModal: aviso único al descargar en plan free (descargar igual /
upgrade / no volver a mostrar), al estilo del de OpusClip.
- StarBanner también durante la generación, que es donde el usuario tiene
minutos muertos esperando.
- Plan free resuelto en metering (sin fila Stripe): 20 min/mes para cuentas
Google, período sintético de mes natural con reset automático
- TRIAL_DAYS=0 para nuevos checkouts; trials en curso grandfathered
- Watermark drawtext en clips free (pasada única post-render, sobrevive
subtítulos/hooks); thumbnails IA solo de pago
- Anti-abuso: 3 jobs/día por cuenta, 5 por IP, rate-limit de probes,
contador mensual de GB de proxy con alerta Telegram a 100 GB
- Clips free caducan a 7 días (purge_free_expired); purge_expired respeta
a cancelados que ahora son free
- Galería UGC pública pasa a opt-in (share_to_gallery, antes publicaba
producto+guion de todos los usuarios sin permiso)
- Emails: clips listos (con star-ask) y sin-minutos (cooldown 24h)
- Frontend: card Free en pricing, copy sin trial (landing/legal/gates),
StarBanner en resultados y TopUpModal, upsell de watermark
- Sample 5 evenly-spread frames clamped inside the scene (old start+5/end-5
fell outside scenes shorter than ~10 frames)
- Skip near-black frames so fades stop dragging single-person scenes to GENERAL
- Hysteresis: a sub-2s scene flanked by agreeing neighbors adopts their
strategy — each TRACK<->GENERAL flip is a full layout change on screen
New scene_detection module: TransNetV2 (small 3D-CNN, runs on 48x27 frames)
as the primary shot-boundary detector — far more accurate than the fixed
ContentDetector threshold on fast motion, flashes and gradual transitions.
Adds a min-scene-length merge (SCENE_MIN_SEC, default 1s) to stop camera-snap
bursts. Legacy PySceneDetect path is preserved untouched as automatic
fallback and selectable via SCENE_ENGINE=pyscenedetect.
Replaces the single whole-transcript call with windowed scoring + focused
detailing (from PR #50), for better clip coverage on long videos:
- clip_selection.py: build_transcript_windows (sentence-aligned overlapping
windows), snap_clip_to_words (cuts land in pauses, not mid-word), model
price table.
- gemini_worker.py: score/detail prompts + Pydantic response schemas + robust
JSON parsing and multi-stage cost accounting (incl. thinking tokens).
- main.py get_viral_clips: pass 1 scores windows in batches and shortlists the
top (scaled by duration); pass 2 details the shortlist; every clip is snapped
to word boundaries. Cost is summed across both passes. Falls back to
whole-video conversion (caller) if it yields nothing.
- 13 clip_selection unit tests (63 total).
- Quality gate: quality_probe.py probes the offered YouTube resolution before
starting; /api/process returns needs_confirmation below QUALITY_GATE_MIN_HEIGHT
(720p) and the UI shows a 'process anyway' modal that resends with
force_low_quality. Fail-open on any probe error. URL sources only.
- Output format: MediaInput picks 9:16 / 1:1 / 16:9; threaded through
/api/process -> main.py --format. render_clip() routes vertical/square to the
reframe (aspect_ratio param) and horizontal to a passthrough (keep landscape).
- Whisper: main pipeline defaults to 'small' (better non-English) with
vad_filter + no cross-segment conditioning; env-overridable.
gemini-3.1-flash-lite intermittently emitted JSON the manual fence-strip +
json.loads couldn't parse ('Expecting value: line 16 ...'), so clip
detection failed and fell back to whole-video conversion -> 'No metadata
file generated'. Request response_mime_type=application/json so the API
guarantees a JSON body, and on a parse miss rescue the outermost {...}
object before giving up.
Re-encode passes (vertical render, hooks, subtitles, AI effects) ran at
CRF 22-23, stacking visible generation loss across steps (#13). Bump all
of them to CRF 18; post-process steps also move preset fast -> medium
(the realtime reframe pipe keeps fast to not slow the streamed encode).
OpenCV resizes now use INTER_LANCZOS4 for sharper scaling.
Adopted from PR #14 review (the good parts, rebased on current main).
- Retry transient Gemini errors (503/429/500) up to 3x with exponential
backoff before falling back to whole-video conversion (#27)
- Thread the hook Duration slider through /api/hook down to the FFmpeg
overlay enable filter so hooks can end after N seconds (#2)
- Read JOB_RETENTION_SECONDS from env so self-hosters can keep finished
jobs longer than the 1h default (#46)
- 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.
VideoManager/SceneManager top-level imports were removed in 0.6+, causing
ImportError on job start. Switched to open_video() and SceneManager.detect_scenes(video=...).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
YouTube titles containing '#' (e.g. hashtags like #shorts) were saved to disk correctly, but the browser parses '#' as a URL fragment, so the frontend could never request the actual file and clips appeared missing. Add '#' to the regex in sanitize_filename().
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>