diff --git a/drivers/lanzou/driver.go b/drivers/lanzou/driver.go index cdb56f79..9e73f052 100644 --- a/drivers/lanzou/driver.go +++ b/drivers/lanzou/driver.go @@ -30,6 +30,9 @@ func (d *LanZou) GetAddition() driver.Additional { } func (d *LanZou) Init(ctx context.Context) (err error) { + if d.UserAgent == "" { + d.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.39 (KHTML, like Gecko) Chrome/89.0.4389.111 Safari/537.39" + } switch d.Type { case "account": _, err := d.Login() diff --git a/drivers/lanzou/meta.go b/drivers/lanzou/meta.go index c8db6448..1e8826ca 100644 --- a/drivers/lanzou/meta.go +++ b/drivers/lanzou/meta.go @@ -16,7 +16,8 @@ type Addition struct { driver.RootID SharePassword string `json:"share_password"` BaseUrl string `json:"baseUrl" required:"true" default:"https://pc.woozooo.com" help:"basic URL for file operation"` - ShareUrl string `json:"shareUrl" required:"true" default:"https://pan.lanzouo.com" help:"used to get the sharing page"` + ShareUrl string `json:"shareUrl" required:"true" default:"https://pan.lanzoui.com" help:"used to get the sharing page"` + UserAgent string `json:"user_agent" required:"true" default:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.39 (KHTML, like Gecko) Chrome/89.0.4389.111 Safari/537.39"` RepairFileInfo bool `json:"repair_file_info" help:"To use webdav, you need to enable it"` } diff --git a/drivers/lanzou/util.go b/drivers/lanzou/util.go index 8aeba811..abc2c400 100644 --- a/drivers/lanzou/util.go +++ b/drivers/lanzou/util.go @@ -106,7 +106,8 @@ func (d *LanZou) request(url string, method string, callback base.ReqCallback, u } req.SetHeaders(map[string]string{ - "Referer": "https://pc.woozooo.com", + "Referer": "https://pc.woozooo.com", + "User-Agent": d.UserAgent, }) if d.Cookie != "" {