diff --git a/drivers/baidu_netdisk/driver.go b/drivers/baidu_netdisk/driver.go index fe1a6ddb..64510dcf 100644 --- a/drivers/baidu_netdisk/driver.go +++ b/drivers/baidu_netdisk/driver.go @@ -23,7 +23,6 @@ import ( type BaiduNetdisk struct { model.Storage Addition - AccessToken string } func (d *BaiduNetdisk) Config() driver.Config { @@ -35,7 +34,11 @@ func (d *BaiduNetdisk) GetAddition() driver.Additional { } func (d *BaiduNetdisk) Init(ctx context.Context) error { - return d.refreshToken() + res, err := d.get("/xpan/nas", map[string]string{ + "method": "uinfo", + }, nil) + log.Debugf("[baidu] get uinfo: %s", string(res)) + return err } func (d *BaiduNetdisk) Drop(ctx context.Context) error { diff --git a/drivers/baidu_netdisk/meta.go b/drivers/baidu_netdisk/meta.go index 9feca299..cf9a89eb 100644 --- a/drivers/baidu_netdisk/meta.go +++ b/drivers/baidu_netdisk/meta.go @@ -13,6 +13,7 @@ type Addition struct { DownloadAPI string `json:"download_api" type:"select" options:"official,crack" default:"official"` ClientID string `json:"client_id" required:"true" default:"iYCeC9g08h5vuP9UqvPHKKSVrKFXGa1v"` ClientSecret string `json:"client_secret" required:"true" default:"jXiFMOPVPCWlO2M5CwWQzffpNPaGTRBG"` + AccessToken string } var config = driver.Config{