2022-09-02 22:46:31 +08:00
|
|
|
package baidu_netdisk
|
|
|
|
|
|
|
|
import (
|
2025-07-01 09:54:50 +08:00
|
|
|
"github.com/OpenListTeam/OpenList/v4/internal/driver"
|
|
|
|
"github.com/OpenListTeam/OpenList/v4/internal/op"
|
2022-09-02 22:46:31 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
type Addition struct {
|
2022-09-04 13:07:53 +08:00
|
|
|
driver.RootPath
|
2025-03-01 18:46:05 +08:00
|
|
|
OrderBy string `json:"order_by" type:"select" options:"name,time,size" default:"name"`
|
|
|
|
OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" default:"asc"`
|
2025-04-03 20:44:49 +08:00
|
|
|
DownloadAPI string `json:"download_api" type:"select" options:"official,crack,crack_video" default:"official"`
|
2025-06-17 22:13:28 +08:00
|
|
|
UseOnlineAPI bool `json:"use_online_api" default:"true"`
|
|
|
|
APIAddress string `json:"api_url_address" default:"https://api.oplist.org/baiduyun/renewapi"`
|
|
|
|
ClientID string `json:"client_id"`
|
|
|
|
ClientSecret string `json:"client_secret"`
|
2025-03-01 18:46:05 +08:00
|
|
|
CustomCrackUA string `json:"custom_crack_ua" required:"true" default:"netdisk"`
|
|
|
|
AccessToken string
|
2025-06-18 18:09:36 +08:00
|
|
|
RefreshToken string `json:"refresh_token" required:"true"`
|
2025-03-01 18:46:05 +08:00
|
|
|
UploadThread string `json:"upload_thread" default:"3" help:"1<=thread<=32"`
|
|
|
|
UploadAPI string `json:"upload_api" default:"https://d.pcs.baidu.com"`
|
|
|
|
CustomUploadPartSize int64 `json:"custom_upload_part_size" type:"number" default:"0" help:"0 for auto"`
|
|
|
|
LowBandwithUploadMode bool `json:"low_bandwith_upload_mode" default:"false"`
|
2025-04-03 20:44:49 +08:00
|
|
|
OnlyListVideoFile bool `json:"only_list_video_file" default:"false"`
|
2022-09-02 22:46:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
var config = driver.Config{
|
|
|
|
Name: "BaiduNetdisk",
|
2022-09-03 10:12:28 +08:00
|
|
|
DefaultRoot: "/",
|
2022-09-02 22:46:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
2022-12-13 18:03:30 +08:00
|
|
|
op.RegisterDriver(func() driver.Driver {
|
|
|
|
return &BaiduNetdisk{}
|
|
|
|
})
|
2022-09-02 22:46:31 +08:00
|
|
|
}
|