feat: 将视频转写重构为纯文字异步语音识别

This commit is contained in:
2026-10-03 21:58:06 +08:00
parent 040273586b
commit 6f0e38054b
34 changed files with 2283 additions and 1771 deletions
+6 -2
View File
@@ -21,7 +21,7 @@ import {
releaseIsolatedContext,
} from "@/app/api/fetcher/browser";
import { extractFirstFrame } from "@/app/api/media";
import { transcriptAweme } from "../stt";
import { enqueueTranscription } from "@/lib/stt/tasks";
const DETAIL_PATH = "/aweme/v1/web/aweme/detail/";
const COMMENT_PATH = "/aweme/v1/web/comment/list/";
@@ -429,7 +429,11 @@ export async function scrapeDouyin(url: string) {
fps ?? undefined,
);
console.log(chalk.green.bold("✓ 视频作品保存成功"));
transcriptAweme(detail.aweme_detail.aweme_id).catch((e) => {}); // 异步转写,不阻塞主流程
try {
await enqueueTranscription(detail.aweme_detail.aweme_id);
} catch {
console.error("视频已保存,但转写任务入队失败,可在后台批量补转");
}
return { type: "video", ...saved };
} else {
throw new ScrapeError(