mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-04-30 12:21:45 +00:00
fix: video content api Priority use url field
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/QuantumNous/new-api/logger"
|
"github.com/QuantumNous/new-api/logger"
|
||||||
"github.com/QuantumNous/new-api/model"
|
"github.com/QuantumNous/new-api/model"
|
||||||
"github.com/QuantumNous/new-api/service"
|
"github.com/QuantumNous/new-api/service"
|
||||||
|
"github.com/samber/lo"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
@@ -134,8 +135,7 @@ func VideoProxy(c *gin.Context) {
|
|||||||
videoURL = fmt.Sprintf("%s/v1/videos/%s/content", baseURL, task.TaskID)
|
videoURL = fmt.Sprintf("%s/v1/videos/%s/content", baseURL, task.TaskID)
|
||||||
req.Header.Set("Authorization", "Bearer "+channel.Key)
|
req.Header.Set("Authorization", "Bearer "+channel.Key)
|
||||||
default:
|
default:
|
||||||
// Video URL is directly in task.FailReason
|
videoURL = lo.Ternary(task.Url != "", task.Url, task.FailReason)
|
||||||
videoURL = task.FailReason
|
|
||||||
}
|
}
|
||||||
|
|
||||||
req.URL, err = url.Parse(videoURL)
|
req.URL, err = url.Parse(videoURL)
|
||||||
|
|||||||
Reference in New Issue
Block a user