完成视频复刻和优化

This commit is contained in:
Azmat@qq.com
2026-08-27 11:54:47 +08:00
parent c25060c6c6
commit 51620bf25b
46 changed files with 2575 additions and 663 deletions
+29 -21
View File
@@ -44,6 +44,7 @@ import type {
User,
UserPreference,
VideoDigestHistory,
VideoDigestJob,
VoiceoverInfo
} from "./types";
import type { PresentationFormat, VideoStructure } from "./script-setup";
@@ -411,32 +412,18 @@ export const api = {
{ method: "POST", body: formData }
);
},
// 视频提炼页:不绑项目,整段视频交给 Gemini 出中文分镜稿。慢(约 1–2 分钟),固定 30 积分,失败退还
// 视频提炼页:不绑项目。POST 秒回任务,worker 抽帧 + Gemini;离开页面也不中断
extractVideoDigest(formData: FormData) {
return request<{
name: string;
chars: number;
text: string;
frames: number;
duration: number;
input?: string;
estimated_cost?: string;
task_id?: string;
title?: string;
file_name?: string;
ratio?: string;
shots?: number;
cover_url?: string;
video_url?: string;
width?: number;
height?: number;
}>(
return request<VideoDigestJob>(
"/api/ai/video-digest/",
{ method: "POST", body: formData }
);
},
listVideoDigests() {
return request<{ results: VideoDigestHistory[]; total: number }>("/api/ai/video-digest/");
return request<{ results: VideoDigestHistory[]; total: number; inflight?: VideoDigestJob | null }>("/api/ai/video-digest/");
},
getVideoDigest(id: string) {
return request<VideoDigestJob>(`/api/ai/video-digest/${id}/`);
},
saveVideoDigest(id: string, prompt: string) {
return request<VideoDigestHistory>(`/api/ai/video-digest/${id}/`, {
@@ -915,6 +902,27 @@ export const api = {
}) {
return request<{ task: FreeVideoTask }>("/api/ai/free-video/", { method: "POST", body: JSON.stringify(payload) });
},
submitVideoReplace(payload: {
replace_mode: "product" | "character";
video_asset_id: string;
product_id?: string;
model_id?: string;
image_asset_ids?: string[];
model?: string;
aspect_ratio?: string;
resolution?: string;
duration?: number;
}) {
return request<{ task: FreeVideoTask }>("/api/ai/video-replace/", { method: "POST", body: JSON.stringify(payload) });
},
videoReplaceTasks(offset = 0, pageSize = 20) {
return request<{ results: FreeVideoTask[]; total: number; has_more: boolean }>(
`/api/ai/video-replace/?offset=${offset}&page_size=${pageSize}`
);
},
pollVideoReplace(id: string) {
return request<{ task: FreeVideoTask }>(`/api/ai/video-replace/${id}/poll/`, { method: "POST" });
},
freeVideoTasks(offset = 0, pageSize = 20) {
return request<{ results: FreeVideoTask[]; total: number; has_more: boolean }>(
`/api/ai/free-video/?offset=${offset}&page_size=${pageSize}`
@@ -1107,7 +1115,7 @@ export const adminApi = {
);
},
pollReviews(assetIds?: string[]) {
return request<{ polled: number; statuses: Record<string, string> }>(
return request<{ polled: number; submitted?: number; statuses: Record<string, string> }>(
"/api/admin/asset-reviews/poll/",
{ method: "POST", body: JSON.stringify(assetIds ? { asset_ids: assetIds } : {}) }
);