From b4ad301d53d8ccbe99382d6a77b565720f5be8e6 Mon Sep 17 00:00:00 2001 From: Xhofe Date: Wed, 23 Feb 2022 11:18:51 +0800 Subject: [PATCH] :bug: fix #599 lanzou url without password --- drivers/lanzou/lanzou.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/lanzou/lanzou.go b/drivers/lanzou/lanzou.go index 78ff94b5..ddc09d7f 100644 --- a/drivers/lanzou/lanzou.go +++ b/drivers/lanzou/lanzou.go @@ -118,7 +118,10 @@ func (driver *Lanzou) GetFilesByUrl(account *model.Account) ([]LanZouFile, error uid := regexp.MustCompile(`'uid':'(.+?)',`).FindStringSubmatch(res.String())[1] rep := regexp.MustCompile(`'rep':'(.+?)',`).FindStringSubmatch(res.String())[1] up := regexp.MustCompile(`'up':(.+?),`).FindStringSubmatch(res.String())[1] - ls := regexp.MustCompile(`'ls':(.+?),`).FindStringSubmatch(res.String())[1] + ls := "" + if account.Password != "" { + ls = regexp.MustCompile(`'ls':(.+?),`).FindStringSubmatch(res.String())[1] + } tName := regexp.MustCompile(`'t':(.+?),`).FindStringSubmatch(res.String())[1] kName := regexp.MustCompile(`'k':(.+?),`).FindStringSubmatch(res.String())[1] t := regexp.MustCompile(`var ` + tName + ` = '(.+?)';`).FindStringSubmatch(res.String())[1]