mirror of
https://github.com/AlistGo/alist.git
synced 2025-06-07 02:54:33 +08:00
fix(lanzou): download cannot find data (#5088)
This commit is contained in:
@ -118,7 +118,19 @@ var findKVReg = regexp.MustCompile(`'(.+?)':('?([^' },]*)'?)`) // 拆分kv
|
|||||||
|
|
||||||
// 根据key查询js变量
|
// 根据key查询js变量
|
||||||
func findJSVarFunc(key, data string) string {
|
func findJSVarFunc(key, data string) string {
|
||||||
values := regexp.MustCompile(`var ` + key + ` = '(.+?)';`).FindStringSubmatch(data)
|
var values []string
|
||||||
|
if key != "sasign" {
|
||||||
|
values = regexp.MustCompile(`var ` + key + ` = '(.+?)';`).FindStringSubmatch(data)
|
||||||
|
} else {
|
||||||
|
matches := regexp.MustCompile(`var `+key+` = '(.+?)';`).FindAllStringSubmatch(data, -1)
|
||||||
|
if len(matches) == 3 {
|
||||||
|
values = matches[1]
|
||||||
|
} else {
|
||||||
|
if len(matches) > 0 {
|
||||||
|
values = matches[0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if len(values) == 0 {
|
if len(values) == 0 {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
@ -374,7 +374,7 @@ func (d *LanZou) getFilesByShareUrl(shareID, pwd string, sharePageData string) (
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
nextPageData := removeJSGlobalFunction(RemoveNotes(string(data)))
|
nextPageData := RemoveNotes(string(data))
|
||||||
param, err = htmlJsonToMap(nextPageData)
|
param, err = htmlJsonToMap(nextPageData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Reference in New Issue
Block a user