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:
MadDogOwner
2026-01-01 22:29:03 +08:00
committed by GitHub
parent 5fe267089a
commit 874234449b
2 changed files with 10 additions and 11 deletions
+4 -5
View File
@@ -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
+6 -6
View File
@@ -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"`
} }