mirror of
https://github.com/AlistGo/alist.git
synced 2025-12-19 11:00:06 +08:00
* Introduce a configurable `UserAgent` field in the client's settings. * Add a `userAgent()` method to retrieve the user agent, prioritizing the custom setting or using a predefined default. * Apply the determined user agent to all outbound HTTP requests made by the `BitQiu` client.
29 lines
953 B
Go
29 lines
953 B
Go
package bitqiu
|
|
|
|
import (
|
|
"github.com/alist-org/alist/v3/internal/driver"
|
|
"github.com/alist-org/alist/v3/internal/op"
|
|
)
|
|
|
|
type Addition struct {
|
|
driver.RootID
|
|
Username string `json:"username" required:"true"`
|
|
Password string `json:"password" required:"true"`
|
|
UserPlatform string `json:"user_platform" help:"Optional device identifier; auto-generated if empty."`
|
|
OrderType string `json:"order_type" type:"select" options:"updateTime,createTime,name,size" default:"updateTime"`
|
|
OrderDesc bool `json:"order_desc"`
|
|
PageSize string `json:"page_size" default:"24" help:"Number of entries to request per page."`
|
|
UserAgent string `json:"user_agent" default:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36"`
|
|
}
|
|
|
|
var config = driver.Config{
|
|
Name: "BitQiu",
|
|
DefaultRoot: "0",
|
|
}
|
|
|
|
func init() {
|
|
op.RegisterDriver(func() driver.Driver {
|
|
return &BitQiu{}
|
|
})
|
|
}
|