up debid link

This commit is contained in:
cangui 2025-06-19 19:46:37 +02:00
parent 6907794858
commit 196c29cd70
2 changed files with 18 additions and 9 deletions

View File

@ -534,7 +534,13 @@ func (c *Client) CreateTranscode(ctx context.Context, fileID, preset string) (st
return resp.TranscodeID, nil
}
func (c *Client) GetTranscode(ctx context.Context, transcodeID string) (*StreamInfo, error) {
func (c *Client) GetTranscode(ctx context.Context, fileID string) (*StreamInfo, error) {
body := struct {
ID string `json:"id"`
}{
ID: fileID,
}
var raw struct {
Success bool `json:"success"`
Value struct {
@ -548,12 +554,13 @@ func (c *Client) GetTranscode(ctx context.Context, transcodeID string) (*StreamI
ID string `json:"id"`
Name string `json:"name"`
Size int64 `json:"size"`
Source string `json:"source"`
} `json:"file"`
} `json:"value"`
}
path := fmt.Sprintf("stream/transcode/%s", transcodeID)
if err := c.doJSON(ctx, "GET", path, nil, nil, &raw); err != nil {
path := "stream/transcode/add"
if err := c.doJSON(ctx, "POST", path, nil, body, &raw); err != nil {
return nil, err
}
@ -570,3 +577,5 @@ func (c *Client) GetTranscode(ctx context.Context, transcodeID string) (*StreamI
}
return info, nil
}