import { LIVE_CLIP_BODY_KEYS } from "yt-dlp-transcript-common/controller/liveClip"; import { liveClipAction } from "../../../channels/[slug]/liveMediaActions"; import { jobResponse, ops, reqSlug } from "../_lib"; export const dynamic = "force-dynamic"; // POST { slug, id, start, end | clip, project?, replace? } -> { ok: true, jobId } // // A SHAREABLE CLIP OF A STREAM STILL LIVE (controller/liveClip.ts): umtool's // live share — the window cut now from the recording in progress (no network), // the clip added to the stream's project when given by seconds, its short made // with the live transcript's captions — followed to the end as a `live-clip` // job. A clip is at most 2:20 (X's limit). `project` defaults to `-live`, // the project live pre-clip grows. export async function POST(request: Request) { return ops(request, LIVE_CLIP_BODY_KEYS, async (body) => { reqSlug(body, "slug"); return jobResponse(await liveClipAction(body)); }); }