Commit graph

219 commits

Author SHA1 Message Date
0040aa49da test/e2e-coverage (#5)
All checks were successful
CI / dashboard-e2e (push) Successful in 1m44s
CI / unit (push) Successful in 29s
CI / backend-e2e (push) Successful in 1m17s
Reviewed-on: #5
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-04 22:28:46 +01:00
1dec0dd1af chore/dead-code-removal (#4)
All checks were successful
CI / backend-tests (push) Successful in 28s
CI / frontend-build (push) Successful in 20s
Reviewed-on: #4
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-04 22:11:11 +01:00
719946b3cd refactor/package-layout (#3)
All checks were successful
CI / backend-tests (push) Successful in 29s
CI / frontend-build (push) Successful in 9m48s
Reviewed-on: #3
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-04 20:47:12 +01:00
d56455e555 fix(publish): channel-by-id selection, DD/MM/YYYY scheduling, app-first boot (#1)
All checks were successful
CI / backend-tests (push) Successful in 32s
CI / frontend-build (push) Successful in 31s
- Postiz publishing now selects exact channels by integration id; identifier
  mapping fixes instagram-standalone (was 'not connected') and multiple channels
  per network (was first-only); settings.__type uses the real identifier
- Publish modal lists all channels, DD/MM/YYYY + HH:MM scheduling with validation,
  surfaces backend errors and a success confirmation
- Remove AWS/S3 clip backup and ElevenLabs voice dubbing (server, UI, tests, docs)
- Boot straight into the app; remove the landing/launch screen
- CI backend-tests runs in a python:3.11-slim container (Forgejo has no 3.11 cache)

Reviewed-on: #1
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-04 20:07:42 +01:00
ace54c6e77 chore: rename OpenShorts to Clipwright
Some checks are pending
CI / backend-tests (push) Waiting to run
CI / frontend-build (push) Waiting to run
- Rebrand all text, package/CLI (clipwright_cli), env vars (CLIPWRIGHT_*),
  localStorage keys, Docker container names and webhook header
- Rename/relocate assets, skills/, n8n examples, font map; delete dead MCP
  metadata (server.json, glama.json) and generated egg-info
- Canonical site URL -> https://git.pbento.pt/pedro-bento/clipwright
- Preserve fork provenance (upstream OpenShorts attribution in README/NOTICE/LICENSE)
2026-10-04 18:07:07 +01:00
4e82d60cbc fix: harden Postiz integration and align docs/CLI/n8n after review
- Postiz URL is now required (no built-in host); a key can never be sent to a default instance
- /api/postiz/scheduled normalizes scheduled_date and widens the default window
- Disabled channels are refused for posting; frontend excludes them from connected platforms
- 4xx instead of 500 on missing clip URL / bad schedule date; Postiz error bodies truncated
- Add tests/test_postiz.py (24 tests); fix remaining cloud-removal test drift
- CLI defaults to localhost:8000; n8n workflows fixed against the real routes
- Remove dead media-token auth code, stale copy (download_url/402) and doc drift
2026-10-04 17:25:17 +01:00
edcfeaf9d5 refactor: remove cloud/ billing mode and flatten to self-hosted-only
- Delete the entire cloud/ package (Stripe billing, auth/OAuth, metering, API keys,
  account erasure, lifecycle/digest emails, R2 archive, autopilot, MCP OAuth,
  proxy ledger, managed keys) and all BILLING_ENABLED branches in app.py
- Keep self-host behavior via no-op shims; /api/config now returns
  {youtubeUrlEnabled, jobRetentionSeconds, localLlm}
- Remove cloud tests (31 files), alembic/, log_view.py, requirements-billing.txt,
  docker-compose.cloud.yml; update CLI to Postiz + /api/config; clean docs/skills
- Flatten dashboard: remove auth/billing/pricing/history chrome, inert config-only AuthContext
- Fix residual test drift; lint + build + compile all green
2026-10-04 17:02:55 +01:00
fbabb4ec5d refactor: self-hosted fork — Postiz publishing, drop AI Shorts/UGC/agent/autopilot/MCP, fix Studio image API, remove upload cap
- Replace Upload-Post with a self-hosted Postiz client (postiz.py) and /api/postiz/* endpoints
- Remove AI Shorts, UGC gallery, AI Agent tab, Autopilot, MCP/agent layer, and their UIs
- Fix YouTube Studio thumbnail generation (google-genai >=2 Interactions API) and blocking download
- Make the video upload size cap configurable/unlimited (MAX_FILE_SIZE_MB, default 0)
- Update SEO/marketing/docs to the single-product self-hosted reality; lint+build green
2026-10-04 16:30:44 +01:00
juancarlos.cavero
06a119c280 feat(mcp): caption presets and the new caption options in add_subtitles
/api/subtitle takes a named preset (subtitles.CAPTION_PRESETS, the same
looks the dashboard offers); fields sent alongside it override that part.
The MCP add_subtitles tool exposes preset, effect, reveal, one_word, shadow
and border_width, and gives a resized line the budget that keeps it on one
line, as the dashboard does. A test keeps the server and dashboard preset
ids in sync.
2026-10-01 18:35:37 +02:00
juancarlos.cavero
9cc0a0feb0 feat(captions): size control and trending caption presets
The subtitle modal had no size control: the font size was pinned at 24
while clips ship at 44, so re-applying captions from the modal halved them.
It now opens on the shipped look and offers S/M/L/XL, with fewer characters
per line as the text grows so a line still fits the 9:16 frame.

New in generate_ass: a "highlight" effect (opaque box behind the active
word via a second BorderStyle 3 style, black text on light boxes), "reveal"
(words appear as they are spoken), a drop shadow, and an outline of 0 when
a shadow carries the contrast. /api/subtitle takes reveal, shadow,
max_chars (1 = one word at a time) and max_duration.

Presets added: Default, Hormozi, Pill, Lime box, One word, Clean. Anton and
Montserrat are selectable, and the preview uses the burn's scale and line
budget so what plays in the modal is what gets burned.
2026-10-01 17:48:42 +02:00
juancarlos.cavero
cb37ae3aec feat(watermark): serve the free-plan mark as a copy, so paying removes it from existing clips
Every file the pipeline and the clip editor write is now clean. On the free
plan the served file is a wm_<final> copy with the mark burned in
(main.mark_delivery, last step after captions; app._deliver for the editor
endpoints, decided from the caller's plan), and both twins go to R2. An
upgrade re-points the user's library at the clean twins from the Stripe
webhook (cloud.videos.unmark_user_library): no render, no source video,
and the dashboard chases the job result until no served URL carries wm_.

Before, the mark rode the reframe encode, so every derivative inherited it
and the upgrade modal's "upgrade to remove the watermark" was false for the
clips already made. The first cancellation for "clip quality" (29-sep) was a
user who paid 15 minutes after their first job and kept the mark on every
download and restyle.

- /videos guard refuses a marked job's clean deliverables (.marked dotfile),
  so the twin cannot be fetched by stripping the prefix off a URL; editor
  scratch files stay servable. Re-checked after an R2 restore.
- Walk-backs treat wm_ as the outermost layer; _canonical_clip_file globs it.
- Jobs from before this scheme (mark burned into the canonical) never get a
  second copy; a failed mark still serves under the wm_ name.
- Watermark notice once per job when the clips land on a free account, and
  before the first download if skipped; tracked with source=results|download.
  Upsell/banner/win-back copy now promise the instant removal.
2026-10-01 09:35:53 +02:00
victorcavero14
29c54fa04c feat(cancel): retention offer as the last step, resume from the account page
The Stripe portal stops cancelling (its config, 2026-09-28), so the dashboard
flow is the only way out and carries the portal's retention coupon:
- GET /api/billing/retention-offer: live monthly plan, no discount on it, never
  offered before (retention_offer in the Stripe sub metadata). Any Stripe error
  means no offer, never a stuck flow. Coupon id from RETENTION_COUPON_ID.
- POST /api/billing/retention-offer/accept: applies the coupon, stores the
  feedback with outcome=retained, alerts "Cancel saved".
- POST /api/billing/resume + "Keep my subscription": undo a scheduled cancel,
  which the portal did with the cancel feature now off.
- cancellation_feedback.outcome (additive column).
2026-09-28 19:03:38 +02:00
juancarlos.cavero
42942aecfe feat(feedback): in-app cancel flow with reason + review, and a sign-up survey
- POST /api/billing/cancel: closed-list reason, optional detail, 1-5 rating and
  review; cancels at period end in Stripe with cancellation_details, then stores
  cancellation_feedback. Account page opens CancelPlanModal (3 steps).
- Portal cancellations: churn alert now carries Stripe's feedback value.
- POST /api/onboarding/survey + /api/me onboarding_survey_pending: accounts under
  7 days get one skippable screen before the clip tutorial (what they want to
  make, where they heard of us, who they are). Stored in onboarding_surveys and
  tracked as SignupSurveyAnswered with per-goal props.
- Both new tables are user-owned and erased with the account.
2026-09-28 18:27:00 +02:00
victorcavero14
c7dab3dbf4 feat(landing): say the first video is free up to 60 min, then 20 min a month
Hero trust line, cloud card, pricing header, final CTA, pricing page, tool
gate, the crawler fallback, the default SEO CTA and the Cloud summary in
seo/data.js.
2026-09-28 13:29:14 +02:00
victorcavero14
725aebf1a3 feat(funnel): first free video clipped whole, auto-partial instead of the wall, lifecycle emails
- Free source past the balance: first video (<= 60 min) clipped whole for the
  balance, any other clipped to the first N minutes. No 402 wall for free
  accounts with >= PARTIAL_MIN_MINUTES left.
- cloud/lifecycle.py: welcome, first-clip nudge, win-back (optional
  WINBACK_PROMO_CODE from env) and abandoned-checkout recovery via
  after_expiration.recovery + checkout.session.expired.
- Commercial emails go through send_commercial_email: opt-out honoured,
  unsubscribe footer and List-Unsubscribe headers (out-of-minutes too).
2026-09-28 13:05:43 +02:00
victorcavero14
77d3a1143e feat(hooks): "edit hook" with a typeface picker; a preview that matches
- The clip button and modal are "edit hook" (was "viral hook"), and the
  submit says "update hook" when the clip already has one.
- Typeface picker: Montserrat, Anton, Serif, all bundled so the server
  render (hooks.HOOK_FONTS, /api/hook `font`) and the Remotion preview
  (HOOK_FONTS in remotion/lib/fonts.ts) use the same file and size.
  Unset keeps each style's own typeface, so existing styles render as
  before.
- The preview box is a true 9:16 (it was taller than the video, so the
  hook sat off where it lands); style swatches are larger, drawn in the
  real typeface, and "Pills" shows pills.
- Entrance options are hidden when they cannot apply (server re-render)
  instead of shown greyed out.
- Autopilot: skipped videos can be clipped again by hand (private videos
  used to be misread as Shorts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 01:57:30 +02:00
victorcavero14
a9818832b3 fix(autopilot): no ownership checkbox; private videos said as such
- The connected channel (YouTube's own OAuth) is the proof the content is
  the user's: the "I own the content" checkbox is gone, and switching
  Autopilot on records rights_ack_at by itself. "Clip it" no longer
  requires it either.
- Private videos read as "already a short": /shorts/<id> answers 200 for
  them too. is_youtube_private (oEmbed 401/403) runs first; a manual clip
  says "private on YouTube, set it to Unlisted", and the automatic poll
  leaves the video unclaimed so it is picked up once it goes public
  (scheduled uploads are private until then). They cannot be clipped:
  the YouTube Data API lists the owner's uploads but never serves the file.
- A pasted private video stops downloading as soon as yt-dlp says so
  (before the per-GB proxy) and tells the user why, instead of "YouTube
  blocked the request".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 01:51:08 +02:00
victorcavero14
c26178776f fix(autopilot): "clip it" tells you what happened, next to the button
Without the rights confirmation the button only set the page notice,
which renders at the top of the tab, far above the video list: the click
looked like it did nothing. The confirmation checkbox and the button's
feedback (started, not clipped and why, errors) now sit right above the
list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 01:37:04 +02:00
victorcavero14
a8509249da feat(hooks): "pill" hook style, the new default
Every line of the hook gets its own white rounded box with black bold
sans (Montserrat ExtraBold, SIL OFL, bundled in fonts/ with its license),
the look short-form viewers know from TikTok. It replaces the serif
white card as the default for auto hooks, the editor's hook modal and
the /api/hook default; the other six styles stay selectable.

- hooks.py: _draw_pills renders the stack for the FFmpeg path.
- Remotion HookOverlay mirrors it (box-decoration-break: clone), so the
  editor preview matches the burned result.
- The generate form says the hook text, style, position and size can be
  changed per clip afterwards; the saved style preference moves to a v2
  key so the old stored default does not pin people to the serif card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 01:34:54 +02:00
victorcavero14
0ef20db988 fix(dashboard): real log times, stage progress, cards that use the width
Logs
- Each job log line records when it arrived (app._TimedLog) and
  /api/status returns log_times; the dashboard showed new Date() on every
  render, so every line had the same, moving clock.
- The cloud log view shows every stage: download %, early audio,
  transcription %, finding moments, layout, clips found, and per clip
  creating / framed / ready. Progress updates its own line instead of
  adding one per step. Lines glued to yt-dlp's \r progress bar (the
  parallel transcription prints onto it) are split, so its % shows again.
  "Found N clips" matched the old "viral clips" wording only.

Result cards
- The results grid only goes to two columns when each card gets ~600px
  (auto-fill) instead of at the xl breakpoint, where the side panel was
  squeezed and the copy buttons spilled out of the card.
- Card actions take as many per row as fit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 01:25:57 +02:00
victorcavero14
d585b93ea2 feat(dashboard): say a video is too short the moment it is picked
Uploads under 45 s (MIN_SOURCE_SECONDS) were only rejected by the server after
the whole file went up. The browser now reads the file's duration on select,
explains why it cannot be clipped, keeps Generate disabled, and the drop zone
states the minimum. A file the browser cannot read is left to the server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 08:38:52 +02:00
victorcavero14
681bfb5719 fix(dashboard): show why a job was rejected instead of a generic failure
A new user in the first-clips tutorial who submitted a 30 s video saw only
'That run failed. Try another video'; the server's actual reason ('this video
is only 30s long, clip generation needs at least 45s') was hidden, and outside
the tutorial it landed in the log panel as raw JSON. The FastAPI detail is now
read into plain text and shown in the tutorial card and the logs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 08:34:27 +02:00
victorcavero14
56484dac02 fix(tools): tell a caption-less video from a throttled route; AAC audio in 9:16 MP4s
- Transcript: a finished live stream answers with a duration and no formats,
  and was being reported as "YouTube is blocking us". The degraded-route test
  now keys on the missing duration (watch page served without its player
  response, seen anonymously on two of the three statics), so real
  no-caption videos get the honest no-captions answer. Global daily cap
  1,500.
- 9:16 converter: request AAC for MP4 output when the browser can encode it
  (Opus-in-MP4 does not play in Safari) and only trim when the video is over
  the 5 minute cap; show a frame in the preview instead of a black box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 01:19:20 +02:00
victorcavero14
4bcdc36a6f fix(security): block tailnet SSRF, gate the quality probe, strip job secrets
- security_utils: accept only is_global addresses (100.64.0.0/10, the
  Tailscale range, went through is_private), judging IPv4-mapped / 6to4 /
  Teredo / NAT64 IPv6 by the IPv4 inside.
- /api/process validates the URL (public host, one YouTube video) before
  anything fetches it, and the quality probe now runs after the metering
  step (balance, job limit, hourly probe cap); a low-quality confirm or a
  too-short source hands the reservation back. quality_probe.py checks the
  same itself, passes noplaylist and no longer disables TLS verification.
- Metered whole-video URL jobs carry SOURCE_CAP_MINUTES = reserved minutes
  (job env + resume manifest); main.py cuts a download clearly longer than
  that, so a server cannot answer the probe short and the download long.
- main.py / quality_probe.py get child_env(): the server secrets (Stripe,
  JWT, DB, SMTP, Telegram, R2, AgentLedger, managed keys) are dropped; a
  test fails if the pipeline ever reads one.
- /api/social/user no longer logs the whole Upload-Post profile list.
- Owner checks on /api/thumbnail/generate, /api/thumbnail/publish/status
  (dashboard now polls with apiFetch) and /api/render/{id}; /video/{id}
  and /gallery escape every interpolated value and drop non-http URLs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 01:03:05 +02:00
victorcavero14
8de011ed36 feat(seo): free tools hub, /auto-clip and /youtube-automation, SEO-page attribution
Free tools (no login), linked from nav and footer via /tools:
- /youtube-transcript-generator: reads the captions a video already has on
  YouTube (free_tools.py, yt-dlp over the flat-rate static proxies only, never
  the per-GB proxy, never the GPU). Per-IP limits, global daily cap, 24 h
  cache, honest "no captions" answer with a CTA to the clip generator.
  Copy / TXT / SRT export in the browser.
- /youtube-tag-generator: tags, 10 titles or a description from a brief, one
  Gemini text call, rules taken from YouTube's own docs (sourced on the page).
- /video-aspect-ratio-converter: 16:9 to 9:16 in the browser with mediabunny
  and WebCodecs (blur / crop / bars), nothing uploaded.
Tool pages keep the form in the static HTML; the behaviour is a Vite entry
(dashboard/tools) that vite-plugin-seo resolves by name.

New pages /auto-clip and /youtube-automation with real, blurred screenshots
of the Autopilot tab and the connect-an-agent card, Autopilot rules from
cloud/autopilot.py, plan prices from the billing API and aggregate usage
from the ledger (dated).

SEO fixes: titles/metas for /how-openshorts-works, /podcast-to-shorts, /mcp
and /free-ai-clip-generator (brand queries at pos 1-2 with <1% CTR); a free
AI clipper / free clipping website section and FAQ, and contextual "free AI
clip generator" anchors from sibling pages and the homepage.

Attribution: static pages now write the same first-touch os_attrib key the
app writes, so the signup is credited to the page the visit started on
(7,481 of 7,481 signups in 30 days said "/"). Signup, CheckoutStarted and
Subscribed carry landing_path / referrer_host / utm props in OpenPanel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 01:02:01 +02:00
victorcavero14
d4480c6257 feat(queue): auto-retry transient failures, resume on shutdown, queue position
- A job that fails for a reason on our side (CUDA/OOM, NVENC, cublas,
  Gemini 5xx, no clip rendered) is re-queued once after 30 s, keeping its
  reservation and transcript checkpoint. Content failures stay final.
- main.py renders clips best-score first and retries each failed clip once.
- A deploy's drain timeout no longer fails and refunds running jobs: the
  child is killed, the manifest kept, and the next instance resumes it
  (22-sep-2026: 6 jobs failed at once this way). Mid-render manifests are
  resumed instead of being recovered as completed.
- /api/status returns the queue position and an ETA; the dashboard shows
  it with a 'paid plans skip the line' upsell.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-22 23:48:23 +02:00
victorcavero14
8f57560fa5 feat(autopilot): clip every new video on the connected YouTube channel
Most subscribers use OpenShorts on one day and cancel. Autopilot makes the
value recur: once switched on, every new upload on the user's YouTube channel
(listed through the existing Upload-Post connection, no scraping) is sent
through the normal /api/process pipeline, the user gets an email when the
clips are ready, and with autopublish on the best clips are scheduled on
their socials, one a day.

- cloud/autopilot.py: poller, in-process job submission as the user,
  completion hook, autopublish, and /api/autopilot{,/videos,/run}
- guard rails: only videos published after switching on, max 3 days old,
  1 automatic job per user per day, first N minutes per video, Shorts skipped,
  paid plans only, dedupe by (user, video) across the deploy handover
- dashboard: new Autopilot tab (sidebar + mobile menu, #app?tab=autopilot)
- connect page can return to the Autopilot tab
- analytics: ClipsDelivered/JobFailed now report source=url and the plan

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-22 21:36:19 +02:00
juancarlos.cavero
4b2cf58922 dashboard: show the full clip 'why' in a popover when it is clamped
The line is clamped to two lines so cards in a row stay level; a long
sentence then reads as '...how easily audiences...' with the rest only in
the native title tooltip. When the text actually overflows, hovering
(desktop) or tapping (touch) now floats the whole sentence over the card,
so nothing grows and the grid stays aligned.
2026-09-21 23:28:03 +02:00
juancarlos.cavero
36dba9b3b1 feat(selection): say why each clip was picked, drop clips that overlap a better one
The detail pass now returns a one-sentence `why` per clip (what makes this
moment a clip, not the topic), stored in the metadata and shown under the
title in the dashboard card: the score said how much, nothing said why.
Defaulted in the schema so a small local model that skips it keeps the clip.

After the word snap, clips overlapping an already-kept clip by half the
shorter one are dropped in favour of the higher predicted_score. The prompt's
DIVERSITY rule was the only thing preventing the same moment twice; in ~330
clips over 8 talks it never fired, so this is a guard, not a fix.

Each clip also keeps the model's raw `proposed` boundaries before the snap,
which is what made boundary accuracy measurable: p90 0.4-0.5 s from a word
on 8 talks (21-sep-2026), inside snap_clip_to_words' 1.5 s reach.

Two ideas borrowed from AutoClip were measured with a blind judge on the
same corpus and NOT adopted: quoting per-sentence timestamps in the detail
pass lost 24%/23% (p<0.001, two seeds — it shortens clips and drops the
payoff), and an "end on the reaction, not the line" rule was inert
(47%/53%, p=0.71).
2026-09-21 22:47:55 +02:00
Víctor Cavero
27d4916ca7
SEO: medir las páginas SEO, convertirlas y ampliar el cluster de comparativas (#86)
* feat(seo): measure the SEO pages, convert from them, and widen the cluster

The audit of 17-sep-2026 found the static SEO surface ranking at positions
1.8-4 with a 0.2-1.6% CTR while leaking every click it earned: the pages
carried no analytics at all (~424 clicks/month invisible, confirmed with
curl), the only link into the app was the fixed nav button, ten internal
links pointed at /cdn-cgi/l/email-protection, thirteen titles and
twenty-one descriptions were past the length Google renders, and every URL
in the sitemap claimed the same lastmod.

What changes, and how it is verified:

- Analytics (render.js). The shim, the %VITE_OPENPANEL_*% gate and
  ANALYTICS_HOSTS are ported verbatim from index.html, plus the init call
  the SPA makes from lib/consent.js — first-party measurement is exempt
  from prior consent and always on, so there is nothing to ask here. Vite
  only rewrites index.html and these files are emitted assets, so the
  plugin substitutes the placeholders itself; unset still yields an inert
  page. Verified by building with and without the variables.

- Body CTA (render.js, per-page copy in pages.js). Rendered between the
  TL;DR and the body, with the text that fits each page's argument, and
  never on legal pages or the 404. The link carries utm_* so
  lib/attribution.js can post the click with the signup, and fires a
  SeoCtaClick event so the CTA can be told apart from the nav button.

- Broken mailto links (legal.js). 46 plain-text addresses rewritten as
  <a href="mailto:...">. Cloudflare Scrape Shield turns the bare address
  into a /cdn-cgi/l/email-protection link, which is a 404 for crawlers.

- Titles and descriptions. Every title is now <=60 characters and every
  description <=160, measured across all 35 emitted pages rather than
  eyeballed (/gta-5-clips, merged the same week, was over on both). The
  check is part of the verification, not a one-off.

- Resume the job after sign-in (App.jsx). Pressing "get free clips" with no
  session opened the login modal and dropped the request: the magic link
  lands on a fresh document, so the pasted URL was gone. The request is now
  written down before the redirect and replayed after it, through the same
  handleProcess, so the isSignedIn -> isManaged -> keysMissing gate that
  decides billing is untouched: an unentitled account still lands on
  #/pricing, with the request parked until it pays. Files cannot be
  serialised, so those resume only within the same document.

- Gallery surface (app.py). The gallery head had no canonical; the JSON-LD
  was built from html.escape() output, producing &amp;amp;/&amp;quot; and
  valid-JSON-but-wrong names; the video page's nav and CTAs were relative
  hrefs on the api host, where "/" is a 404 (the app is on www). JSON-LD is
  now serialised as JSON with <> and & escaped as unicode, both pages carry
  their canonical, and cross-host links are absolute. Verified by rendering
  both routes with a monkeypatched gallery: the JSON parses and a title
  with quotes, an ampersand and markup survives round-trip.

- New comparison pages (pages.js): /opus-clip-pricing, /opus-clip-free-
  alternative, /opus-ai, /opus-pro, /vizard-ai-video-to-text,
  /submagic-reviews and a Spanish index at /alternativas. They target
  buying-intent variants (opus clips pricing, opus clip free trial, opus ai,
  opus pro, is vizard ai free) that the existing pages do not answer, read
  every price from data.js, and join the related-page ring, the footer and
  the landing links. /alternatives/vizard also gained the brand Q&A ("Is
  Vizard AI free?"), since "vizard ai" is how its volume is spelled.

Build: npm run build green (35 HTML files, all metadata in range, all
JSON-LD parseable). Tests: pytest tests/ -q, 777 passed, 19 skipped.

* fix(seo): CTA sin UTM interno, tutorial no pisa el job reanudado, mailto en el agente DMCA

- El CTA de las paginas SEO enlazaba al mismo origen con utm_*, lo que
  sobrescribia la atribucion real del visitante en lib/attribution.js y
  partia la sesion en OpenPanel. El evento SeoCtaClick sigue midiendo el clic.
- Alta nueva con un enlace aparcado: no abrir el tutorial intro encima del
  job que se reanuda solo.
- LoginModal solo promete 'tu video esta guardado' cuando el payload es una
  URL; un File no sobrevive al magic link en otra pestana.
- Los dos info@upload-post.com del agente DMCA tambien en mailto.

---------

Co-authored-by: victormanuel.caverogracia <>
2026-09-17 19:26:04 +02:00
juancarlos.cavero
03c8a1f887 feat(quota): offer the first N minutes of a long video instead of a bare wall
93 of the 99 quota walls sampled on 16-sep-2026 were shown to accounts with
their 20 free minutes untouched that had pasted a 21-90 min video: asked to
pay before seeing one clip, most left Stripe without paying.

The 402 now carries partial_minutes (the floored balance, at least
PARTIAL_MIN_MINUTES and shorter than the source). The wall shows 'clip the
first N min' next to the plans and resubmits with max_minutes; the server
reserves min(asked, balance) and sets MAX_SOURCE_MINUTES, and main.py cuts
the source in place before anything reads it, so every later stage and the
editor see a short video. The cut travels in the resume manifest so a
redeploy cannot re-run the whole video on a partial reservation. Status and
the results view say which part of the video the clips came from.
2026-09-16 21:02:38 +02:00
juancarlos.cavero
5cf6c14062 fix(seo): the GTA page was wrong about silent gameplay
It said a stream with no commentary 'gives the picker nothing to score'
and that no amount of tuning fixes it. That is not what the code does.
main.py switches to a vision pass by itself in two cases: NoAudioError,
and speech_is_sparse() coming back true (under MIN_SPEECH_WORDS=8 total
or MIN_SPEECH_WORDS_PER_MIN=5). Gemini then watches the footage and
returns the same 3 to 15 moments in the same duration band, and every
stage after it, layouts and inset detection included, is identical.

So the section becomes a differentiator rather than a disclaimer, since
a transcript-only clipper simply cannot do this. The real constraint is
moved with it and stated plainly: the vision pass is the one stage that
uploads the footage instead of sampling frames, Gemini bills video at
~300 tokens/second, and nothing guards the length, so a silent
multi-hour VOD fails at the model. Clips from that path have no
captions, which is correct and now said out loud.
2026-09-15 22:46:37 +02:00
juancarlos.cavero
6835565dbf feat(seo): add a GTA 5 clips page for the gaming-VOD query cluster
Gaming is the biggest clip-producing category on the vertical platforms and
the one the generic pipeline pages describe worst: the source is a multi-hour
stream VOD, the gameplay fills the whole 16:9 frame, and the only face on
screen is a webcam box in a corner that a centre crop throws away.

The page is built on the two code paths that actually answer that (the
geometric webcam-inset detector and the WIDE layout) plus the arithmetic that
decides the category: per-minute credits against a source measured in hours.
It states the hard limit up front too, that moments are scored from the
transcript, so silent gameplay has nothing to score.

Emits a HowTo node alongside the Article, since the head query here is a
procedure and extraNodes was already supported but unused.

Sitemap lastmod becomes per-page while I am here: the new page is dated
2026-09-15 and stamping every other URL with that date because one page
changed is the fastest way to have a crawler stop trusting the field.
2026-09-15 22:27:18 +02:00
Victor Cavero
5cc3d46997 fix(consent): la medición propia siempre activa; rechazar marketing ya no recarga la página
Claude-Session: https://claude.ai/code/session_01UNZxBnD6dnMGEdbvBVwoS7
2026-09-07 20:04:14 +02:00
Victor Cavero
96f0139861 feat(rgpd): legales, cookies, baja de marketing, marcado AI Act y alertas sin PII
Claude-Session: https://claude.ai/code/session_01UNZxBnD6dnMGEdbvBVwoS7
2026-09-07 19:22:52 +02:00
victormanuel.caverogracia
59ec005d3a fix(build): remove untracked openConsentManager references from Landing.jsx 2026-09-07 11:45:43 +02:00
victormanuel.caverogracia
2d36b03370 fix(build): remove untracked consent and CookieBanner imports from main.jsx 2026-09-07 11:41:25 +02:00
victormanuel.caverogracia
ca9ecd6e67 perf: optimize pagespeed - lazy load app, fix video CLS and compress logo 2026-09-07 11:30:33 +02:00
victormanuel.caverogracia
3e6d5c3bee feat(billing): mirror paid invoices, top-ups and refunds into OpenPanel as revenue
The browser's `Subscribed` event is an intent signal: it misses renewals,
is eaten by ad-blockers and never sees a refund. The Stripe webhook is the
only place money is known for certain, so every invoice.paid (new /
renewal / upgrade), one-off top-up and charge.refunded (negative) is now
mirrored as OpenPanel's native `revenue` event, keyed by the user uuid the
browser and the job events already use.

Each event carries the acquisition channel read back from
signup_attribution (utm_source > referrer host > direct) plus plan,
interval, billing_reason and the Stripe id — so revenue is sliceable by
where the buyer came from. Fire-and-forget: never touches the webhook path.

The dashboard now `identify`s the signed-in user on every boot (OpenPanel
keeps the profile in memory only) and clears it on sign-out, so pageviews
and the server-side events share one profile.

Also fixes GET /api/billing/invoices, which called the non-existent
`database.SessionLocal` and 500'd for every user with a Stripe customer.

Claude-Session: https://claude.ai/code/session_01GPZmS33ubmHxHEc84X7sQy
2026-09-03 14:16:19 +02:00
victormanuel.caverogracia
2876878237 fix(dashboard): refresh the header minute meter after usage
Minutes are reserved when a job starts, not when it finishes. Re-fetch
/api/me on start, complete, fail, quota, bulk subtitles and clip re-render
so the pill in the header moves without a reload.
2026-09-01 14:26:45 +02:00
victormanuel.caverogracia
8a22fa7b9e fix(dashboard): replace cramped tutorial card with a Next tour
The coach chip stacked three step labels on top of each other. Walk Clip
Generator control by control instead, and park the tooltip inside the
viewport on small screens.
2026-09-01 14:11:44 +02:00
victormanuel.caverogracia
016267f204 feat(dashboard): first-login Clip Generator tutorial
New accounts land on Clip Generator with other tools locked. A modal
walks paste → generate → clips and celebrates the first successful job.
2026-09-01 13:55:37 +02:00
victormanuel.caverogracia
b4000ac9bc feat(billing): legal invoices from AgentLedger on the account page
GET /api/billing/invoices lists the AgentLedger-issued Spanish invoices for
the signed-in user's Stripe customer (public View/PDF links), backfilling the
customer's history on demand when AgentLedger has nothing yet. New env:
AGENTLEDGER_API_KEY (+ optional AGENTLEDGER_API_URL / AGENTLEDGER_TREASURY_ID).
InvoicesCard renders under the plan card for accounts with a billing relationship.

Claude-Session: https://claude.ai/code/session_01Chec1RKALL2v8V4GsDfPCW
2026-09-01 12:36:59 +02:00
victormanuel.caverogracia
2b2a58202e fix(dashboard): drop the public gallery link from UGC gallery
The in-app grid already is the gallery; the extra tab to /gallery was redundant.
2026-09-01 10:35:19 +02:00
victormanuel.caverogracia
9d69bea940 fix(dashboard): play UGC gallery clips in a modal
Cards were mounting every mp4 with preload=metadata, so the grid stalled,
and click did nothing except a hidden View link that opened another tab.
Posters only until click; playback stays on the same screen.
2026-09-01 10:27:34 +02:00
juancarlos.cavero
c0da654733 feat(llm): run the moment picker on any OpenAI-compatible server (Ollama, vLLM, LM Studio)
Self-hosters asked for a pipeline that never calls Google. LLM_BASE_URL (+
LLM_MODEL, LLM_API_KEY) routes the transcript scoring and detail passes of
get_viral_clips to a /chat/completions endpoint; the answer is validated with
the same pydantic schemas Gemini enforces server-side, so main.py sees one
shape. json_schema is requested first and the request falls back to
json_object and then to free text when a server rejects the field.

Scoring batches drop from 8 to 3 windows on the local path: Ollama's default
4k context truncates silently and a truncated prompt scores garbage.
Self-host /api/process now accepts a request without X-Gemini-Key when the
backend is configured, /api/config exposes localLlm and the dashboard stops
demanding the key. Frame-based stages (layout picker, on-screen content,
silent videos) stay on Gemini and degrade as before without a key; the
silent-video path says so instead of failing generically.

Verified end to end with Ollama 0.13.5 + qwen2.5:7b on an M1 Pro: a 15-min
talk, 14 windows, 6 clips with usable hooks and titles, six local calls and
zero requests to Google.

Claude-Session: https://claude.ai/code/session_014i9z6mLTy978uRCfSsMfBq
2026-09-01 01:34:48 +02:00
victormanuel.caverogracia
0c65520e2f fix(dashboard): bind Icon in pricing and legal maps
The hosted-vs-self table on #/pricing and the legal docs list rendered
<Icon> without destructuring icon from the row, which crashed the page.
2026-08-31 18:08:08 +02:00
juancarlos.cavero
57e32b9052 fix(legal): narrow the refund promise and say who owes the visible ai disclosure
Two corrections to texts published this morning, both of them cases where what
we wrote was wider than what we meant.

Refunds. The policy now covers the most recent charge only, and only when the
service went unused since it was taken: this is the renewal nobody noticed, not
a free trial with the receipts kept. "Used" is defined as minutes spent, since
that is the thing the system can actually check, and signing in to look around
is called out as not using it.

That change has a consequence section 12 had to follow. The first version said
the commercial policy was more generous than the statutory withdrawal right and
was the one that applied. With a no-usage condition attached that stopped being
true, and a clause claiming to supersede a consumer right while being worse than
it is void and reads badly. Section 12 now says the two do different jobs, and
that the statutory right is the one that helps when minutes were spent, because
it refunds pro rata without requiring the service be untouched. The refund pages
point at it rather than letting anyone lose it.

AI labelling. Section 7 said we "label and mark" dubbed clips, which promised a
visible label we do not burn and do not intend to. Art. 50(2) puts the
machine-readable marking on the provider, which we now do; art. 50(4) puts the
visible disclosure on the deployer, which is the person publishing, and each
platform's AI-content label is the normal way for them to discharge it. The text
now says exactly that, and covers AI-actor videos too, which are marked as well.

Claude-Session: https://claude.ai/code/session_01WyFE2wXi8quZR6nLRRLDgE
2026-08-29 20:58:45 +02:00
juancarlos.cavero
87adf88daa fix(source): stop serving the untouched original without a credential
GET /api/source streams the file we downloaded, not a derived clip, and it was
open on the reasoning that the UUID job id is the capability. That makes the
product a public YouTube downloader wearing a UUID, which is the characterisation
worth avoiding, and one leaked id in a log or a referer opens someone else's
video.

A <video src> cannot carry an Authorization header, which is why it was open in
the first place, so the owner mints a short-lived signed URL from
/api/source-url and hands the player that. The endpoint takes the signature or
falls back to the owner check. Self-host and ownerless BYOK jobs are untouched:
no owner to check, no secret to sign with. The owner lookup is gated on
BILLING_ENABLED because it falls through to a full rescan of the output
directory, which off billing would run on every preview and buy nothing.

Both minters go through _signed_source_url. The EDL feeds ClipEditor's source
monitor the same way and was built as a bare path, which works in self-host and
in every test and 404s in cloud. The regression test asserts the endpoint calls
the minter rather than comparing strings: off billing the helper returns that
same bare path, so a string comparison passes just as happily with the bug in.
Verified by putting the bug back and watching it fail.

The frontend mints at render, not when the session is persisted, or localStorage
would hold a token that expired overnight.

SOURCE_RETENTION_SECONDS can age the retained download out ahead of the clips it
produced, and defaults to the job clock, so nothing changes until someone sets
it. Lowering it is not free: the EDL, rerender, scenes and reframe endpoints all
read that file and answer 409 once it is gone.

Claude-Session: https://claude.ai/code/session_01WyFE2wXi8quZR6nLRRLDgE
2026-08-29 17:19:39 +02:00
juancarlos.cavero
8c91403f22 feat(ai-act): mark dubbed and ai-actor output as machine-readable ai content
Art. 50(2) asks a provider whose system generates synthetic audio or video to
mark the output in a machine-readable way, and the terms already promised we
"label and mark" dubbed clips while nothing did either.

mark_ai_generated stamps the disclosure by stream copy, so it is a remux and
never a re-encode. The tag is `comment` because mp4 keeps only the standard
tags and ffmpeg drops a custom key without warning, which a test pins. It is
best effort by design: a missing tag must not lose someone the video they just
paid minutes for.

Deliberately narrow, on dubbing and AI actors, not on an ordinary clip whose
pixels and audio are the user's own footage. Marking everything would make the
tag mean nothing. TranslateModal says the file is tagged and that the person
publishing it owes their audience the disclosure, which is the art. 50(4) duty
and falls on them, not on us.

Still missing, and a product decision rather than an oversight: the visible
burned-in label.

Claude-Session: https://claude.ai/code/session_01WyFE2wXi8quZR6nLRRLDgE
2026-08-29 17:19:24 +02:00