@Summary Get video url without watermark @Schemes @Description @Accept json @Produce json @Param task_id path string true "fetch by id" @Success 200 {object} object "url" @Router /luma/generations/{task_id}/download_video_url [post]
(c *gin.Context)
| 103 | // @Success 200 {object} object "url" |
| 104 | // @Router /luma/generations/{task_id}/download_video_url [post] |
| 105 | func GetDownloadUrl(c *gin.Context) { |
| 106 | taskID := c.Param("task_id") |
| 107 | |
| 108 | resp, err := DoRequest(http.MethodGet, fmt.Sprintf(common.BaseUrl+DownloadEndpoint, taskID), nil, nil) |
| 109 | if err != nil { |
| 110 | WrapperLumaError(c, err, http.StatusInternalServerError) |
| 111 | return |
| 112 | } |
| 113 | defer resp.Body.Close() |
| 114 | c.Writer.WriteHeader(resp.StatusCode) |
| 115 | for key, values := range resp.Header { |
| 116 | for _, value := range values { |
| 117 | c.Writer.Header().Add(key, value) |
| 118 | } |
| 119 | } |
| 120 | // 读取响应体 |
| 121 | _, err = io.Copy(c.Writer, resp.Body) |
| 122 | if err != nil { |
| 123 | WrapperLumaError(c, err, http.StatusInternalServerError) |
| 124 | return |
| 125 | } |
| 126 | return |
| 127 | } |
| 128 | |
| 129 | // @Summary Get current user info |
| 130 | // @Schemes |
nothing calls this directly
no test coverage detected