完成转录功能,中文脚本搜索,播放界面显示脚本

This commit is contained in:
2025-10-25 19:22:41 +08:00
parent d1b4fb6be0
commit 0d18595b68
34 changed files with 1827 additions and 404 deletions
+2
View File
@@ -12,6 +12,7 @@ import { saveToDB, saveImagePostToDB } from '@/app/api/fetcher/persist';
import chalk from 'chalk';
import { acquireIsolatedContext, releaseIsolatedContext } from '@/app/api/fetcher/browser';
import { extractFirstFrame } from '@/app/api/media';
import { transcriptAweme } from '../stt';
const DETAIL_PATH = '/aweme/v1/web/aweme/detail/';
const COMMENT_PATH = '/aweme/v1/web/comment/list/';
@@ -308,6 +309,7 @@ export async function scrapeDouyin(url: string) {
const saved = await saveToDB(context, detail, comments, uploadedUrl, bestPlayAddr?.width, bestPlayAddr?.height, coverUrl, fps ?? undefined);
console.log(chalk.green.bold('✓ 视频作品保存成功'));
transcriptAweme(detail.aweme_detail.aweme_id).catch((e) => {}); // 异步转写,不阻塞主流程
return { type: "video", ...saved };
} else {
throw new ScrapeError('无法判定作品类型,接口响应异常', 500, 'UNKNOWN_TYPE');