diff --git a/.env.example b/.env.example index 4f85e3c..1bafa52 100644 --- a/.env.example +++ b/.env.example @@ -1,9 +1,3 @@ -# AWS S3 (optional — for clip backup) -AWS_ACCESS_KEY_ID=your_aws_access_key_here -AWS_SECRET_ACCESS_KEY=your_aws_secret_key_here -AWS_REGION=eu-west-3 -AWS_S3_BUCKET=your-bucket-name - # YouTube cookies (optional — paste Netscape-format cookies to bypass bot detection) # YOUTUBE_COOKIES=... diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f36e492..7ebef5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,22 +8,26 @@ on: jobs: backend-tests: runs-on: ubuntu-latest + # The Forgejo runner cannot provision Python 3.11 via actions/setup-python + # ("Version 3.11 was not found in the local cache"), so the job runs inside + # a python:3.11-slim container instead. + container: python:3.11-slim steps: + # The slim image ships no git; checkout needs it. + - name: Install git + run: apt-get update && apt-get install -y --no-install-recommends git - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.11" # Everything the collected tests import at module level, WITHOUT the # heavy ML stack (torch/ultralytics/mediapipe/faster-whisper) — the # pipeline modules import those lazily behind their feature gates, and # the tests exercise the gated-off paths. numpy+opencv cover the layout - # modules, fastapi/boto3/PyJWT/python-multipart cover importing app.py - # for the MCP endpoint tests, google-genai covers gemini_worker. + # modules, fastapi/python-multipart cover importing app.py for the MCP + # endpoint tests, google-genai covers gemini_worker. - name: Install test dependencies run: > - pip install pytest pillow httpx pydantic sqlalchemy greenlet numpy - opencv-python-headless python-dotenv google-genai fastapi boto3 - PyJWT email-validator python-multipart + pip install pytest pillow httpx pydantic numpy + opencv-python-headless python-dotenv google-genai fastapi + python-multipart - name: Run tests run: pytest tests/ -v diff --git a/.opencode/.gitignore b/.opencode/.gitignore new file mode 100644 index 0000000..47241b6 --- /dev/null +++ b/.opencode/.gitignore @@ -0,0 +1 @@ +images/ diff --git a/CLAUDE.md b/CLAUDE.md index 3e23ccc..43873b8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -41,9 +41,7 @@ uvicorn app:app --host 0.0.0.0 --port 8000 6. **AI Cropping** - Vertical reframing with subject tracking 7. **Effects/Subtitles** - Optional AI-generated FFmpeg filters 8. **Hook Overlay** - Text overlays with styled fonts -9. **Voice Dubbing** - Optional ElevenLabs AI translation (30+ languages) -10. **S3 Backup** - Silent background upload -11. **Social Distribution** - Self-hosted Postiz (clip uploaded, then scheduled or posted) +9. **Social Distribution** - Self-hosted Postiz (clip uploaded, then scheduled or posted) ### Key Files | File | Purpose | @@ -52,11 +50,8 @@ uvicorn app:app --host 0.0.0.0 --port 8000 | `app.py` | FastAPI server with async job queue and REST endpoints | | `editor.py` | Gemini AI integration for dynamic video effects (FFmpeg filter generation) | | `hooks.py` | Hook text overlay generation with font rendering | -| `s3_uploader.py` | AWS S3 upload with caching | -| `subtitles.py` | SRT generation, FFmpeg subtitle burning, and dubbed video transcription | -| `translate.py` | ElevenLabs dubbing API for AI voice translation | +| `subtitles.py` | SRT generation and FFmpeg subtitle burning | | `dashboard/src/App.jsx` | Main React component with state management | -| `dashboard/src/components/TranslateModal.jsx` | Voice dubbing UI with language selection | | `dashboard/vite-plugin-seo.js` | Build-time SEO surface: injects crawler-visible homepage content, emits static pages, sitemap.xml and llms.txt | | `dashboard/seo/data.js` | Single source of truth for pricing, pipeline and competitor facts used by every generated page | @@ -349,11 +344,9 @@ portrait clip cannot reproduce the shrink either. | POST | `/api/process` | Submit video for processing | | GET | `/api/status/{job_id}` | Poll job status and logs | | POST | `/api/edit` | Apply AI video effects | -| POST | `/api/subtitle` | Generate and apply subtitles (auto-transcribes dubbed videos) | +| POST | `/api/subtitle` | Generate and apply subtitles | | POST | `/api/hook` | Add text hook overlays | -| POST | `/api/translate` | AI voice dubbing via ElevenLabs | -| GET | `/api/translate/languages` | List supported dubbing languages | -| POST | `/api/postiz/post` | Upload a clip to Postiz, then schedule or post it now | +| POST | `/api/postiz/post` | Publish one clip to specific Postiz channels (by integration id), scheduled or now | | GET | `/api/postiz/integrations` | List the channels connected in Postiz | | GET | `/api/postiz/scheduled` | List scheduled posts in a date window | | DELETE | `/api/postiz/scheduled/{id}` | Delete a scheduled post | @@ -367,9 +360,16 @@ instance. The dashboard sends the user's `X-Postiz-Key` / `X-Postiz-Url` headers; the backend falls back to the `POSTIZ_API_KEY` / `POSTIZ_URL` env vars. Because the clip file lives on the app server, the backend reads it and uploads the bytes to Postiz (`POST /upload`, multipart), then references the -returned `{id, path}` in `POST /posts`. Provider settings (`tiktok`, -`instagram`, `youtube`) are built server-side from the clip title and caption. -Auth is the raw key, no `Bearer`. +returned `{id, path}` in `POST /posts`. Auth is the raw key, no `Bearer`. + +`POST /api/postiz/post` selects channels by **integration id** +(`integration_ids`, preferred), so several channels of the same network stay +distinct (Postiz lists Instagram as `instagram-standalone`, YouTube once per +channel). The legacy `platforms` list remains a fallback that picks the first +enabled match. Per-post provider settings are keyed by the integration's real +identifier and built server-side from the clip title and caption. The +dashboard's publish modal takes the date as **DD/MM/YYYY** and sends the +resolved instant as ISO. ### Webhooks diff --git a/README.md b/README.md index ed03207..ebddd84 100644 --- a/README.md +++ b/README.md @@ -19,18 +19,17 @@ Clipwright is a fork of [OpenShorts](https://github.com/mutonby/openshorts), ren - **Docker & Docker Compose** - **Google Gemini API key** — [free tier](https://aistudio.google.com/app/apikey) — used for moment detection, layouts, titles and thumbnails. Optional if you set `LLM_BASE_URL`. - **A self-hosted Postiz instance** — optional, only for publishing. -- **ElevenLabs API key** — optional, only for voice dubbing. ## Quick start ```bash git clone https://git.pbento.pt/pedro-bento/clipwright.git cd clipwright -cp .env.example .env # optional: S3 backup, Postiz server-side key +cp .env.example .env # optional: Postiz server-side key docker compose up --build ``` -Open the dashboard at **http://localhost:5175**, go to **Settings**, and paste your keys (Gemini; ElevenLabs and Postiz are optional). Then: +Open the dashboard at **http://localhost:5175**, go to **Settings**, and paste your keys (Gemini; Postiz is optional). Then: 1. **Clip Generator** — upload a long video or paste a URL. 2. **YouTube Studio** — generate titles, thumbnails and descriptions. @@ -47,9 +46,8 @@ Server-side (`.env`): | `POSTIZ_URL` / `POSTIZ_API_KEY` | Your Postiz instance + API key, used when the dashboard does not send them. | | `MAX_CONCURRENT_JOBS` | Concurrent jobs (default 5). | | `MAX_FILE_SIZE_MB` | Upload cap in MB; `0` (default) is unlimited. | -| `AWS_*` | Optional S3 backup for clips. | -Client-side (stored encrypted in your browser): `GEMINI_API_KEY`, `ELEVENLABS_API_KEY`, `postiz_url`, `postiz_key_v1`. +Client-side (stored encrypted in your browser): `GEMINI_API_KEY`, `postiz_url`, `postiz_key_v1`. ### Run without a Google key (optional) @@ -86,6 +84,7 @@ services: 1. Run Postiz yourself and connect TikTok, Instagram and/or YouTube inside it. 2. Create a public API key in Postiz (**Settings → Developers / Public API**). 3. In Clipwright **Settings**, enter your Postiz URL and key, then **Test connection** to list your channels. +4. In the publish modal, tick the exact channel each clip should go to. Multiple channels per network are supported (for example two YouTube channels), so you pick the channel itself, not the platform, and schedule it with a **DD/MM/YYYY** date. Clipwright uploads the clip to your Postiz instance and creates the post there; the platform tokens never leave your infrastructure. diff --git a/app.py b/app.py index c543654..0694359 100644 --- a/app.py +++ b/app.py @@ -26,7 +26,6 @@ from fastapi.responses import FileResponse, JSONResponse from starlette.background import BackgroundTask from pydantic import BaseModel import httpx -from s3_uploader import upload_job_artifacts import recut import layout_ranges import watermarked @@ -79,8 +78,7 @@ CHILD_ENV_DENYLIST = frozenset({ "AGENTLEDGER_API_KEY", "MANAGED_GEMINI_API_KEY", "POSTIZ_API_KEY", "POSTIZ_URL", "R2_ACCESS_KEY_ID", "R2_SECRET_ACCESS_KEY", - "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", - "OPENPANEL_CLIENT_SECRET", "ELEVENLABS_API_KEY", + "OPENPANEL_CLIENT_SECRET", }) @@ -1686,10 +1684,6 @@ async def run_job(job_id, job_data): jobs[job_id]['status'] = 'completed' jobs[job_id]['logs'].append("Process finished successfully.") - # Silent AWS S3 backup (optional; a no-op when S3 is unconfigured). - loop = asyncio.get_event_loop() - loop.run_in_executor(None, upload_job_artifacts, output_dir, job_id) - # Find result JSON json_files = glob.glob(os.path.join(output_dir, "*_metadata.json")) if not json_files: @@ -2547,9 +2541,8 @@ async def download_all_clips(job_id: str, request: Request): from editor import VideoEditor -from subtitles import generate_srt, generate_ass, burn_subtitles, generate_srt_from_video, CAPTION_PRESETS +from subtitles import generate_srt, generate_ass, burn_subtitles, CAPTION_PRESETS from hooks import add_hook_to_video -from translate import translate_video, get_supported_languages from thumbnail import (analyze_video_for_titles, refine_titles, generate_thumbnail, generate_youtube_description, extract_face_frames) @@ -3726,30 +3719,10 @@ async def add_subtitles(req: SubtitleRequest, request: Request): output_path = os.path.join(output_dir, output_filename) # Burning captions is free: the SRT comes from the transcript already - # sitting in metadata.json and the burn is a single short FFmpeg pass. The - # dubbed path is the exception — it runs a fresh Whisper transcription over - # the translated audio, which is real work, but self-host has no quota. - is_dubbed = filename.startswith("translated_") - + # sitting in metadata.json and the burn is a single short FFmpeg pass. try: - # 1. Generate SRT — from the existing transcript, or a fresh - # transcription when the audio was dubbed. - if is_dubbed: - print(f"🎙️ Dubbed video detected, transcribing audio for subtitles...") - def run_transcribe_srt(): - if is_karaoke: - return generate_srt_from_video(input_path, srt_path, style="karaoke", **karaoke_opts) - return generate_srt_from_video(input_path, srt_path) - - loop = asyncio.get_event_loop() - try: - success = await loop.run_in_executor(None, run_transcribe_srt) - finally: - # The ASR models must not stay resident in the API process: - # they held 7.7 GB of VRAM idle (transcribe_backends.release_models). - import transcribe_backends - await loop.run_in_executor(None, transcribe_backends.release_models) - elif is_karaoke: + # 1. Generate SRT from the existing transcript. + if is_karaoke: success = generate_ass(sub_transcript, sub_start, sub_end, srt_path, **karaoke_opts) else: success = generate_srt(sub_transcript, sub_start, sub_end, srt_path, @@ -4001,129 +3974,26 @@ async def add_hook(req: HookRequest, request: Request): "burned_hook": None if req.remove else clip_data['auto_hook'], } -class TranslateRequest(BaseModel): - job_id: str - clip_index: int - target_language: str - source_language: Optional[str] = None - input_filename: Optional[str] = None - -@app.get("/api/translate/languages") -async def get_languages(): - """Return supported languages for translation.""" - return {"languages": get_supported_languages()} - -@app.post("/api/translate") -async def translate_clip( - req: TranslateRequest, - request: Request, - x_elevenlabs_key: Optional[str] = Header(None, alias="X-ElevenLabs-Key") -): - """Translate a video clip to a different language using ElevenLabs dubbing.""" - if not x_elevenlabs_key: - raise HTTPException(status_code=400, detail="Missing X-ElevenLabs-Key header") - - if req.job_id not in jobs: - raise HTTPException(status_code=404, detail="Job not found") - - job = jobs[req.job_id] - await _assert_job_owner(request, job) - output_dir = os.path.join(OUTPUT_DIR, req.job_id) - json_files = glob.glob(os.path.join(output_dir, "*_metadata.json")) - - if not json_files: - raise HTTPException(status_code=404, detail="Metadata not found") - - with open(json_files[0], 'r') as f: - data = json.load(f) - - clips = data.get('shorts', []) - if req.clip_index >= len(clips): - raise HTTPException(status_code=404, detail="Clip not found") - - clip_data = clips[req.clip_index] - - # Video Path - if req.input_filename: - filename = os.path.basename(req.input_filename) - else: - filename = clip_data.get('video_url', '').split('/')[-1] - if not filename: - base_name = os.path.basename(json_files[0]).replace('_metadata.json', '') - filename = f"{base_name}_clip_{req.clip_index+1}.mp4" - - input_path = os.path.join(output_dir, filename) - if not os.path.exists(input_path): - raise HTTPException(status_code=404, detail=f"Video file not found: {input_path}") - - # Output video with language suffix - base, ext = os.path.splitext(filename) - output_filename = f"translated_{req.target_language}_{base}{ext}" - output_path = os.path.join(output_dir, output_filename) - - try: - # Run translation in thread pool (blocking API calls) - def run_translate(): - return translate_video( - video_path=input_path, - output_path=output_path, - target_language=req.target_language, - api_key=x_elevenlabs_key, - source_language=req.source_language, - ) - - loop = asyncio.get_event_loop() - await loop.run_in_executor(None, run_translate) - - except Exception as e: - print(f"❌ Translation Error: {e}") - raise HTTPException(status_code=500, detail=str(e)) - - # AI Act art. 50(2): the voice in this file was synthesised, so the file - # says so in a way a machine can read. Best-effort by design — see - # ffmpeg_utils.mark_ai_generated. - from ffmpeg_utils import mark_ai_generated - await loop.run_in_executor( - None, lambda: mark_ai_generated(output_path, "AI voice dubbing")) - - output_filename = await _deliver(request, req.job_id, output_filename) - - # Update InMemory Jobs - if req.clip_index < len(job['result']['clips']): - job['result']['clips'][req.clip_index]['video_url'] = f"/videos/{req.job_id}/{output_filename}" - - # Update Metadata on Disk - try: - if req.clip_index < len(clips): - clips[req.clip_index]['video_url'] = f"/videos/{req.job_id}/{output_filename}" - data['shorts'] = clips - with open(json_files[0], 'w') as f: - json.dump(data, f, indent=4) - print(f"✅ Metadata updated with translated video for clip {req.clip_index}") - except Exception as e: - print(f"⚠️ Failed to update metadata.json: {e}") - - - return { - "success": True, - "new_video_url": f"/videos/{req.job_id}/{output_filename}" - } - class PostizPostRequest(BaseModel): job_id: str clip_index: int - platforms: List[str] # ["tiktok", "instagram", "youtube"] + integration_ids: List[str] = [] # preferred: exact Postiz integration ids + platforms: List[str] = [] # legacy fallback: platform names (first enabled match) title: Optional[str] = None description: Optional[str] = None scheduled_date: Optional[str] = None # ISO-8601 timezone: Optional[str] = "UTC" -def _postiz_iso_date(scheduled_date: Optional[str], tz_name: Optional[str]) -> str: - """Postiz wants an ISO-8601 instant (with millis). Convert the client's - scheduled_date + IANA timezone to UTC; default to now when unscheduled.""" +def _postiz_parse_instant(scheduled_date: Optional[str], + tz_name: Optional[str]) -> datetime: + """Parse a client-supplied scheduled date into an aware UTC datetime. + + ``scheduled_date`` may carry a timezone (ISO-8601 ``Z``/offset); when it is + naive, ``tz_name`` (IANA) supplies the zone. Defaults to "now" when absent. + """ if not scheduled_date: - return datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S.000Z") + return datetime.now(timezone.utc) value = scheduled_date.strip().replace("Z", "+00:00") try: parsed = datetime.fromisoformat(value) @@ -4137,7 +4007,14 @@ def _postiz_iso_date(scheduled_date: Optional[str], tz_name: Optional[str]) -> s parsed = parsed.replace(tzinfo=ZoneInfo(tz_name or "UTC")) except Exception: parsed = parsed.replace(tzinfo=timezone.utc) - return parsed.astimezone(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S.000Z") + return parsed.astimezone(timezone.utc) + + +def _postiz_iso_date(scheduled_date: Optional[str], tz_name: Optional[str]) -> str: + """Postiz wants an ISO-8601 instant (with millis). Convert the client's + scheduled_date + IANA timezone to UTC; default to now when unscheduled.""" + return _postiz_parse_instant( + scheduled_date, tz_name).strftime("%Y-%m-%dT%H:%M:%S.000Z") def _postiz_hashtags(text: str) -> List[str]: @@ -4148,11 +4025,37 @@ def _postiz_hashtags(text: str) -> List[str]: return tags[:5] -def _postiz_settings(platform: str, title: str, caption: str, tags: List[str]) -> dict: - """Per-provider settings block (see /tmp/opencode/cleanup/postiz-api.md).""" +# Postiz lists Instagram as ``instagram-standalone`` and TikTok as +# ``tiktok-business``; duplicate YouTube channels all share the identifier +# ``youtube``. The identifier is what Postiz routes on, so it is preserved for +# ``settings.__type``; the map below only groups channels for UI/platform use. +_IDENTIFIER_PLATFORM = { + "instagram": "instagram", + "instagram-standalone": "instagram", + "tiktok": "tiktok", + "tiktok-business": "tiktok", + "youtube": "youtube", +} + + +def _identifier_platform(identifier: Optional[str]) -> str: + """Map a raw Postiz identifier to a platform label (unknown -> itself).""" + ident = (identifier or "").strip().lower() + return _IDENTIFIER_PLATFORM.get(ident, ident) + + +def _postiz_settings(identifier: str, title: str, caption: str, tags: List[str]) -> dict: + """Per-provider settings block (see /tmp/opencode/cleanup/postiz-api.md). + + ``settings.__type`` MUST echo the integration's real identifier (e.g. + ``instagram-standalone``); sending the mapped platform makes Postiz route + the post to the wrong provider. + """ + identifier = (identifier or "").strip().lower() + platform = _identifier_platform(identifier) if platform == "tiktok": return { - "__type": "tiktok", + "__type": identifier, "content_posting_method": "DIRECT_POST", "title": (caption or title or "")[:90], "privacy_level": "PUBLIC_TO_EVERYONE", @@ -4165,39 +4068,88 @@ def _postiz_settings(platform: str, title: str, caption: str, tags: List[str]) - "video_made_with_ai": False, } if platform == "instagram": - return {"__type": "instagram", "post_type": "post"} + return {"__type": identifier, "post_type": "post"} if platform == "youtube": yt_title = (title or caption or "Short").strip()[:100] if len(yt_title) < 2: yt_title = (yt_title + " ")[:100] return { - "__type": "youtube", + "__type": identifier, "title": yt_title, "type": "public", "selfDeclaredMadeForKids": "no", "tags": [{"value": t, "label": t} for t in (tags or [])], } - return {"__type": platform} + return {"__type": identifier} -async def _postiz_integrations(base, key): - """Connected channels, keyed by identifier (tiktok/instagram/youtube). +async def _postiz_integration_list(base, key) -> List[dict]: + """The RAW Postiz integration list, with ``disabled`` normalised to bool. - Every integration is kept (disabled included) so the UI can still list it. - Each entry carries a normalised boolean ``disabled`` flag so callers can - refuse to post to a switched-off channel instead of posting into the void. + Deliberately un-keyed: YouTube can appear several times (one per channel) + and every integration must stay individually selectable by id. """ integrations = await asyncio.to_thread(postiz.list_integrations, base, key) - by_identifier: Dict[str, dict] = {} + entries: List[dict] = [] for integration in integrations or []: if not isinstance(integration, dict): continue - identifier = (integration.get("identifier") or "").strip().lower() - if identifier and identifier not in by_identifier: - entry = dict(integration) - entry["disabled"] = bool(integration.get("disabled")) - by_identifier[identifier] = entry - return by_identifier + entry = dict(integration) + entry["disabled"] = bool(integration.get("disabled")) + entries.append(entry) + return entries + + +def _resolve_postiz_integrations(integrations, integration_ids, platforms): + """Pick the integrations a publish request targets. + + Prefers explicit ``integration_ids`` (validated to exist and be enabled). + Falls back to ``platforms`` for old clients: the first enabled integration + whose mapped platform matches. Raises 400 naming whatever failed. + """ + by_id = {str(i.get("id")): i for i in integrations if i.get("id") is not None} + + if integration_ids: + selected: List[dict] = [] + seen = set() + for raw_id in integration_ids: + iid = str(raw_id).strip() + if not iid or iid in seen: + continue + integration = by_id.get(iid) + if integration is None: + raise HTTPException( + status_code=400, + detail=f"Unknown Postiz integration id: {iid}") + if integration.get("disabled"): + raise HTTPException( + status_code=400, + detail=(f"Disabled in Postiz: " + f"{integration.get('name') or iid}")) + seen.add(iid) + selected.append(integration) + return selected + + selected = [] + for raw_platform in platforms: + platform = str(raw_platform).strip().lower() + if not platform: + continue + candidates = [ + i for i in integrations + if _identifier_platform(i.get("identifier")) == platform + ] + if not candidates: + raise HTTPException( + status_code=400, + detail=f"Not connected in Postiz: {platform}") + enabled = [i for i in candidates if not i.get("disabled")] + if not enabled: + raise HTTPException( + status_code=400, + detail=f"Disabled in Postiz: {platform}") + selected.append(enabled[0]) + return selected def _normalise_postiz_post(post: Any) -> Any: @@ -4246,9 +4198,10 @@ async def postiz_post(req: PostizPostRequest, request: Request): if not os.path.exists(file_path): raise HTTPException(status_code=404, detail=f"Video file not found: {file_path}") + integration_ids = [str(i).strip() for i in (req.integration_ids or []) if str(i).strip()] platforms = [str(p).strip().lower() for p in (req.platforms or []) if str(p).strip()] - if not platforms: - raise HTTPException(status_code=400, detail="No platforms requested") + if not integration_ids and not platforms: + raise HTTPException(status_code=400, detail="No channels requested") caption = (req.description or clip.get('video_description_for_instagram') @@ -4259,42 +4212,64 @@ async def postiz_post(req: PostizPostRequest, request: Request): tags = _postiz_hashtags(caption) try: - by_identifier = await _postiz_integrations(base, key) - missing = [p for p in platforms if p not in by_identifier] - if missing: - raise HTTPException( - status_code=400, - detail=f"Not connected in Postiz: {', '.join(missing)}") - disabled = [p for p in platforms if by_identifier[p].get("disabled")] - if disabled: - raise HTTPException( - status_code=400, - detail=f"Disabled in Postiz: {', '.join(disabled)}") + # Resolve the real channels first so a bad id/platform is a 400 before + # the slow media upload starts. + integrations = await _postiz_integration_list(base, key) + selected = _resolve_postiz_integrations( + integrations, integration_ids, platforms) + if not selected: + raise HTTPException(status_code=400, detail="No channels requested") + + if req.scheduled_date: + scheduled_at = _postiz_parse_instant(req.scheduled_date, req.timezone) + # Allow a minute of clock skew between this server and the client. + if scheduled_at < datetime.now(timezone.utc) - timedelta(seconds=60): + raise HTTPException( + status_code=400, + detail="scheduled_date is in the past") + post_type = "schedule" + post_date = scheduled_at.strftime("%Y-%m-%dT%H:%M:%S.000Z") + else: + post_type = "now" + post_date = _postiz_iso_date(None, None) + media = await asyncio.to_thread(postiz.upload_media, base, key, file_path) if not media or not media.get("id"): raise HTTPException(status_code=502, detail="Postiz media upload failed") posts = [] - for platform in platforms: - integration = by_identifier[platform] + posted = [] + for integration in selected: + identifier = (integration.get("identifier") or "").strip().lower() + platform = _identifier_platform(identifier) posts.append({ "integration": {"id": integration.get("id")}, "value": [{ "content": caption, "image": [{"id": media.get("id"), "path": media.get("path")}], }], - "settings": _postiz_settings(platform, yt_title, caption, tags), + "settings": _postiz_settings(identifier, yt_title, caption, tags), + }) + posted.append({ + "integration_id": integration.get("id"), + "identifier": identifier, + "platform": platform, + "name": integration.get("name"), }) payload = { - "type": "schedule" if req.scheduled_date else "now", + "type": post_type, "shortLink": False, - "date": _postiz_iso_date(req.scheduled_date, req.timezone), + "date": post_date, "tags": [], "posts": posts, } + # The payload carries no secrets; log it so a "nothing showed up in + # Postiz" report is diagnosable from the server log. + print(f"📡 Postiz create_post ({post_type}, {len(posts)} post(s)): " + f"{json.dumps(payload)[:2000]}") result = await asyncio.to_thread(postiz.create_post, base, key, payload) - return {"success": True, "results": result} + return {"success": True, "results": result, "posted": posted} except HTTPException: raise except postiz.PostizError as exc: @@ -4309,8 +4284,8 @@ async def postiz_integrations(request: Request): if not key: raise HTTPException(status_code=400, detail="Missing X-Postiz-Key header") try: - integrations = await asyncio.to_thread(postiz.list_integrations, base, key) - return {"integrations": integrations or []} + integrations = await _postiz_integration_list(base, key) + return {"integrations": integrations} except postiz.PostizError as exc: raise postiz_http_error(exc) @@ -4849,12 +4824,9 @@ async def thumbnail_publish( async def do_upload(): """Uploads the local video to Postiz and creates the YouTube post.""" try: - by_identifier = await _postiz_integrations(base, key) - integration = by_identifier.get("youtube") - if not integration: - raise postiz.PostizError(400, "No YouTube channel connected in Postiz") - if integration.get("disabled"): - raise postiz.PostizError(400, "YouTube channel is disabled in Postiz") + integrations = await _postiz_integration_list(base, key) + selected = _resolve_postiz_integrations(integrations, [], ["youtube"]) + integration = selected[0] media = await asyncio.to_thread( postiz.upload_media, base, key, video_path, 600.0) @@ -4873,7 +4845,8 @@ async def thumbnail_publish( "image": [{"id": media.get("id"), "path": media.get("path")}], }], "settings": _postiz_settings( - "youtube", title, description, _postiz_hashtags(description)), + integration.get("identifier") or "youtube", + title, description, _postiz_hashtags(description)), }], } diff --git a/dashboard/index.html b/dashboard/index.html index 14b6be3..34cc8d5 100644 --- a/dashboard/index.html +++ b/dashboard/index.html @@ -102,7 +102,6 @@ "AI viral moment detection with Google Gemini 3.1 Flash-Lite", "Smart 9:16 vertical cropping with MediaPipe face tracking and YOLOv8 fallback", "Automatic subtitle generation with word-level timestamps", - "AI voice dubbing in 30+ languages via ElevenLabs", "Local video file upload and YouTube link ingest", "Hook text overlays with styled fonts", "AI-generated video effects via FFmpeg", @@ -162,15 +161,15 @@ "name": "Is there a free alternative to Opus Clip?", "acceptedAnswer": { "@type": "Answer", - "text": "Yes. Clipwright self-hosted is a free and open source alternative to Opus Clip, MIT licensed, with no watermark and no usage cap, running on your own machine via Docker. As of July 2026 Opus Clip costs $15 per month for the Starter plan with 150 minutes, and $29 per month for Pro with 300 minutes, on top of a watermarked free tier of 60 minutes. Opus Clip bills one credit per minute of source video imported rather than per clip exported. Clipwright offers comparable AI moment detection using Google Gemini, face-tracked vertical cropping and automatic subtitles, and adds AI voice dubbing into 30+ languages, which Opus Clip does not have. Opus Clip ships a larger caption-style library and needs no setup." + "text": "Yes. Clipwright self-hosted is a free and open source alternative to Opus Clip, MIT licensed, with no watermark and no usage cap, running on your own machine via Docker. As of July 2026 Opus Clip costs $15 per month for the Starter plan with 150 minutes, and $29 per month for Pro with 300 minutes, on top of a watermarked free tier of 60 minutes. Opus Clip bills one credit per minute of source video imported rather than per clip exported. Clipwright offers comparable AI moment detection using Google Gemini, face-tracked vertical cropping and automatic subtitles. Opus Clip ships a larger caption-style library and needs no setup." } }, { "@type": "Question", - "name": "Can Clipwright add subtitles and translate videos?", + "name": "Can Clipwright add subtitles to videos?", "acceptedAnswer": { "@type": "Answer", - "text": "Yes. Subtitles are generated with faster-whisper at word-level timestamps and burned into the video with FFmpeg. For translation, ElevenLabs AI dubbing translates the audio into more than 30 languages while preserving the original speaker's voice characteristics, and the dubbed audio is then automatically re-transcribed so the burned-in subtitles are in the target language rather than the original." + "text": "Yes. Subtitles are generated with faster-whisper at word-level timestamps and burned into the video with FFmpeg, all locally on your own machine." } }, { diff --git a/dashboard/src/App.jsx b/dashboard/src/App.jsx index 4c5bcbf..e2b79b6 100644 --- a/dashboard/src/App.jsx +++ b/dashboard/src/App.jsx @@ -1,5 +1,5 @@ import React, { useState, useEffect, useRef, useMemo } from 'react'; -import { Youtube, Instagram, Share2, ChevronDown, Check, Activity, LayoutDashboard, Settings, Plus, X, Terminal, Shield, Image, Globe, RotateCcw, AlertTriangle, KeyRound, ExternalLink, Mail, Loader2, Download, Menu, Lock } from 'lucide-react'; +import { Youtube, Instagram, Share2, ChevronDown, Check, Activity, LayoutDashboard, Settings, Plus, X, Terminal, Shield, Image, RotateCcw, AlertTriangle, KeyRound, ExternalLink, Mail, Loader2, Download, Menu, Lock } from 'lucide-react'; import KeyInput from './components/KeyInput'; import MediaInput from './components/MediaInput'; import ResultCard from './components/ResultCard'; @@ -216,15 +216,6 @@ function App() { }); // Connected channels from GET /api/postiz/integrations. const [postizChannels, setPostizChannels] = useState([]); - // True once an integrations fetch has completed (success or failure), so the - // publish dialog can tell "no channels" apart from "not loaded yet". - const [postizLoaded, setPostizLoaded] = useState(false); - // ElevenLabs API State - Load encrypted - const [elevenLabsKey, setElevenLabsKey] = useState(() => { - const stored = localStorage.getItem('elevenLabsKey_v1'); - if (stored) return decrypt(stored); - return ''; - }); // Post-generation social nudge: shown at the results peak until the user // either connects a network or dismisses it. Only 2.7% of cloud users who @@ -282,9 +273,6 @@ function App() { const [editingClip, setEditingClip] = useState(null); const [reframingClip, setReframingClip] = useState(null); - // Silent-success "saved" states for the settings key inputs (design.md: no alert popups) - const [elevenLabsSaved, setElevenLabsSaved] = useState(false); - // Sync state for original video playback const [syncedTime, setSyncedTime] = useState(0); const [isSyncedPlaying, setIsSyncedPlaying] = useState(false); @@ -463,12 +451,6 @@ function App() { } catch (_) { /* ignore */ } }, [postizUrl]); - useEffect(() => { - if (elevenLabsKey) { - localStorage.setItem('elevenLabsKey_v1', encrypt(elevenLabsKey)); - } - }, [elevenLabsKey]); - useEffect(() => { if (postizKey && postizUrl && postizChannels.length === 0) { fetchPostizChannels({ silent: true }); @@ -528,12 +510,10 @@ function App() { const data = await res.json(); const channels = Array.isArray(data) ? data : (data.integrations || []); setPostizChannels(channels); - setPostizLoaded(true); if (channels.length === 0 && !silent) { alert('No channels are connected in Postiz yet.'); } } catch (e) { - setPostizLoaded(true); if (!silent) alert('Could not reach Postiz. Check the base URL and API key.'); console.error(e); } @@ -790,17 +770,10 @@ function App() { }; const tabLocked = (id) => tutorialLock && id !== 'dashboard'; - // Shared footer links (landing, repo, pricing, contact) — same list in the - // desktop rail and the mobile drawer, so they can never drift apart. + // Shared footer links (repo, contact) — same list in the desktop rail and the + // mobile drawer, so they can never drift apart. const NavFooterLinks = ({ collapsed = false }) => ( <> - - - landing page - (
- +
Logo
clipwright -
+
- -
-
-
-
- -
-

Video Translation

-
- BYOK -
-

- Translate and dub your clips into other languages with ElevenLabs - (billed by ElevenLabs). Bring your own key. -

-
- -
- setElevenLabsKey(e.target.value)} - className="input-field" - placeholder="sk_..." - /> - -
-
- Get your API key from ElevenLabs to enable video translation. -
- - 1. Sign Up - Create account - - - 2. API Key - Generate key - -
-
- - Keys are only stored in your browser. They are sent to the backend only to process your request, never stored server-side. - -
-
-
)} @@ -1456,8 +1372,6 @@ function App() { postizKey={postizKey} postizUrl={postizUrl} geminiApiKey={apiKey} - elevenLabsKey={elevenLabsKey} - connectedPlatforms={postizLoaded ? connectedSocials : null} onConnectSocials={handleConnectSocials} onPlay={(time) => handleClipPlay(time)} onPause={handleClipPause} diff --git a/dashboard/src/Landing.jsx b/dashboard/src/Landing.jsx deleted file mode 100644 index 9b27468..0000000 --- a/dashboard/src/Landing.jsx +++ /dev/null @@ -1,742 +0,0 @@ -import React from 'react'; -import { Sparkles, Zap, Globe, FileVideo, Subtitles, Youtube, Instagram, Shield, Github, ArrowRight, Check, ChevronDown, Monitor, Cpu, Languages, Type, Upload, Scissors, Link2 } from 'lucide-react'; -import './landing.css'; - -// 64 deterministic tick heights: gaussian envelope × sine wave (no randomness) -const METER_TICKS = Array.from({ length: 64 }, (_, i) => { - const t = i / 63; - const envelope = Math.exp(-((t - 0.5) ** 2) / (2 * 0.18 * 0.18)); - const wave = 0.55 + 0.45 * Math.sin(i * 1.7); - return Math.round((4 + 24 * envelope * wave) * 10) / 10; -}); - -const APPARATUS_CALLOUTS = ['RATIO · 9:16', 'CLIPS · 3–15', 'DUB · 30+ LANGS', 'SUBS · WORD-LEVEL']; - -const SectionHeader = ({ eyebrow, title, children }) => ( -
-

{eyebrow}

-

{title}

- {children &&

{children}

} -
-); - -const FeatureCard = ({ icon, title, description }) => { - const Icon = icon; - return ( -
-
- -
-

{title}

-

{description}

-
- ); -}; - -const StepCard = ({ number, title, description }) => ( -
- - {String(number).padStart(2, '0')} - -
-

{title}

-

{description}

-
-
-); - -const ComparisonRow = ({ feature, clipwright, opusclip, kapwing }) => ( - - {feature} - {clipwright} - {opusclip} - {kapwing} - -); - -const FAQItem = ({ question, answer, isOpen, onClick }) => ( -
- - {isOpen && ( -
-

{answer}

-
- )} -
-); - -export default function Landing({ onLaunchApp }) { - const [openFaq, setOpenFaq] = React.useState(null); - const [heroUrl, setHeroUrl] = React.useState(''); - - // Hand the pasted link to the app: MediaInput picks it up on mount, so the - // user lands with their own video ready instead of an empty state. - const handleHeroSubmit = (e) => { - e.preventDefault(); - const url = heroUrl.trim(); - if (url) { - try { localStorage.setItem('cw_pending_url', url); } catch { /* ignore */ } - } - onLaunchApp(); - }; - - const features = [ - { - icon: Sparkles, - title: "AI Viral Moment Detection", - description: "Google Gemini 3.1 Flash-Lite scores your transcript and scenes to find the 3-15 most engaging moments. Automatic AI clipping, no manual scrubbing." - }, - { - icon: Scissors, - title: "Smart 9:16 Vertical Cropping", - description: "Dual-mode AI reframing with MediaPipe face tracking and YOLOv8 fallback." - }, - { - icon: Subtitles, - title: "Automatic Subtitle Generation", - description: "faster-whisper subtitles with word-level timestamps, styled and burned into your clips." - }, - { - icon: Languages, - title: "AI Voice Dubbing in 30+ Languages", - description: "ElevenLabs AI dubbing translates your audio while preserving the speaker's voice." - }, - { - icon: Type, - title: "Hook Text Overlays", - description: "AI-generated hook titles that capture viewers in the first 3 seconds." - }, - { - icon: Zap, - title: "AI Video Effects", - description: "Gemini-generated FFmpeg filters: color grading, transitions, visual enhancements." - }, - { - icon: Upload, - title: "Local Video Upload", - description: "Upload podcasts, webinars, livestreams, and vlogs at full resolution." - }, - { - icon: Shield, - title: "100% Self-Hosted & Private", - description: "Run it with Docker on your own machine — videos never leave your infrastructure." - }, - { - icon: Monitor, - title: "Free AI YouTube Studio", - description: "Free AI thumbnail generator, 10 viral title suggestions, and auto descriptions with chapters." - }, - { - icon: Globe, - title: "Postiz Publishing", - description: "Publish to TikTok, Instagram Reels, and YouTube Shorts through a self-hosted Postiz instance." - } - ]; - - const steps = [ - { title: "Upload a Long-Form Video", description: "Drop any video file you own — podcasts, webinars, livestreams, interviews." }, - { title: "AI Detects the Best Viral Moments", description: "Google Gemini 3.1 Flash-Lite finds 3-15 high-potential clips of 15-60 seconds." }, - { title: "Smart Cropping to Vertical 9:16", description: "AI reframes to vertical with face tracking — subjects stay centered." }, - { title: "Add Subtitles, Hooks & Effects", description: "Auto subtitles, hook overlays, AI effects — optionally dub into 30+ languages." }, - { title: "Download or Post to Social Media", description: "Export your clips or publish to TikTok, Instagram Reels, and YouTube Shorts through Postiz." } - ]; - - const faqs = [ - { - question: "Is Clipwright really free? What's the catch?", - answer: "There is no catch. Clipwright is 100% free and open source under MIT: you run it with Docker on your own machine, bring your own API keys, and there are no watermarks, no usage limits and no subscription. There is no hosted edition and no paid plan. What it costs you is hardware and time. On a typical CPU an 8-minute video takes 5 to 8 minutes to process, and you need your own Google Gemini key (required, free tier is 1,500 requests/day), plus ElevenLabs for dubbing if you want it. So: free if you are happy to run it yourself, and always will be. That is far cheaper than Opus Clip ($15-228/month) or Kapwing ($24-79/month)." - }, - { - question: "What is Clipwright and how does it work?", - answer: "Clipwright is a free, open source AI clip generator that transforms your long-form videos — podcasts, webinars, livestreams, vlogs, interviews — into viral-ready short clips in 9:16 vertical format. It uses a multi-step AI pipeline: faster-whisper for transcription with word-level timestamps, PySceneDetect for scene boundary detection, and Google Gemini 3.1 Flash-Lite AI for identifying the most engaging viral moments. According to HubSpot's 2025 State of Marketing report, short-form video delivers the highest ROI of any content format, and repurposing long-form content into shorts increases total reach by up to 300%." - }, - { - question: "How does Clipwright compare to Opus Clip?", - answer: "Clipwright is a free, self-hosted alternative to Opus Clip. Both offer AI viral moment detection and smart vertical cropping. Key differences: Clipwright is completely free vs Opus Clip's $15-228/month pricing. Clipwright runs on your infrastructure (full data privacy) vs cloud-only. Clipwright uses Google Gemini 3.1 Flash-Lite for AI analysis vs Opus Clip's proprietary model. Clipwright adds AI voice dubbing in 30+ languages, AI-generated video effects, and hook text overlays. The trade-off is that Clipwright requires Docker self-hosting, while Opus Clip is a ready-to-use cloud service." - }, - { - question: "How do I turn a long-form video into TikTok or Reels clips?", - answer: "Upload your long-form video into Clipwright, enter your free Gemini API key, and click Process. The AI transcribes it with faster-whisper, detects the best viral moments using Google Gemini 3.1 Flash-Lite, and crops them to 9:16 vertical format with MediaPipe face tracking. According to Wyzowl's 2025 Video Marketing Statistics report, 91% of businesses use video as a marketing tool, and repurposed short-form clips drive 2.5x more engagement than original content." - }, - { - question: "Can Clipwright generate YouTube thumbnails and titles for free?", - answer: "Yes. Clipwright includes a free AI YouTube thumbnail generator, a free AI YouTube title generator, and a free AI YouTube description generator — all powered by Google Gemini 3.1 Flash-Lite. Upload your video and the AI suggests 10 viral title options with an interactive refinement chat. Then it generates multiple thumbnail designs using AI image generation — upload a face photo and background image for personalized results. The studio also auto-generates YouTube descriptions with chapter timestamps and lets you publish directly to YouTube. Everything is 100% free with the Gemini free tier." - }, - { - question: "What AI does Clipwright use for viral moment detection?", - answer: "Clipwright uses Google Gemini 3.1 Flash-Lite, Google's latest multimodal AI model, for viral moment detection and title generation. The AI receives the full video transcript with timestamps, scene boundary data from PySceneDetect, and analyzes engagement patterns to identify the 3-15 most shareable moments. Each clip is scored based on emotional impact, hook strength, and viral potential — similar to how platforms like TikTok and YouTube rank content." - }, - { - question: "Can Clipwright translate and dub videos into other languages?", - answer: "Yes. Clipwright integrates with ElevenLabs AI dubbing to translate your video audio into over 30 languages while preserving the original speaker's voice characteristics. After dubbing, the system automatically re-transcribes the new audio and generates subtitles in the target language. This makes it easy to repurpose content for global audiences — studies show that dubbed content receives 2-3x more engagement in non-English markets." - }, - { - question: "How does the smart vertical cropping work?", - answer: "Clipwright offers two intelligent cropping modes for converting 16:9 horizontal video to 9:16 vertical format. TRACK mode uses MediaPipe face detection with YOLOv8 as fallback to follow a single subject with 'Heavy Tripod' stabilization — the camera moves smoothly like a professional cameraman. GENERAL mode handles group shots and landscapes by creating a blurred background layout. A SpeakerTracker prevents rapid switching between subjects and handles temporary occlusions for smooth results." - }, - { - question: "Is there a free open source clip generator?", - answer: "Yes — Clipwright is a 100% free, open source clip generator (also known as open source clipping software or an AI video clipper). Unlike paid clip generators like Opus Clip ($15-228/month) or Kapwing ($24-79/month), Clipwright lets you generate unlimited clips with no watermarks, no usage limits, and no subscription fees. It also includes a free AI YouTube thumbnail generator, free AI YouTube title generator, and free AI YouTube description generator — features that other clip generators charge extra for. You self-host it with Docker on your own machine for full privacy and control." - }, - { - question: "Can I automate Clipwright?", - answer: "Yes. Clipwright exposes a REST API with per-user keys and completion webhooks, so a script or workflow can submit a video URL, wait for processing, and list the clips. Those clips publish to TikTok, Instagram or YouTube through a self-hosted Postiz instance. There is also an importable n8n workflow. Full guide at /automate-shorts-api." - }, - { - question: "What are the system requirements to run Clipwright?", - answer: "Clipwright runs on any system with Docker installed. The recommended setup is 8GB+ RAM and a modern multi-core CPU. GPU acceleration (NVIDIA CUDA) is optional but speeds up video processing significantly. The Docker Compose setup handles all dependencies automatically — Python 3.11, FFmpeg, YOLOv8, MediaPipe, faster-whisper, and the React dashboard. It works on Linux, macOS, and Windows (via WSL2/Docker Desktop)." - } - ]; - - const checkIcon = ; - const checkMuted = ; - const xIcon = Paid; - - return ( -
- {/* Navigation — N9 edge-aligned minimal */} - - - {/* Hero — Marquee Hero: blueprint grid, content left, apparatus right */} -
-
-
-

00 · AI Clip Generator · Self-Hosted

- -

- the free open source ai clip generator, built to clip what people actually watch. -

- -

- turn long videos into viral 9:16 shorts — self-hosted with docker, free under mit. - publish to tiktok, instagram reels and youtube shorts through a self-hosted{' '} - postiz{' '} - instance, or wire the rest api into your own pipeline with the{' '} - n8n workflow. - just want it free? start with the{' '} - free ai clip generator. -

- - {/* The hero CTA is the product itself: paste a link and land in the - app with it loaded. There is no account to create first. */} -
-
-
- - setHeroUrl(e.target.value)} - placeholder="paste a video link" - className="input-field pl-11" - aria-label="Video link" - /> -
- -
-
- - {/* Trust line right under the CTA: the software is free, so the - only real trade is hardware and setup time. */} -
- - mit licensed · free forever - - no watermark · no usage cap · no account - -
- -

- self-host it with docker and bring your own keys.{' '} - - self-host free on github → - -

-
- - {/* Apparatus — instrument bezel holding a real 9:16 clip */} -
-
-
- -
-
-
- - {/* Meter strip */} - - - {/* Stats — three-stat row */} -
-
-
-
3–15
-
Clips per Video
-
-
-
30+
-
Dubbing Languages
-
-
-
100%
-
Open Source
-
-
-
- - {/* Smart crop — real product output: 16:9 source to 9:16 result */} -
-
- - Real output: AI face tracking reframes 16:9 to vertical 9:16 — no manual positioning. - -
-
-
- -
-
-
-
-
- - {/* One product, two self-host paths: Docker image or from source. */} -
-
- - One self-hosted product, free and open source under MIT — there is no hosted edition and no paid plan. - -
-
-
- -

docker — one command

- Recommended · Free · MIT -
-
    - {['docker compose up starts the whole stack', 'Runs on your machine or your own server', 'Bring your own Gemini key, free tier covers 1,500 requests a day', 'No watermark, no usage cap, no subscription'].map((f, i) => ( -
  • {f}
  • - ))} -
- -
-
-
- -

source — for developers

- Free · MIT -
-
    - {['Your machine: 5 to 8 min on a typical CPU', 'Bring your own Gemini and ElevenLabs keys', 'You install it, you maintain it, you back it up', 'Free forever, and always will be'].map((f, i) => ( -
  • {f}
  • - ))} -
- - view on github - -
-
-
-
- - {/* 3 Tools in 1 Section */} -
-
- - Everything below runs in the self-hosted app — bring your own keys for the AI features. - -
-
-

01 · Clips

- -

Clip Generator

-

Open source AI clipping tool: turn long-form videos into viral-ready 9:16 shorts.

-
    - {['AI viral moment detection', 'Smart face-tracking crop', 'Auto subtitles + AI dubbing in 30+ languages'].map((f, i) => ( -
  • {f}
  • - ))} -
-
-
-

02 · Publishing

- -

Postiz Publishing

-

Publish finished clips through a self-hosted Postiz instance.

-
    - {['TikTok, Instagram Reels & YouTube Shorts', 'Self-hosted, you own the credentials', 'Schedule or post now'].map((f, i) => ( -
  • {f}
  • - ))} -
-
-
-

03 · Studio

- -

YouTube Studio

-

Free AI YouTube toolkit: thumbnails, titles, descriptions.

-
    - {['AI thumbnail generator (with face upload)', '10 viral title suggestions + chat', 'Direct publish to YouTube'].map((f, i) => ( -
  • {f}
  • - ))} -
-
-
-
-
- - {/* Features Section */} -
-
- - The free open source clip generator. A smart AI video clipper for TikTok, Reels & Shorts. - -
- {features.map((feature, i) => ( - - ))} -
-
-
- - {/* API Keys Section */} -
-
- - You bring your own keys — Gemini is required, ElevenLabs and Postiz are optional, and each has a generous free tier: - -
-
- Required -
- -
-

Google Gemini API

-
Free tier: 1,500 req/day
-

Powers all AI features: viral moment detection, title generation, video effects, YouTube thumbnail creation, and description writing. The core engine of Clipwright.

-
-
- Optional -
- -
-

ElevenLabs API

-
Free tier included
-

Enables AI voice dubbing and translation in 30+ languages. Preserves the original speaker's voice while translating audio. Dubbed clips are auto-subtitled.

-
-
- Optional -
- -
-

Self-hosted Postiz

-
You run it
-

Publishes finished clips to YouTube, TikTok, and Instagram Reels from the dashboard. Postiz runs on your own infrastructure and holds the platform credentials, so Clipwright never has them.

-
-
-
-
- - {/* How It Works Section */} -
-
- - From long-form video to viral-ready clips in 5 automated steps. - -
- {steps.map((step, i) => ( - - ))} -
-
-
- - {/* Tech Stack */} -
-
- - Industry-leading AI models and open source tools in one pipeline. - -
- {[ - { name: "Google Gemini 3.1", desc: "AI Analysis" }, - { name: "faster-whisper", desc: "Transcription" }, - { name: "YOLOv8", desc: "Object Detection" }, - { name: "MediaPipe", desc: "Face Tracking" }, - { name: "FFmpeg", desc: "Video Processing" }, - { name: "ElevenLabs", desc: "Voice & TTS" }, - { name: "React + Vite", desc: "Dashboard" }, - { name: "Docker", desc: "Deployment" } - ].map((tech, i) => ( -
-
{tech.name}
-
{tech.desc}
-
- ))} -
-
-
- - {/* Comparison Table */} -
-
- - Clipwright is free and open source — you self-host it. Opus Clip runs $15-228/month, Kapwing $24-79/month. - -
- - - - - - - - - - - $0 Free} opusclip={xIcon} kapwing={xIcon} /> - - - - Limited} kapwing={No} /> - No} kapwing={checkMuted} /> - - Cloud only} kapwing={Cloud only} /> - Free tier only} kapwing={Paid} /> - No} kapwing={No} /> - No} kapwing={Paid} /> - Limited} kapwing={Paid} /> - Built-in} kapwing={Limited} /> - Unlimited} opusclip={Per plan} kapwing={Per plan} /> - -
Feature - Clipwright - Opus ClipKapwing
-
-
-
- - {/* Use Cases */} -
-
- - Creators, marketers, and agencies scaling short-form video production. - -
- {[ - { - title: "Content Creators", - description: "Repurpose long-form videos into TikTok and Reels clips automatically.", - icon: Youtube - }, - { - title: "Social Media Managers", - description: "Batch-process videos and publish for multiple clients from one dashboard.", - icon: Instagram - }, - { - title: "Podcasters & Educators", - description: "Extract the most engaging moments from episodes and lessons.", - icon: FileVideo - }, - { - title: "Businesses & Brands", - description: "Turn every long video into a week of posts and schedule them through self-hosted Postiz.", - icon: Sparkles - } - ].map((useCase, i) => ( -
- -

{useCase.title}

-

{useCase.description}

-
- ))} -
-
-
- - {/* FAQ Section */} -
-
- - Everything you need to know about Clipwright, from setup to features. - -
- {faqs.map((faq, i) => ( - setOpenFaq(openFaq === i ? null : i)} - /> - ))} -
-
-
- - {/* CTA Section — final statement */} -
-
-

start creating viral videos today.

-

free and open source under mit · no watermark · no usage cap · self-host with docker.

-
- - - - Star on GitHub - -
-
-
- - {/* Footer — Ft5 Statement */} - -
- ); -} diff --git a/dashboard/src/components/ResultCard.jsx b/dashboard/src/components/ResultCard.jsx index e74d534..c4583ec 100644 --- a/dashboard/src/components/ResultCard.jsx +++ b/dashboard/src/components/ResultCard.jsx @@ -1,21 +1,55 @@ import React, { useState, useEffect, useRef } from 'react'; -import { Download, Share2, Instagram, Youtube, Video, AlertCircle, Loader2, Copy, Check, Wand2, Type, Calendar, Languages, FileText, Link2, Scissors, Crosshair, TrendingUp } from 'lucide-react'; +import { Download, Share2, Instagram, Youtube, AlertCircle, Loader2, Copy, Check, Wand2, Type, Calendar, FileText, Link2, Scissors, Crosshair, TrendingUp } from 'lucide-react'; import { getApiUrl } from '../config'; import { apiFetch } from '../lib/api'; import SubtitleModal from './SubtitleModal'; import HookModal from './HookModal'; -import TranslateModal from './TranslateModal'; import Modal from './ui/Modal'; -import SegmentedControl from './ui/SegmentedControl'; import { renderInBrowser } from '../lib/renderInBrowser'; const QUIET_BTN = 'group flex flex-col items-center justify-center gap-1 py-2.5 sm:py-2 px-1 rounded-input border border-rule hover:bg-paper3 text-[11px] lowercase text-ink2 whitespace-nowrap transition-colors disabled:opacity-45 disabled:cursor-not-allowed'; -const PLATFORM_OPTIONS = [ - { value: 'tiktok', label: 'tiktok', icon: