Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions drivers/doubao_share/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,17 @@ func (d *DoubaoShare) Link(ctx context.Context, file model.Obj, args model.LinkA

downloadUrl = r.Data.OriginalMediaInfo.MainURL
default:
var r GetFileUrlResp
_, err := d.request("/alice/message/get_file_url", http.MethodPost, func(req *resty.Request) {
var r GetDownloadInfoResp
_, err := d.request("/samantha/aispace/get_download_info", http.MethodPost, func(req *resty.Request) {
req.SetBody(base.Json{
"uris": []string{u.Key},
"type": FileNodeType[u.NodeType],
"requests": []base.Json{{"node_id": file.GetID()}},
})
}, &r)
if err != nil {
return nil, err
}

downloadUrl = r.Data.FileUrls[0].MainURL
downloadUrl = r.Data.DownloadInfos[0].MainURL
}

// 生成标准的Content-Disposition
Expand Down
12 changes: 6 additions & 6 deletions drivers/doubao_share/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ type FilePath []struct {
UpdateTime int64 `json:"update_time"`
}

type GetFileUrlResp struct {
type GetDownloadInfoResp struct {
BaseResp
Data struct {
FileUrls []struct {
URI string `json:"uri"`
MainURL string `json:"main_url"`
BackURL string `json:"back_url"`
} `json:"file_urls"`
DownloadInfos []struct {
NodeID string `json:"node_id"`
MainURL string `json:"main_url"`
BackupURL string `json:"backup_url"`
} `json:"download_infos"`
} `json:"data"`
}

Expand Down