Commit graph

20 commits

Author SHA1 Message Date
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
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
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
juancarlos.cavero
5459f69ec6 feat(proxy): daily budget cap for the paid proxy, and probe the statics against YouTube
PAID_PROXY_DAILY_MB (default 500): past it, the per-GB proxy is dropped
from the duration probe and from every new job's env until UTC midnight,
with one Telegram note per day. A repeat of 28-aug (statics refused by
YouTube for hours) now costs $0.50 at worst instead of $14.

The watcher probed the statics against google.com/generate_204, which kept
answering 204 that whole day while YouTube served the static IPs fake
'Video unavailable'. A static now has to return a real watch page with a
playable player response; the paid probe keeps the cheap plain-HTTP 204
(HTTPS through DataImpulse breaks in httpx even when healthy).

Claude-Session: https://claude.ai/code/session_014i9z6mLTy978uRCfSsMfBq
2026-09-02 13:25:06 +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
juancarlos.cavero
8c477e090d config(thumbnail): default the title model to gemini-3.7-flash
Same transcript, three models: 3.5-flash 34 s, 3.7-flash 14 s, 3.1-pro 105 s.
3.7 gave the most specific thumbnail hooks (the ones that quote a figure from
the video rather than a stock phrase) at the lowest latency.
2026-08-27 11:03:23 +02:00
juancarlos.cavero
eb6ef13bba feat(thumbnail): concept-driven thumbnails, crisp burned text, face frames from the video, scored titles
Titles: transcript + 10 frames instead of uploading the whole video (an hour
was ~1M tokens), a brainstorm across fixed styles then a critic that scores,
dedupes by angle and pairs each title with a 1-4 word thumbnail hook. Mobile
rules: payoff inside 50 chars, keyword first. Text model moves to
GEMINI_MODEL_THUMBNAIL (default gemini-3.5-flash); flash-lite is the weakest
tier and this is the one creative step.

Thumbnails: a text call designs N different concepts, one image call each in
parallel. Default burns the hook text with PIL (Anton, black stroke) over
negative space the image model is told to leave, so accents are never wrong;
'AI painted' toggle keeps the old behaviour. Outputs cover-cropped to
1280x720 under YouTube's 2 MB. GET /api/thumbnail/frames/{session} picks
frames with a large, sharp face spread across the runtime and the dashboard
offers them as the person reference. Phone-size preview row in the UI.
JSON parsing now uses raw_decode: flash appended a stray ]} once.
2026-08-27 10:57:34 +02:00
victorcavero14
4fcc1cd5ed fix(analytics): make product analytics opt-in and host-scoped
The OpenPanel endpoint and client id were hardcoded in dashboard/index.html, so
every clone, fork and self-hosted deployment inherited them and reported into
the hosted instance's dashboard. src/lib/analytics.js already documents the
intended behaviour ('analytics can never leak into the open-source experience');
this makes that true.

- apiUrl and clientId now come from VITE_OPENPANEL_API_URL /
  VITE_OPENPANEL_CLIENT_ID, substituted by Vite at build time and unset by
  default, so npm run dev and a plain npm run build initialise nothing.
- The third-party script is only fetched once analytics is actually enabled: a
  default build makes no external analytics request at all.
- Reporting is additionally gated on a hostname allowlist, so a dist/ built with
  credentials stays inert if it is served anywhere else.

Verified with a headless browser against real production builds:
  credentials + non-allowlisted host -> no requests
  credentials + allowlisted host     -> initialises and reports
  no credentials + allowlisted host  -> no requests

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-28 09:58:33 +02:00
juancarlos.cavero
719d444139 feat: GPU pipeline — Parakeet ASR backend with whisper fallback + NVENC encoder helper
- transcribe_backends.py: parakeet-tdt-0.6b-v3 (onnx-asr, VAD+timestamps) as
  selectable backend (TRANSCRIBE_BACKEND), token->word reconstruction keeping
  the leading-space convention, absolute timestamps, native floats, language
  detection via py3langid, and automatic whisper fallback (errors, empty
  output, or language outside parakeet's 25).
- whisper singleton + ASR GPU semaphore (model stays resident; GPU decodes
  serialized; CPU path behavior unchanged).
- ffmpeg_utils.py: central encoder args (FFMPEG_ENCODER=x264|nvenc|auto with
  cached probe + fallback); migrated the 9 hardcoded libx264 call sites.
- saasshorts now honors WHISPER_* config instead of hardcoded base/cpu/int8.
- Dockerfile: ARG GPU=1 installs CUDA user-space libs (cuBLAS/cuDNN9) +
  onnx-asr/onnxruntime-gpu; LD_LIBRARY_PATH + NVIDIA_DRIVER_CAPABILITIES.
- Validated on prod GPU (RTX 4000 Ada, driver 580): 94s clip transcribed in
  6.5s, word timestamps within ~0.1s of whisper, fallback path exercised.
2026-07-18 01:38:11 +02:00
juancarlos.cavero
861134f8fe feat: quality gate, output-format selection, whisper small (PR #50)
- 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.
2026-07-17 22:21:46 +02:00
juancarlos.cavero
be3dc665a3 feat(logs): DEBUG_LOGS env to force full pipeline logs under billing
83b0649 hides raw yt-dlp/ffmpeg/debug spew from paid users. In local dev you
run with BILLING_ENABLED to test paid features but still want the debug logs,
so DEBUG_LOGS=true bypasses the filter regardless of billing.
2026-07-17 21:36:21 +02:00
juancarlos.cavero
61954a7f28 fix(auth): OAUTH_REDIRECT_URI override for local login through the Vite proxy
Through the dev proxy the backend sees Host backend:8000, so url_for built
redirect_uri=https://backend:8000/... which Google rejects with 400
invalid_request. Allow pinning the callback via OAUTH_REDIRECT_URI; the
Host-derived behavior is unchanged when the variable is unset (prod).
2026-07-17 21:26:04 +02:00
juancarlos.cavero
86117d3f3e feat: AI Shorts low-cost mode, UGC gallery, universal business support
- Add Low Cost video mode (Hailuo 2.3 + VEED Lipsync ~$0.65) alongside Premium (Kling Avatar v2 ~$2)
- Add UGC video gallery with SEO pages (/gallery, /video/{id}) and JSON-LD structured data
- Make AI Shorts work for any business (URL optional, manual description supported)
- Add shared actor gallery on public S3 with prompt history
- Add custom actor photo upload
- Add Upload-Post social publishing to AI Shorts result step
- Add UGC Gallery tab with Videos + Avatars tabs
- Update landing page with 3-tools-in-1 section (Clip Generator, AI Shorts, YouTube Studio)
- Rename SaaS Shorts to AI Shorts, Dashboard to Clip Generator
- Add vite proxy for /gallery and /video routes
- Add image upload validation
- Remove hardcoded bucket names from code
- Update README with full documentation and screenshot references

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 20:29:23 +01:00
juancarlos.cavero
3946c49ad1 added youtube studio 2026-02-20 01:11:27 +01:00
juancarlos.cavero
d7af56097f delete file 2025-12-19 20:30:39 +01:00
juancarlos.cavero
892383acc3 added generate clips from video with gemini 2025-12-19 16:00:44 +01:00