本地服务默认运行在 http://localhost:5000。
当前服务支持两种笔记生成后端:
AI_PROVIDER=openai:默认模式,走 OpenAI 兼容chat/completionsAI_PROVIDER=google:兼容模式,走google.generativeai
说明:
- 默认建议使用
openai - 当前
openai模式主要走“字幕文本生成笔记” - 完整流程
/process仍然可用,因为它会先完成转录,再基于字幕生成
- 浏览器前端只负责提交任务和展示状态
- 后端负责排队、串行执行和任务恢复
- 任务执行时会根据现有文件状态做差量补全
检查某个课节的现有文件状态。
请求体:
{
"courseName": "Course A",
"lessonTitle": "2025-10-17 08:55 Lesson 1"
}响应示例:
{
"audioExists": true,
"audioComplete": true,
"subtitleExists": true,
"srtExists": true,
"txtExists": true,
"videoExists": false,
"noteExists": false,
"formattedName": "Course A-1017-0855",
"paths": {
"audio": "/path/to/downloads/Course A-1017-0855.m4a",
"srt": "/path/to/downloads/Course A-1017-0855.srt",
"txt": "/path/to/downloads/Course A-1017-0855.txt",
"video": null,
"note": null
}
}下载音频或视频。
请求体:
{
"url": "https://example.invalid/video.m3u8",
"courseName": "Course A",
"lessonTitle": "2025-10-17 08:55 Lesson 1",
"filename": "Course A-1017-0855",
"type": "audio",
"overwriteExisting": false
}说明:
type可选audio或videooverwriteExisting=true时允许重下
创建转录任务。服务端会优先复用已有音频。
请求体:
{
"urls": ["https://example.invalid/video.m3u8"],
"courseName": "Course A",
"lessonTitle": "2025-10-17 08:55 Lesson 1",
"overwriteExisting": false
}直接转录指定音频文件。
请求体:
{
"courseName": "Course A",
"lessonTitle": "2025-10-17 08:55 Lesson 1",
"audioPath": "/path/to/downloads/Course A-1017-0855.m4a",
"overwriteExisting": false
}生成 AI 笔记的一体化流程。缺什么补什么。
请求体:
{
"urls": ["https://example.invalid/video.m3u8"],
"courseName": "Course A",
"lessonTitle": "2025-10-17 08:55 Lesson 1",
"forceRegenerate": false
}在默认 openai 模式下,这条流程会自动先补齐字幕,再调用 OpenAI 兼容接口生成笔记。
使用已有字幕直接生成笔记。
请求体:
{
"courseName": "Course A",
"lessonTitle": "2025-10-17 08:55 Lesson 1",
"subtitlePath": "/path/to/downloads/Course A-1017-0855.txt",
"videoUrl": "https://example.invalid/video.m3u8"
}返回当前所有任务,用于页面恢复。
返回单个任务状态。
取消或删除任务:
- 进行中的任务会被标记为
cancelled - 已完成或失败的任务会被移除
批量清理终态任务:
completederrorcancelled
常见状态:
queueddownloadingprocessingcompletederrorcancelled
curl -X POST http://localhost:5000/check-files \
-H 'Content-Type: application/json' \
-d '{"courseName":"Course A","lessonTitle":"2025-10-17 08:55 Lesson 1"}'