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.
TypeScript agent-skillscodex-clideskop-appdubbingimage-generationlocalizationskillsttsvideo-editingvideo-generationvideo-transcriptionvideo-translation
Update YouTube subtitle tests
puji48109685b26cccba
diff --git a/internal/service/youtube_subtitle_test.go b/internal/service/youtube_subtitle_test.goindex cad82f87..629d13ff 100644--- a/internal/service/youtube_subtitle_test.go+++ b/internal/service/youtube_subtitle_test.go@@ -2,13 +2,13 @@ package serviceimport ("context"+ "krillin-ai/config""krillin-ai/internal/types""testing")func Test_YoutubeSubtitle(t *testing.T) {// 固定的测试文件路径- subtitleFile := "/home/puji/KrillinAI/tasks/watch_vfLoHojLh_685Z/converted_subtitle.srt"s := initService()// 创建一个测试用的 SubtitleTask@@ -19,15 +19,24 @@ func Test_YoutubeSubtitle(t *testing.T) {Status: 1, // 处理中ProcessPct: 0,}+ config.Conf.App.MaxSentenceLength = 100++ _, err := s.YouTubeSubtitleSrv.convertToSrtFormat("/home/puji/KrillinAI/tasks/watch_vmdgIpmoF_dkxs/test.vtt", "/home/puji/KrillinAI/tasks/watch_vmdgIpmoF_dkxs/")+ if err != nil {+ t.Errorf("convertToSrtFormat() error = %v", err)+ return+ }+ subtitleFile := "/home/puji/KrillinAI/tasks/watch_vmdgIpmoF_dkxs//converted_subtitle.srt"+// 执行测试- err := s.YouTubeSubtitleSrv.TranslateSrtFile(context.Background(), &types.SubtitleTaskStepParam{+ err = s.YouTubeSubtitleSrv.TranslateSrtFile(context.Background(), &types.SubtitleTaskStepParam{TaskId: "kgysZPHh",TaskPtr: testTask, // 提供有效的 TaskPtrOriginLanguage: "en",TargetLanguage: "zh_cn",- TaskBasePath: "/home/puji/KrillinAI/tasks/watch_vfLoHojLh_685Z/",- OriginalSubtitleFilePath: "/home/puji/KrillinAI/tasks/watch_vfLoHojLh_685Z/test.vtt",+ TaskBasePath: "/home/puji/KrillinAI/tasks/watch_vmdgIpmoF_dkxs/",+ OriginalSubtitleFilePath: "/home/puji/KrillinAI/tasks/watch_vmdgIpmoF_dkxs/test.vtt",}, subtitleFile)if err != nil {t.Errorf("TranslateSrtFile() error = %v, want nil", err)