mirror of https://github.com/Xhofe/alist
fix(quark): download file size limit (close #4140)
parent
46f9aefb04
commit
c5f6a90f54
|
@ -56,8 +56,10 @@ func (d *Quark) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (
|
||||||
"fids": []string{file.GetID()},
|
"fids": []string{file.GetID()},
|
||||||
}
|
}
|
||||||
var resp DownResp
|
var resp DownResp
|
||||||
|
ua := "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) quark-cloud-drive/2.5.20 Chrome/100.0.4896.160 Electron/18.3.5.4-b478491100 Safari/537.36 Channel/pckk_other_ch"
|
||||||
_, err := d.request("/file/download", http.MethodPost, func(req *resty.Request) {
|
_, err := d.request("/file/download", http.MethodPost, func(req *resty.Request) {
|
||||||
req.SetBody(data)
|
req.SetHeader("User-Agent", ua).
|
||||||
|
SetBody(data)
|
||||||
}, &resp)
|
}, &resp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -65,8 +67,9 @@ func (d *Quark) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (
|
||||||
return &model.Link{
|
return &model.Link{
|
||||||
URL: resp.Data[0].DownloadUrl,
|
URL: resp.Data[0].DownloadUrl,
|
||||||
Header: http.Header{
|
Header: http.Header{
|
||||||
"Cookie": []string{d.Cookie},
|
"Cookie": []string{d.Cookie},
|
||||||
"Referer": []string{"https://pan.quark.cn"},
|
"Referer": []string{"https://pan.quark.cn"},
|
||||||
|
"User-Agent": []string{ua},
|
||||||
},
|
},
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue