feat(115): update upload api to v4.0 add pagesize option (#3840 close #3753)

This commit is contained in:
sheltonzhu
2023-03-13 20:02:52 +08:00
committed by GitHub
parent 301756ba03
commit 4741a75c92
4 changed files with 11 additions and 7 deletions

View File

@ -7,7 +7,7 @@ import (
"github.com/pkg/errors"
)
var UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 115Browser/23.9.3.2 115disk/30.1.0"
var UserAgent = driver.UA115Desktop
func (d *Pan115) login() error {
var err error
@ -38,7 +38,10 @@ func (d *Pan115) login() error {
func (d *Pan115) getFiles(fileId string) ([]driver.File, error) {
res := make([]driver.File, 0)
files, err := d.client.List(fileId)
if d.PageSize <= 0 {
d.PageSize = driver.FileListLimit
}
files, err := d.client.ListWithLimit(fileId, d.PageSize)
if err != nil {
return nil, err
}