Skip to content
Open
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
8 changes: 6 additions & 2 deletions drivers/baidu_netdisk/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (d *BaiduNetdisk) postForm(pathname string, params map[string]string, form

func (d *BaiduNetdisk) getFiles(dir string) ([]File, error) {
start := 0
limit := 200
limit := 1000
params := map[string]string{
"method": "list",
"dir": dir,
Expand All @@ -168,7 +168,6 @@ func (d *BaiduNetdisk) getFiles(dir string) ([]File, error) {
for {
params["start"] = strconv.Itoa(start)
params["limit"] = strconv.Itoa(limit)
start += limit
var resp ListResp
_, err := d.get("/xpan/file", params, &resp)
if err != nil {
Expand All @@ -187,6 +186,11 @@ func (d *BaiduNetdisk) getFiles(dir string) ([]File, error) {
} else {
res = append(res, resp.List...)
}

if len(resp.List) < limit {
break
}
start += limit
}
return res, nil
}
Expand Down
Loading