Commit graph

440 commits

Author SHA1 Message Date
juancarlos.cavero
989e69ce16 Merge branch 'banksy-9e8512dd-retomado': mobile pass for the dashboard
Brings the phone navigation shell (bottom tab bar + drawer in place of the
80px icon rail, safe areas, touch targets, bottom-sheet modals) and the fix
for the clip-generation view, whose two HUD pills overlapped and interleaved
their letters on any box narrower than their combined width.
2026-08-24 16:28:15 +02:00
juancarlos.cavero
0d6cf9c6fd feat(skills): plugin manifest so the skill can be submitted to the Claude Code community marketplace 2026-08-24 16:27:04 +02:00
juancarlos.cavero
3bd1886081 fix(skills): correct the published agent skill against the current API
The skill published in 78deea2 has drifted from the code. It lists six
tools (recut_clip landed since), documents output_format as "1080p" when
it is an aspect enum, promises 3-15 clips when the model usually returns
2-6, and tells agents to poll every 10s against the MCP server's own
30-60s guidance.

Adds what an agent needs and cannot infer from the endpoints:
needs_confirmation arrives with HTTP 200, so an agent that does not know
it believes a job started when none did; the 402 and 429 shapes; when
each layout is wrong rather than only what it is; and the clip-length
and target_clips bounds.

reference.md carries the exact payloads and error shapes, README.md the
per-platform install.
2026-08-24 16:23:42 +02:00
juancarlos.cavero
b9f232366a fix(dashboard): make the clip-generation view legible on a phone
The "generating" screen was the one the user singled out, and the scan box
was the reason. Interface only; no pipeline, request or data changes.

The visible defect: two HUD pills were pinned to opposite corners of the
preview, ~150px and ~170px wide. Any box narrower than their combined width
made them overlap and interleave their letters — "SCANNING CO|VIRAL_DETECTION:
ACTIVE". That is every phone, and the md tablet width too, where this panel is
only 55% of the viewport. They are now one flex row with justify-between and a
truncating left pill, so they degrade instead of colliding, and the right-hand
pill (which says nothing the left one doesn't) waits for lg.

The rest of the box was desktop flourish that turns to noise at phone scale,
so below sm it drops the blueprint grid, the dashed thirds guides, the ping
ring and the scissors, and the bottom telemetry bar — which was spending a
third of a 175px box on two lines that are always true. The box itself goes
2:1 instead of 16:9 (object-cover crops rather than shrinks, so no picture is
lost) and loses 16px of the margin under it.

Removing the invented telemetry leaves a phone with nothing to read, since the
log terminal starts collapsed there, so the panel now shows the real log tail
under the preview: "Transcribing with faster-whisper", "Asking Gemini to pick
the viral moments". Between that and the tighter box, "Generated Shorts" is
now on the first screen instead of a full scroll down, and its empty state
gets a min-height and a line saying clips appear one by one.

Verified at 360/390/640/768/1024/1440: no pill overlap and no horizontal
scroll at any width; the full HUD is intact from lg up.
2026-08-24 02:34:03 +02:00
juancarlos.cavero
3709d64085 feat(dashboard): make the app usable on a phone
The dashboard was a desktop layout that merely survived a narrow viewport.
The changes below are interface only; no backend behaviour, request shape or
data changes.

Navigation. Below md the 80px icon rail is gone. It cost a fifth of a 360px
screen to show seven unlabelled glyphs. In its place: a bottom tab bar with
the four everyday destinations plus "more", and a drawer behind the header's
menu button carrying the full list. All three surfaces read one `navItems`
array, so they cannot drift. The tab bar is a flex sibling of the scrolling
pane rather than a fixed overlay, so no pane needs compensating padding and
nothing hides behind it. The header gains the section name the rail used to
carry, so a phone still knows where it is.

Shell. h-dvh where supported (100vh hides its own bottom bar behind mobile
browser chrome), body overflow-x hidden, and safe-area padding for the iOS
home indicator via viewport-fit=cover.

Touch and legibility. Inputs render at 16px below sm so iOS stops zooming on
focus and never zooming back; the shared button pills get a 44px floor on
coarse pointers; the 10.5px mono labels come up to 11.5px on phones.

Density. The clip-generator hero no longer fills the fold on its own. The log
terminal starts collapsed on phones. Result cards cap the 9:16 preview so the
title, captions and actions stay on the same screen as the clip. Modals become
bottom sheets below sm — a centred dialog with 4px side margins was wasting the
only width there was. Banners, the results toolbar and the social nudge stack
instead of crushing.

Also fixes three <div>-inside-<p> blocks in Settings that the browser was
silently tearing apart.
2026-08-24 02:25:24 +02:00
juancarlos.cavero
06984906e2 fix(dashboard): show each clip with its hook and captions as soon as it is done
A job in flight published every clip as the clean reframe name, guessed by the
status poller. The hook and the captions live in derived files
(hooked_<ts>_<clean>, subtitled_<ts>_hooked_<ts>_<clean>), and only when the
WHOLE job finished did the result get rebuilt through _canonical_clip_file and
resolve to them. So a six-clip job showed clip 1 hook-less for the five clips
after it, which reads as the hook feature being broken.

main.py now prints CLIP_READY <index> <filename> at the end of each clip's
chain, after the caption step and carrying its result, so the name is the file
that will actually be delivered. app.py consumes the marker the way it already
consumes PROXY_BYTES: intercepted in enqueue_output, never shown as a log line.

The poller now serves only announced clips. That also closes the older hazard
in the code it replaces, whose own comment admitted it was guessing: presence
on disk was treated as done, so a clip could be served while ffmpeg was still
writing it. A clip whose marker never arrives (it failed) stays hidden until
the job ends and the result is rebuilt from disk, as before.
2026-08-24 00:37:24 +02:00
mutonby
054020481e
Merge pull request #74 from Chaakh/fix/windows-filter-paths
Fix four bugs that make self-hosting unusable on Windows
2026-08-23 23:34:45 +01:00
juancarlos.cavero
6e439785c6 fix: pass PYTHONIOENCODING to the job subprocess too
The stdio reconfigure only covers the API process. main.py prints an
emoji on its first line and configures nothing, so on a cp1252 console
the server now starts but every job dies before rendering.
2026-08-24 00:32:17 +02:00
juancarlos.cavero
c6ddb40630 fix(clips): precompose accented titles so the file name survives a fetch()
"canción" has two Unicode spellings: a precomposed ó, or an o followed by a
combining acute. yt-dlp hands over titles in either, and sanitize_filename let
the decomposed form through into the clip file, the R2 key and the URL path.

Measured against prod on 24-ago-2026, on a clip whose title carried the
combining form: a <video> element loads it fine, and fetch() of the very same
URL comes back 503, while curl gets 206 with the identical headers. So the
download button, which fetches, was broken on effectively every Spanish title,
and playback hid it.

Normalising at sanitize_filename fixes the whole chain at its source: one name
for both spellings, and a no-op for the ASCII names that already worked. Clips
already archived keep their decomposed name and still play.
2026-08-24 00:15:08 +02:00
juancarlos.cavero
080dd5780b feat(delivery): serve clips from a custom R2 domain, and show download progress
Measured 22-ago-2026 against prod, on one 46 MB / 52 s clip:

  origin -> itself through Traefik   130 MB/s
  origin -> a datacenter client      838 KB/s
  origin -> the author's browser      90 KB/s   (8.5 min for one clip)
  R2 S3 endpoint -> the server        11 MB/s, 206
  R2 S3 endpoint -> that browser      503, every single request

So the API process is not the bottleneck (it serves the file at 130 MB/s while
the box sits at 0.01 MB/s of egress); the long path out of Hetzner is. And the
fix for that, R2, is unreachable from a browser: *.r2.cloudflarestorage.com is
an S3 endpoint, and a presigned GET that curl fetches at 11 MB/s with identical
headers returns 503 to Chrome.

R2_PUBLIC_BASE points presigned_get() at a custom domain bound to the bucket
instead, which serves the same objects through the normal Cloudflare edge.
Unset, everything keeps signing S3 URLs exactly as before, so this is inert
until the domain exists. Switched at that one choke point because every caller
hands the URL to a browser.

The download button streamed nothing to the screen while it buffered tens of MB
into a blob, which on a slow link is minutes of a button that looks dead. It now
reports percentage, which needs Content-Length readable from JS, which needs the
CORS middleware to name it in expose_headers.
2026-08-23 13:49:08 +02:00
Chaakh
df0bc19df2 fix: force UTF-8 on stdio so the server starts on a Windows console
Every log line in app.py is emoji-prefixed and a Windows console is cp1252
by default, so _recover_jobs_from_disk() kills the server during startup:

    print(f"♻️  Recovered {recovered} completed job(s) from disk.")
    UnicodeEncodeError: 'charmap' codec can't encode characters in 0-1
    ERROR:    Application startup failed. Exiting.

It never binds a port, so the dashboard is simply unreachable on a stock
Windows box. PYTHONIOENCODING=utf-8 works around it, but that has to be
known before the first run, and the traceback does not suggest it.

subtitles._configure_stdio already does exactly this for the transcription
path. The server needs it too, and needs it before the first print, so it
runs at module scope rather than in the lifespan hook.

Verified: uvicorn with no PYTHONIOENCODING, and an import under a stdout
forced to cp1252/strict. Both start and log the emoji correctly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QiYkHKB7Tp7X6NdnEutda2
2026-08-23 12:23:06 +02:00
Chaakh
362fe661f9 fix: spawn main.py with sys.executable, not bare "python"
The job runner built its command as ["python", "-u", "main.py"], which
resolves against PATH. Inside the Docker image there is exactly one
interpreter so it works, but in the documented non-Docker install --
a venv -- PATH points at whatever Python came first, not the one running
the server. Every job then dies immediately:

    ModuleNotFoundError: No module named 'cv2'

The CLI works fine in the same checkout, so it presents as "the dashboard
is broken" rather than anything to do with interpreters.

_run_quality_probe five hundred lines up already uses sys.executable for
exactly this reason; this makes the two agree.

Verified: same job, same venv, failed before and completed after.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QiYkHKB7Tp7X6NdnEutda2
2026-08-23 10:26:10 +02:00
Chaakh
88a53b6f7e fix: escape the sendcmd path so TRACK reframing works on Windows
reframe_v2 built its filtergraph as sendcmd=f='<abs path>' with the path
interpolated raw. On Windows tempfile.mkdtemp() returns C:\Users\..., and
the drive colon terminates the filter option, so ffmpeg exits non-zero and
every TRACK scene silently falls back to the v1 Python frame loop. GENERAL
and SPLIT hide the bug because only the TRACK branch emits a sendcmd.

subtitles._escape_ffmpeg_filter_value already solved exactly this for the
ass/fontsdir filter three modules away, so this moves it to ffmpeg_utils as
escape_filter_value() and uses it in both places. subtitles keeps its
wrapper and its docstring; behaviour there is unchanged (verified equal
output on absolute, relative and space/comma paths).

Measured on a 12s 1280x720 clip with one face, Windows 10 + ffmpeg 9:
  before  53.5s  "Reframe v2 failed (CalledProcessError ...)" -> v1 loop
  after   30.8s  v2 native, same framing

Also: `-o <dir>` crashed with PermissionError [WinError 5] because
--skip-analysis passed the directory straight through as the output
filename and it reached os.remove(). --output is documented as "directory
or file", so derive the filename when it names a directory, and guard the
stale-file sweep with isfile() so a directory can never be handed to
os.remove().

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QiYkHKB7Tp7X6NdnEutda2
2026-08-23 08:53:20 +02:00
juancarlos.cavero
e0fa3fd591 perf(dashboard): play clip previews from R2, not from the render box
Each result card streamed its clip from /videos, which is served by the
same single-worker API process that is running the renders, while the
same clip was already archived to R2 (free egress, edge-served). The
durable URL was in the browser the whole time and was only used as an
error fallback.

It becomes the playback source, but only while R2 holds exactly the file
the server considers current: a server-side edit rewrites the clip and the
re-archive behind it is fire-and-forget, so preferring the durable copy
blindly would show the clip from BEFORE the edit. /api/history therefore
returns the archived filename, and the card compares it against its own
serverVideoFile.

The map is chased after each edit and again once the job completes, since
a job is marked completed before _archive_managed_job finishes uploading
and the first read otherwise lands empty and never retries. The effect
that reads it is keyed on the clip count instead of the results object, so
it no longer re-reads the history on every status poll. The durable copy
is never adopted under a player the user already started, because swapping
src restarts playback.

Display only: currentVideoUrl still drives the download button and every
server operation (all of which pass input_filename, never a URL), so no
edit can be routed to the wrong file by this.
2026-08-22 19:52:17 +02:00
juancarlos.cavero
22d4d1889e copy(banner): one star ask per job, while the clips render
The finished-clips banner made it two asks for the same job, and the old
wording put the word "free" next to the product name for anyone who missed
the pun, which is the one thing this copy must never do.
2026-08-22 19:51:40 +02:00
juancarlos.cavero
9e58e64e3c chore(examples): name the clipper in the template title
Open source is the one claim no competing clipper can make, and the
guidelines want the main services named. Attached to the tool name
rather than left as a standalone boast, which is the pattern the
already-published templates on this account follow.
2026-08-22 17:56:38 +02:00
juancarlos.cavero
bffdbc1b75 chore(examples): title the template for how the marketplace is searched
The guidelines ask for the main nodes in the title, and the highest
performing template on this account (20k views) names the destination
and the word viral. The previous title said neither, and it also buried
the one thing no competing template does: it fires on every new upload
rather than on a video you hand it.
2026-08-22 17:54:47 +02:00
juancarlos.cavero
2d1ca04032 fix(examples): meet the n8n template submission guidelines
Read the guidelines properly (n8n.notion.site/Template-submission-guidelines)
and the template failed three of them.

A single sticky explaining the whole template is mandatory and there
wasn't one, only per-stage notes; the overview sticky now carries the
full description in the sections reviewers expect (who it's for, what it
does, setup, requirements, customising), and the stage notes drop to the
neutral colour the guidelines ask for so the overview is the one that
stands out.

The title now follows the required 'action verb + object + destination'
shape instead of a product name plus a slogan.

Configuration is grouped into Set nodes, which the guidelines ask for and
which fixes a genuinely bad bit of design: pasting the same Telegram chat
id into six separate nodes. Each trigger branch gets its own Settings
node because a branch cannot read a node another branch ran, so it is
three edit points now, all named and in one place per branch.

Re-tested end to end after the restructure: the webhook branch still
splits the clips and delivers them to Telegram, which is the path the new
Set node sits in.
2026-08-22 17:51:40 +02:00
juancarlos.cavero
658defe614 fix(proxy): probe the duration over the static pool, not the per-GB proxy
The static ISP pool (dfa3124) moved downloads off the paid proxy but never
touched cloud/metering.py, so probe_url_minutes kept reading PROXY_URL alone.
Every managed YouTube submission still paid DataImpulse for 0.2-1 MB of yt-dlp
metadata (measured through a counting proxy) while the download itself went out
free over Decodo — and invisibly, because PROXY_BYTES only counts the bytes of
the winning download attempt.

The probe now walks the same cheapest-first chain as the download: direct when
DIRECT_FIRST=1, then the statics rotated per probe, then the paid proxy as the
last resort. Proxies are the outer loop and extractor strategies the inner one,
so the paid route is only reached after every free one has failed on both.
That also stops a drained paid proxy from taking YouTube ingest down on its own
("Could not determine the video duration") while the statics are healthy.

Two smaller cuts on the same path: a user with no minutes left now gets its 402
before the probe instead of after it, and a failed route no longer dumps a
yt-dlp ERROR block per proxy per strategy into the API log (the watcher is what
reports a dead route).
2026-08-21 22:45:53 +02:00
juancarlos.cavero
119a6da8be feat(seo): canvas screenshot on the n8n page, and link it from the landing
The page opened with a TL;DR box, which is the wrong lead for a page
whose subject is a workflow: the canvas shows in one glance what four
paragraphs were describing. Screenshot in, summary box out, and the
TL;DR block in render.js is now optional so other pages can make the
same call.

Two nodes in act 3 sat on identical coordinates after the queue node
landed, so the template opened with overlapping labels on import.

The landing named n8n in the hero without linking anywhere; it now
points at the workflow page, in the app and in the crawler fallback
that has to mirror it.
2026-08-21 21:41:58 +02:00
juancarlos.cavero
36cf2e43ef harden(social): fail closed when the server cannot resolve the caller's profile
Cloud keeps every user's connected accounts as profiles inside one
Upload-Post account, so the profile string is the only thing separating
'schedule to my TikTok' from 'schedule to a stranger's'. All three call
sites read `forced_profile or <client-supplied profile>`, which honours
the client's value whenever the server fails to resolve its own — one
resolver bug away from a cross-tenant write, and invisible in review
because the happy path looks identical.

resolve_post_profile() now refuses in cloud mode instead of falling
back, and never consults the client value there; self-host keeps
picking its own profile, since it owns the account behind the key.
Tests pin both behaviours and the profile filter on the scheduled-post
list, which is what stops one tenant reading or cancelling another's
queue.
2026-08-21 21:19:44 +02:00
juancarlos.cavero
a245f14ec5 feat(seo): landing page for the n8n content-machine template
/n8n-youtube-shorts-automation answers the two loudest unanswered asks
in the n8n community (a free/self-hostable clipper callable from a
workflow, and why posting video to TikTok/Instagram is so painful), and
gives the Reddit and forum posts a stable URL of ours to point at
instead of a raw file on GitHub.

Also drops the now-false 'there is no official n8n template yet' from
the automation page's body and FAQ, and links the two.
2026-08-21 21:14:05 +02:00
juancarlos.cavero
149ca85831 feat(api): scheduled-post queue endpoints, and fix the template's slot race
GET /api/social/scheduled lists the caller's pending posts and
DELETE /api/social/scheduled/{job_id} cancels one. Upload-Post's own
schedule endpoint takes no profile filter and returns the whole managed
account, so both filter by the caller's profile server-side — the same
multi-tenant trap as the impressions endpoint, and the reason cancel
404s instead of 403s on someone else's job.

The template picked its next daily slot from n8n workflow static data,
which two approvals tapped seconds apart both read before either wrote,
booking the same slot and publishing together (seen in a live run). It
now derives the slot from the server-held queue, which is shared state
and cannot race with itself that way.
2026-08-21 21:03:41 +02:00
juancarlos.cavero
05c0238cc0 fix(api): compute social impressions from the profile-scoped post cache
Upload-Post's /total-impressions/{profile} echoes the requested profile
but returns account-wide numbers — a profile with zero posts got 85K
Instagram impressions — which for managed users leaks other tenants'
aggregates into the dashboard card and the analytics API. Aggregate the
post-analytics cache instead, which is correctly scoped by ?user=, and
keep the same response shape (total_impressions + per_platform).
2026-08-21 19:49:09 +02:00
juancarlos.cavero
cb1eecaa34 feat(dashboard): post analytics card + connect entry in profile selector
Account page gains a 'Your posts' card: last-30-days impressions with
per-platform split and the top 3 posts by views, backed by the new
analytics endpoints. Hidden for free users (402) and until data loads.

The header profile selector was a no-op for managed users (exactly one
profile, nothing to switch) while displaying greyed-out networks with
no way to connect them — it now ends in a Connect / manage accounts
action that opens the branded Upload-Post connection page.
2026-08-21 19:16:53 +02:00
juancarlos.cavero
6f76e875cd feat(examples): n8n Content Machine template + webhookId fix
New openshorts-content-machine.json: daily channel-RSS watcher (one
video per day, new upload first then back catalog), clips delivered to
Telegram with approve/skip buttons, approved clips drip-scheduled via
/api/social/post, weekly analytics digest from the new endpoints. A 402
pauses the machine with a Telegram notice and leaves the video
unmarked so the next day retries it.

Both templates now carry webhookId on webhook-based trigger nodes:
without it n8n imports the node but never registers the webhook, so
every incoming call 404s. Found by importing and executing the
workflow against a live n8n.
2026-08-21 19:16:53 +02:00
juancarlos.cavero
be5b7276c2 feat(api): read-only social analytics proxies over Upload-Post
GET /api/social/analytics (profile totals), /analytics/posts (per-post
cached metrics) and /analytics/impressions (windowed totals). Managed
users are locked to their own profile and rate-limited to 60/h in a
bucket separate from the metering probes; cloud without a plan gets a
clean 402 no_plan instead of a misleading missing-header 400. BYOK
keeps its own key and picks the profile with ?user=.
2026-08-21 19:16:53 +02:00
juancarlos.cavero
8fb5e3b7b6 fix(editor): hide the word-boundary hint when the job kept no transcript
A silent/visual-only job has no words to click, so 'CLICK A WORD, THEN
SET A BOUNDARY' sat right above 'this job kept no transcript'.
2026-08-21 15:17:44 +02:00
juancarlos.cavero
4a71d66066 fix(dashboard): guard the synced-playback seek against a non-finite time
Found while browser-testing the editor: a clip without a start yet makes
ResultCard emit onPlay(NaN), and assigning that to currentTime throws in
a mount effect, taking the whole tree down to a black screen.
2026-08-21 04:49:28 +02:00
juancarlos.cavero
0b59047422 feat(dashboard): social-connect nudge at the results peak
Only 2.7% of cloud users who pass through the social flow ever connect a
network (146 of 5,406 Upload-Post profiles), yet publishing from the app
is the strongest retention loop we have. Show a dismissible banner right
when the clips appear - the moment with the best odds - prompting managed
users with no connected network to open the hosted connect page.

Instrumented like the other conversion moments: SocialNudgeSeen (once per
job), SocialNudgeConnect, SocialNudgeDismissed (persisted in localStorage,
never shown again). Hidden automatically once any network is linked.
2026-08-21 04:36:05 +02:00
juancarlos.cavero
9d18520c2e fix(editor): four UX corrections from issue #73
- The clip track's scale is now the rendered length instead of the
  current total, so trimming a segment visibly shortens its bar; before,
  a single-segment clip always filled 100% of the track and dragging its
  handle appeared to move nothing.

- Playback boundaries are enforced by a per-frame rAF loop instead of
  timeupdate (~4Hz), which let the preview overshoot a trimmed endpoint
  by up to 250ms — the exact frame is what an end trim is judged
  against. Hitting an edge also snaps currentTime back onto it.

- The transcript header now offers 'segment starts/ends here' actions on
  the selected word, where the eye already is when choosing a cut point
  from the text.

- Closing the editor mid-render is allowed and explained: the request
  keeps running and onRerendered (functional setState in App) updates
  the clip card after the editor is gone.
2026-08-21 04:20:18 +02:00
juancarlos.cavero
730f7de949 fix: reject too-short sources at submit and stop alerts blaming recovered downloads
Prod 20-ago, 5 of 12 managed jobs failed and the alert said 'youtube
download' — no download had terminally failed. Three fixes:

- The quality probe now reports source duration, and /api/process rejects
  sources under MIN_SOURCE_SECONDS (default 45, 0 disables) on all three
  ingest paths with a clear message. A 24s YouTube Short cannot yield
  15-60s clips; Gemini returns nothing and the job burns managed minutes
  to die with 'no usable clips' (3 of the 5 failures, one user retrying
  the same cat video).

- _job_error_text drops per-attempt download warnings when a later
  attempt succeeded (HD-direct fails on every job since the server IP
  ban; static proxies recover it), and gained an 'Error:' marker so
  raised exceptions (RuntimeError:, GeminiBlockedError:) reach the alert
  instead of a bare 'Traceback ... exit code 1'. The classifier names
  'no clips found (user video)' as its own content-shaped category.

- (env, no code) DIRECT_FIRST=0 in prod: with the server IP banned the
  direct attempt only added ~10s and the noise behind these alerts.
2026-08-20 22:54:51 +02:00
juancarlos.cavero
e4792fd3b3 feat: hand the Thumbnail Studio video and transcript straight to the clip generator
Issue #68: publishing a video to YouTube from the Studio now offers
'create clips from this video'. /api/process accepts a
thumbnail_session_id, hardlinks the session's source under the job's
name (so /api/source, the clip editor and retention treat it like a
normal upload) and forwards the session's transcript via a new
main.py --transcript flag, so the pipeline skips a second Whisper pass.

Any problem with the forwarded transcript (missing file, no segments,
silent source) falls back to transcribing normally, and empty
transcripts are not forwarded at all. Contract pinned by six endpoint
tests plus a fallback case; verified end to end locally against the
running app (speech video: 'Reusing precomputed transcript (4
segments)' in the job log).
2026-08-20 19:48:13 +02:00
juancarlos.cavero
d0e1f5adfd feat: raise the self-host job retention default to 24h and surface it in the UI
Issue #46 round two: the 1h sweep kept deleting finished projects under
self-hosters who never touched their env. The disk is already bounded by
OUTPUT_MAX_GB / UPLOADS_MAX_GB, so age can afford to be generous. Cloud
keeps the tight default because clips are archived to R2 on completion.

The results panel now tells self-host users how long their clips live
and which env var controls it, and the restorable-session window follows
the new default.
2026-08-20 19:29:55 +02:00
juancarlos.cavero
1cbd22991c fix(docker): keep the YOLO weights in the workdir as before
YOLO_MODEL_PATH stays available for deployments that need it, but the
image no longer sets it, so the default behavior is identical to what
every existing deploy already runs.
2026-08-20 18:55:16 +02:00
juancarlos.cavero
8996ac9c1a fix: make the YOLO weights path configurable and drop a dead import
Adds YOLO_MODEL_PATH (default unchanged) and bakes the weights into
/tmp/Ultralytics in the image so a volume mounted over /app can't shadow
them, plus removes the redundant top-level scenedetect import.

Adapted from #47 by @kayceepeece, minus the CPU-only torch pin which
would conflict with the GPU production build.
2026-08-20 18:51:39 +02:00
psociety
fea6364ffb
docs(readme): fix placeholder clone URL
Squash-merge of #6 by @psociety
2026-08-20 17:48:37 +01:00
juancarlos.cavero
03fb9e7613 test(render-service): pin the composition metadata contract for per-render props 2026-08-20 18:39:43 +02:00
looksg00d
b8816b2db5 fix(remotion): honor per-render duration/fps/dimensions via calculateMetadata
The ShortVideo Composition hardcoded durationInFrames/fps/width/height
from DEFAULT_PROPS. Since there was no calculateMetadata callback,
selectComposition()/renderMedia() in render-service ignored whatever
durationInFrames/fps/width/height was actually passed in inputProps at
render time, always producing a fixed 900-frame (30s) 1080x1920 output
regardless of the real clip length.

Verified: rendered with durationInFrames=300 (10s) before this fix
produced a 30s file (base video frozen on its last frame for the
remaining ~20s). After adding calculateMetadata, output duration
matches the requested frame count exactly.
2026-08-20 18:34:19 +02:00
juancarlos.cavero
d83e0dddbf refactor(reframe): clean up the v1 fallback loop and get_video_resolution
The v1 frame loop has been the rarely-taken fallback since the v2 engine
shipped in July; give it the same shape as the rest of the file while it
sticks around as the REFRAME_ENGINE=v1 rollback:

- get_video_resolution releases its capture in a finally block
- staging files named .v1video/.v1audio next to the final output, cleaned
  with one loop instead of three inline conditionals
- the rawvideo pipe spells out demuxer options (-video_size/-framerate/
  pipe:0) instead of the short aliases, and drops the redundant -vcodec
- encoder/reader names instead of ffmpeg_process/cap; single -c copy mux
  command built by list concatenation
- dead script_start_time assignment removed

Behavior is unchanged: verified end to end with REFRAME_ENGINE=v1 on a 6s
clip (180 frames, 1080x1920 h264+aac, faststart, scrubbed metadata).
2026-08-20 14:41:37 +02:00
juancarlos.cavero
f8bc461c8e test(edl): pin the full-transcript contract with words outside the old window
The existing test's words all sat inside the removed ±45s window, so it
passed with or without the change. Add words starting 160s after the clip
ends: the old windowed code drops them, the new contract ships them. Also
assert the words arrive sorted by start time, which the editor's
follow-along binary search depends on.
2026-08-20 13:36:13 +02:00
mutonby
05f13254e7
Merge pull request #72 from tuliovianna-lab/feat/clip-editor-ux
Clip editor: source monitor, three-point editing, and a timeline that works while edited
2026-08-20 12:33:28 +01:00
juancarlos.cavero
aa0c841b47 feat(landing): mention MCP in the hero description
The hero now pitches the agent audience too: 'also a clipping tool for ai
agents: claude, chatgpt and n8n drive it over mcp', linking to /mcp. Same
sentence added to the crawler-visible fallback copy (landing-fallback.js
must stay in sync with Landing.jsx).
2026-08-20 02:10:08 +02:00
juancarlos.cavero
1be82bc307 fix(legal): drop the 15-day renewal-reminder promise from the Terms
Business decision: the reminder email will not be implemented for now, so
the Terms must not contractually promise it — a broken written promise is
worse than the underlying statutory ambiguity. Renewal terms now state
auto-renewal until cancellation, cancellable anytime from the account.
(The art. 97.1.p TRLGDCU obligation from Ley 10/2025 still exists for
Spanish companies; revisit if enforcement picks up.)
2026-08-20 01:36:46 +02:00
juancarlos.cavero
2900047b78 feat(legal): full legal corpus — Terms, Privacy, Legal Notice in EN+ES
Replaces the single thin Terms & Privacy SPA view with six indexed static
pages (/terms /privacy /legal-notice + /terminos /privacidad /aviso-legal)
built like the SEO pages, in the sitemap and llms.txt but out of the
marketing interlinking ring. The #legal SPA route becomes a hub linking to
them, so the text lives in exactly one place. Footer and the rights-
attestation checkbox now link to the real documents.

Drafted from a clause inventory of OpusClip/Klap/Vizard/Submagic legals
plus a 2026 Spanish/EU compliance review. Notable substance:
- LSSI art. 10 identity (TONVI TECH SL, Málaga) — was missing entirely.
- Rights warranty covers URL-instructed downloads explicitly and declares
  the attestation record (IP+UA+date) as evidence; DSA arts. 11-17
  notice-and-action with repeat-infringer policy.
- Explicit output ownership (clips are the user's; free-tier watermark as
  a written licence condition) and a no-AI-training commitment naming
  Gemini/ElevenLabs/Whisper — clauses none of the competitors have.
- EU withdrawal per CJEU C-234/25: SaaS is a digital service, the 14-day
  right survives with pro-rata payment (not the digital-content forfeit
  the old page used); renewals do not reopen it. 15-day renewal reminder
  duty (Ley 10/2025) stated.
- AI Act art. 50: dubbed clips declared as labelled/marked; users must
  not strip marks.
- Privacy: per-purpose legal bases, named processors, DPF+SCC transfers,
  real retention (7-day free clips, sub+7 days paid — matching
  cloud/config.py), AEPD analytics exemption documented, no cookie
  banner rationale.
- Spanish versions with prevalence clause (art. 60.1 TRLGDCU; AEPD has
  fined foreign-language-only policies). renderPage supports page.lang.
2026-08-19 22:06:11 +02:00
Tulio Vianna
83c45916a2 feat(editor): rebuild the clip editor around a source monitor and a working timeline
Turns the clip editor into a three-point editing surface: mark in/out on
the source, send the range to the clip, and scrub the result — with the
timeline honest about which parts of the edit the last render can already
show.

- Chrome: the source track ignored drags entirely. Without preventDefault
  the gesture became a text selection and then a native drag, which
  swallows every later pointer event and shows the not-allowed cursor.
- The source track's block is draggable (body moves, edges trim) and every
  gesture on it scrubs the source monitor, so a cut is chosen against the
  picture rather than against numbers.
- Three-point editing: mark in / mark out (i / o) off the monitor's
  playhead, then "replace #N" (.) or "insert after #N" (,). Dragging empty
  track marks a range instead of silently appending a segment.
- /edl ships the whole source transcript instead of a ±45s window: a cut
  can only be extended into words the editor was sent. The panel shows all
  of it, follows playback, and seeks the monitor on click.
- Layout: source monitor + its track + transcript | clip preview + its
  track | controls. Each track sits under the video it drives.
- The clip timeline works while edited. A cut that only removes material
  keeps nothing but frames the last render already produced, so it stays
  scrubbable and playable; only material the render never saw is marked
  red, and the playhead — now a solid handle — stops at its edge.

Transcript words render in memoised 50-word slices: repainting a couple of
thousand of them costs ~66ms, and timeupdate fires four times a second.
2026-08-19 15:23:30 -03:00
juancarlos.cavero
dfa31241ca feat(download): flat-rate static ISP proxies before the per-GB proxy
New STATIC_PROXY_URLS env (comma-separated): dedicated ISP IPs with
unlimited traffic, tried after the direct attempt and before the per-GB
paid proxy. With it unset the chain is byte-identical to before.

- plan_download_attempts: pure, unit-tested attempt ordering. Cheapest
  bandwidth first: direct -> statics (rotated per job, uncapped 1080p,
  free bytes) -> paid HD (720p cost cap) -> fallback via paid.
- The 720p cap and the PROXY_BYTES monthly counter now apply ONLY to
  attempts that actually bill per GB — static downloads come in at 1080p
  and don't count toward the cost alert.
- alerts.py watcher generalized to multiple targets: the static pool
  (down = ingest silently moves to per-GB billing, nag with a cost hint)
  and the paid proxy (down = ingest at risk), each with its own
  down/nag/recovered incident state.

Context: the server's IPv4 is hard-banned by YouTube (19-aug-2026), so
DIRECT_FIRST serves nothing and every download was going through
DataImpulse at $1/GB capped to 720p. Verified from prod: all 3 Decodo
dedicated IPs pass the bot-check with cookies+bgutil at 1080p.
2026-08-19 19:28:52 +02:00
juancarlos.cavero
72288bba82 fix(alerts): probe the proxy over plain HTTP
HTTPS through DataImpulse fails in httpx with an SSL record-layer error
even when the proxy is healthy (verified against a working proxy right
after the top-up; yt-dlp's stack tunnels the same proxy fine), so an
HTTPS probe would report a permanent false outage. An exhausted balance
rejects the request at the proxy before forwarding, so plain HTTP still
catches the 407.
2026-08-19 17:11:10 +02:00
juancarlos.cavero
5e84e6486a feat(alerts): proxy balance watcher — nag on Telegram until topped up
The residential proxy ran out of traffic (407 TRAFFIC_EXHAUSTED,
19-aug-2026) and every YouTube-URL job failed with only easy-to-miss
one-shot alerts. Now:

- cloud/alerts.py: a background watcher probes the proxy every 30 min
  (generate_204, a few bytes of paid traffic). On failure it alerts
  immediately, re-alerts every 2 h while the proxy stays down, and sends
  a recovery confirmation when it answers again — so exhaustion is caught
  even before the next user job fails.
- record_job_outcome: a proxy-classified job failure also opens the
  incident, so job-driven detection and the probe share one state.
- app.py: the watcher starts from the lifespan in managed mode.
- tests/test_proxy_watch.py: state machine (first alert, renotify window,
  recovery + reset, job-error trigger).
2026-08-19 17:07:09 +02:00
juancarlos.cavero
f8535b2584 test(hook): styles contract, bitmap-emoji scaling, layer walk-back
- test_hooks.py: the 6-style contract the frontend mirrors (boxed vs
  outline), fixed-bitmap emoji rescaling (_emoji_scale/_measure_width),
  and create_hook_image rendering every style (emoji included) with the
  unknown-style fallback.
- test_hook_layers.py: _strip_burned_hook walk-back (hooked_/legacy hook_,
  missing-file stop), the two-step subtitled->hooked->clean strip /api/hook
  replaces through, and _canonical_clip_file resolving hook chains with
  newest-derivation-wins.
2026-08-19 16:22:38 +02:00