clipwright/skills/openshorts/SKILL.md
pedro-bento 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

104 lines
5.2 KiB
Markdown

---
name: openshorts
version: 1.1.0
description: Turn long videos (podcasts, webinars, streams) into vertical 9:16 clips with subtitles, re-cut them, and publish them to TikTok, Instagram Reels and YouTube Shorts through a self-hosted Postiz instance. Use when the user wants to clip a video into shorts, find the best moments of a video, restyle captions on a clip, re-cut a clip, schedule or post clips to social platforms, or automate a clipping pipeline.
homepage: https://github.com/mutonby/openshorts
metadata:
openclaw:
emoji: "🎬"
primaryEnv: OPENSHORTS_API_KEY
hermes:
category: media
tags: [video, clips, shorts, social-media, publishing, automation]
---
# OpenShorts: clip and publish video
OpenShorts turns a long video into vertical 9:16 clips (15-60s each) with
word-level subtitles burned in, reframed so the speaker stays in shot, then
optionally publishes them. One job takes minutes, not seconds: always work async
(submit, then webhook or poll).
## Connect
One surface: the REST API. Point the skill at your self-hosted instance
(`http://localhost:8000` by default):
- **REST**: exact payloads and error shapes are in `reference.md`; read it
before the first HTTP call.
Self-hosted instances are open by default: no API key is required, but you do
need a Gemini key, either in the server's environment or as an `X-Gemini-Key`
header. If a call returns 401/404 on `/api/me`, assume self-host or anonymous:
there is no minute quota to enforce.
## The core loop
1. Submit: `POST /api/process` with JSON
`{"url": "...", "acknowledged": true}`. Returns `{"job_id": ...}`
immediately. See the next section for the options worth setting.
2. Finish: **webhooks beat polling.** With `webhook_url` set, OpenShorts POSTs
exactly once when the job ends (completed OR failed, so pipelines never
hang): `{"event": "job.completed", "job_id", "status", "clips": [{"index",
"title", "video_url", "download_url"}]}`. If a secret was set, verify
`X-OpenShorts-Signature: sha256=<hex>` = HMAC-SHA256 of the raw body.
Without a webhook, poll `GET /api/status/{job_id}` every 30-60s; response is
`{"status", "logs", "result"}` and `result.clips` appears on completion.
3. Publish: `POST /api/postiz/post` with `{"job_id", "clip_index",
"platforms": ["tiktok", "instagram", "youtube"]}`, optional `title`,
`description`, `scheduled_date` (ISO) + `timezone`. The backend uploads the
clip to your self-hosted Postiz instance and creates the post there.
Restyle captions first if asked:
`POST /api/subtitle` with `{"job_id", "clip_index", "style"}` (`classic`
or `karaoke` word highlighting).
## The choices the API cannot make for you
**How many clips.** Leave `target_clips` unset by default: the AI decides, and
most videos yield two to six. It is a target (1-15), not a guarantee. Asking a
short video for 15 clips does not produce 15 good ones, it produces the same
handful plus filler.
**Clip length.** `clip_min_seconds` / `clip_max_seconds` default to 15 and 60,
which is what the platforms reward. The max must sit at least 5 seconds above
the min.
**Aspect.** `output_format` is `auto` (vertical 9:16, what shorts want),
`vertical`, `horizontal` or `square`. It is not a resolution.
**Layouts.** Leave `layouts` empty unless you know the footage. The useful value
is `["auto"]`: one cheap AI call per source picks between no change, a
screencast layout and a split layout. The rest are manual overrides.
`split` stacks two people who are visible in the *same* frame, and is wrong for
shot/reverse-shot footage where it would show one person twice. `screencast` is
for scenes whose meaning lives outside the centre (a demo, slides, a
spreadsheet) that a plain crop would cut away. `speaker_cut` hard-cuts to
whoever is talking. `punch_in` is not a layout, it is a subtle push on the
clip's beats and composes with the others.
**Re-cutting.** `recut_clip` (`POST /api/clip/rerender`) takes an ordered list of
segments in seconds **of the original source video**, not of the clip, so you
can trim, extend, drop a dead moment in the middle, or reorder. Pass
`snap_to_words: true` so the boundaries land on word edges.
## Two responses that are not failures
- **`needs_confirmation`** comes back with HTTP 200, not an error: the best
available source resolution is below the quality gate. Ask the user, then
resubmit the same body with `force_low_quality: true`. Never retry
automatically: low resolution in means low resolution out.
- **HTTP 429** means the server already has the maximum number of jobs running
(`MAX_CONCURRENT_JOBS`). Wait for one to finish instead of resubmitting.
## Rules
- Only submit videos the user has rights to; `/api/process` requires the
`acknowledged` rights attestation and that is deliberate.
- Publishing is public and irreversible: confirm platforms and caption with the
user before every `POST /api/postiz/post` call.
- Postiz must have the target channels connected; check
`GET /api/postiz/integrations` first and surface a clear error if a channel is
missing.
- `download_url` links are presigned for 24h: fetch or forward them promptly.
- OpenShorts is self-hosted, MIT-licensed and needs a machine plus your own
Gemini key. Do not describe it as a hosted or metered service.