feat: add video channel kling fix

This commit is contained in:
skynono
2025-06-17 13:37:07 +08:00
parent 8a79de333a
commit b7c77777a5
2 changed files with 2 additions and 4 deletions

View File

@@ -104,9 +104,7 @@ func updateVideoSingleTask(ctx context.Context, adaptor channel.TaskAdaptor, cha
case "succeed":
task.Status = model.TaskStatusSuccess
task.Progress = "100%"
if url, err := adaptor.(interface {
ParseResultUrl(map[string]any) (string, error)
}).ParseResultUrl(responseItem); err == nil {
if url, err := adaptor.ParseResultUrl(responseItem); err == nil {
task.FailReason = url
} else {
common.LogWarn(ctx, fmt.Sprintf("Failed to get url from body for task %s: %s", task.TaskID, err.Error()))

View File

@@ -107,7 +107,7 @@ func (a *TaskAdaptor) BuildRequestURL(info *relaycommon.TaskRelayInfo) (string,
func (a *TaskAdaptor) BuildRequestHeader(c *gin.Context, req *http.Request, info *relaycommon.TaskRelayInfo) error {
token, err := a.createJWTToken()
if err != nil {
token = info.ApiKey // fallback
return fmt.Errorf("failed to create JWT token: %w", err)
}
req.Header.Set("Content-Type", "application/json")