Skip to content

Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.

feat: semantic task id

沈浩d9332381bbe5
diff --git a/internal/service/subtitle_service.go b/internal/service/subtitle_service.go
index 21c5e174..3ef59277 100644
--- a/internal/service/subtitle_service.go
+++ b/internal/service/subtitle_service.go
@@ -32,7 +32,8 @@ func (s Service) StartSubtitleTask(req dto.StartVideoSubtitleTaskReq) (*dto.Star
}
}
// 生成任务id
- taskId := util.GenerateRandStringWithUpperLowerNum(8)
+ seperates := strings.Split(req.Url, "/")
+ taskId := fmt.Sprintf("%s_%s", string([]rune(strings.ReplaceAll(seperates[len(seperates)-1], " ", ""))[:16]), util.GenerateRandStringWithUpperLowerNum(4))
// 构造任务所需参数
var resultType types.SubtitleResultType
// 根据入参选项确定要返回的字幕类型