mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2026-10-10 04:53:09 +08:00
fix(doubao_share): use new download info (#1890)
fix(doubao_share): update file URL retrieval to use new download info structure Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
This commit is contained in:
@@ -92,18 +92,17 @@ func (d *DoubaoShare) Link(ctx context.Context, file model.Obj, args model.LinkA
|
|||||||
|
|
||||||
downloadUrl = r.Data.OriginalMediaInfo.MainURL
|
downloadUrl = r.Data.OriginalMediaInfo.MainURL
|
||||||
default:
|
default:
|
||||||
var r GetFileUrlResp
|
var r GetDownloadInfoResp
|
||||||
_, err := d.request("/alice/message/get_file_url", http.MethodPost, func(req *resty.Request) {
|
_, err := d.request("/samantha/aispace/get_download_info", http.MethodPost, func(req *resty.Request) {
|
||||||
req.SetBody(base.Json{
|
req.SetBody(base.Json{
|
||||||
"uris": []string{u.Key},
|
"requests": []base.Json{{"node_id": file.GetID()}},
|
||||||
"type": FileNodeType[u.NodeType],
|
|
||||||
})
|
})
|
||||||
}, &r)
|
}, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadUrl = r.Data.FileUrls[0].MainURL
|
downloadUrl = r.Data.DownloadInfos[0].MainURL
|
||||||
}
|
}
|
||||||
|
|
||||||
// 生成标准的Content-Disposition
|
// 生成标准的Content-Disposition
|
||||||
|
|||||||
@@ -115,14 +115,14 @@ type FilePath []struct {
|
|||||||
UpdateTime int64 `json:"update_time"`
|
UpdateTime int64 `json:"update_time"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetFileUrlResp struct {
|
type GetDownloadInfoResp struct {
|
||||||
BaseResp
|
BaseResp
|
||||||
Data struct {
|
Data struct {
|
||||||
FileUrls []struct {
|
DownloadInfos []struct {
|
||||||
URI string `json:"uri"`
|
NodeID string `json:"node_id"`
|
||||||
MainURL string `json:"main_url"`
|
MainURL string `json:"main_url"`
|
||||||
BackURL string `json:"back_url"`
|
BackupURL string `json:"backup_url"`
|
||||||
} `json:"file_urls"`
|
} `json:"download_infos"`
|
||||||
} `json:"data"`
|
} `json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user