AlistGo/alist · error

not find data

Error message

not find data

What it means

htmlJsonToMap2 extracts data blobs from the LanZou page via findDataReg and picks the longest match; this error means zero matches were found, so there is no JSON-ish data to parse into a parameter map.

Source

Thrown at drivers/lanzou/help.go:253

		data := html[index[0]:index[1]]
		if regexp.MustCompile(`function\s+` + name + `[()\s]+{`).MatchString(data) {
			return data, nil
		}
	}
	return "", fmt.Errorf("not find %s function", name)
}

// 解析html中的JSON,选择最长的数据
func htmlJsonToMap2(html string) (map[string]string, error) {
	datas := findDataReg.FindAllStringSubmatch(html, -1)
	var sData string
	for _, data := range datas {
		if len(datas) > 0 && len(data[1]) > len(sData) {
			sData = data[1]
		}
	}
	if sData == "" {
		return nil, fmt.Errorf("not find data")
	}
	return jsonToMap(sData, html), nil
}

// 解析html中的JSON
func htmlJsonToMap(html string) (map[string]string, error) {
	datas := findDataReg.FindStringSubmatch(html)
	if len(datas) != 2 {
		return nil, fmt.Errorf("not find data")
	}
	return jsonToMap(datas[1], html), nil
}

func jsonToMap(data, html string) map[string]string {
	var param = make(map[string]string)
	kvs := findKVReg.FindAllStringSubmatch(data, -1)
	for _, kv := range kvs {
		k, v := kv[1], kv[3]

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Verify the share link still opens normally in a browser
  2. If the share needs a password, ensure the password is provided in the storage/link config so the correct flow runs
  3. Update OpenList to pick up lanzou parser fixes; report the HTML if already current
Defensive patterns

Strategy: type-guard

Type guard

func hasLanzouDataBlob(html string) bool {
    return findDataReg.MatchString(html)
}

Try / catch

m, err := htmlJsonToMap2(html)
if err != nil {
    if !hasLanzouDataBlob(html) {
        // error/challenge template: retrying blindly will not help
        return nil, fmt.Errorf("unexpected lanzou page (deleted or challenge): %w", err)
    }
    return nil, err
}

Prevention

When it happens

Trigger: The share/download page HTML contains no data assignments matching findDataReg — the page is an error template, a challenge page, a password prompt, or LanZou changed how data is embedded.

Common situations: Share link deleted or privatized; wrong share password flow reaching this function; LanZou frontend change moving data into JS variables or fetch calls; rate-limited response body.

Related errors


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/720fd73839a76f27. Report an issue: GitHub.