From 4a42bc5083a171cba24a0fdcc2781a2e8dfbd9cc Mon Sep 17 00:00:00 2001 From: foxxorcat <95907542+foxxorcat@users.noreply.github.com> Date: Thu, 25 Jul 2024 20:09:48 +0800 Subject: [PATCH] fix(lanzou): not find file page param (#6862 close #6857) * fix(lanzou):not find file page param * fix(labzou): change lanzouo.com to lanzoui.com --- drivers/lanzou/driver.go | 3 +++ drivers/lanzou/meta.go | 3 ++- drivers/lanzou/util.go | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/lanzou/driver.go b/drivers/lanzou/driver.go index cdb56f79658..9e73f0525c2 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 c8db6448476..1e8826cadeb 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 8aeba8113e1..abc2c400119 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 != "" {