{"record":{"id":"720fd73839a76f27","repo":"AlistGo/alist","slug":"not-find-data","errorCode":null,"errorMessage":"not find data","messagePattern":"not find data","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/lanzou/help.go","lineNumber":253,"sourceCode":"\t\tdata := html[index[0]:index[1]]\n\t\tif regexp.MustCompile(`function\\s+` + name + `[()\\s]+{`).MatchString(data) {\n\t\t\treturn data, nil\n\t\t}\n\t}\n\treturn \"\", fmt.Errorf(\"not find %s function\", name)\n}\n\n// 解析html中的JSON,选择最长的数据\nfunc htmlJsonToMap2(html string) (map[string]string, error) {\n\tdatas := findDataReg.FindAllStringSubmatch(html, -1)\n\tvar sData string\n\tfor _, data := range datas {\n\t\tif len(datas) > 0 && len(data[1]) > len(sData) {\n\t\t\tsData = data[1]\n\t\t}\n\t}\n\tif sData == \"\" {\n\t\treturn nil, fmt.Errorf(\"not find data\")\n\t}\n\treturn jsonToMap(sData, html), nil\n}\n\n// 解析html中的JSON\nfunc htmlJsonToMap(html string) (map[string]string, error) {\n\tdatas := findDataReg.FindStringSubmatch(html)\n\tif len(datas) != 2 {\n\t\treturn nil, fmt.Errorf(\"not find data\")\n\t}\n\treturn jsonToMap(datas[1], html), nil\n}\n\nfunc jsonToMap(data, html string) map[string]string {\n\tvar param = make(map[string]string)\n\tkvs := findKVReg.FindAllStringSubmatch(data, -1)\n\tfor _, kv := range kvs {\n\t\tk, v := kv[1], kv[3]","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/lanzou/help.go#L235-L271","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the share link still opens normally in a browser","If the share needs a password, ensure the password is provided in the storage/link config so the correct flow runs","Update OpenList to pick up lanzou parser fixes; report the HTML if already current"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func hasLanzouDataBlob(html string) bool {\n    return findDataReg.MatchString(html)\n}","tryCatchPattern":"m, err := htmlJsonToMap2(html)\nif err != nil {\n    if !hasLanzouDataBlob(html) {\n        // error/challenge template: retrying blindly will not help\n        return nil, fmt.Errorf(\"unexpected lanzou page (deleted or challenge): %w\", err)\n    }\n    return nil, err\n}","preventionTips":["Validate share links open in a browser before adding to automations","Provide share passwords where required so the correct page variant is served","Detect deleted-share error text early and stop retrying"],"tags":["lanzou","scraping","parsing","dom-change","openlist"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}