{"record":{"id":"e9038c312c1e25f5","repo":"AlistGo/alist","slug":"not-find-file-id","errorCode":null,"errorMessage":"not find file id","messagePattern":"not find file id","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/lanzou/util.go","lineNumber":402,"sourceCode":"\n\t// 需要密码\n\tif strings.Contains(sharePageData, \"pwdload\") || strings.Contains(sharePageData, \"passwddiv\") {\n\t\tsharePageData, err := getJSFunctionByName(sharePageData, \"down_p\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparam, err := htmlJsonToMap(sharePageData)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparam[\"p\"] = pwd\n\n\t\tfileIDs := findFileIDReg.FindStringSubmatch(sharePageData)\n\t\tvar fileID string\n\t\tif len(fileIDs) > 1 {\n\t\t\tfileID = fileIDs[1]\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"not find file id\")\n\t\t}\n\t\tvar resp FileShareInfoAndUrlResp[string]\n\t\t_, err = d.post(d.ShareUrl+\"/ajaxm.php?file=\"+fileID, func(req *resty.Request) { req.SetFormData(param) }, &resp)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfile.NameAll = resp.Inf\n\t\tfile.Pwd = pwd\n\t\tbaseUrl = resp.GetBaseUrl()\n\t\tdownloadUrl = resp.GetDownloadUrl()\n\t} else {\n\t\turlpaths := findDownPageParamReg.FindStringSubmatch(sharePageData)\n\t\tif len(urlpaths) != 2 {\n\t\t\tlog.Errorf(\"lanzou: err => not find file page param ,data => %s\\n\", sharePageData)\n\t\t\treturn nil, fmt.Errorf(\"not find file page param\")\n\t\t}\n\t\tnextPageData, err := d.getHtml(fmt.Sprint(d.ShareUrl, urlpaths[1]), nil)\n\t\tif err != nil {","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/lanzou/util.go#L384-L420","documentation":"While resolving a password-protected LanZou share, the driver could not extract the numeric file id from the share page HTML (findFileIDReg found no match), so it cannot build the /ajaxm.php?file=<id> request URL.","triggerScenarios":"The share page variant returned for this link does not contain the expected JS fragment carrying the file id — e.g. a folder share treated as a file, a deleted link, a challenge page, or a template change.","commonSituations":"Using a folder share link where a file link is required (or vice versa); share deleted/made private; LanZou frontend update moving the id into a different script structure; password flow changed so the pre-password page differs.","solutions":["Open the share URL in a browser and confirm it points to a downloadable file (not a folder listing) and still exists","If it is a folder link, navigate to the specific file's share page and use that URL","Retry with the correct password early, and update OpenList for parser fixes if the page structure changed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Ensure the link is a FILE share before the download flow\nif !findFileIDReg.MatchString(sharePageData) && !looksLikeFilePage(sharePageData) {\n    return nil, fmt.Errorf(\"link does not expose a file id (folder or deleted share?)\")\n}","typeGuard":"func hasLanzouFileID(html string) bool {\n    return len(findFileIDReg.FindStringSubmatch(html)) > 1\n}","tryCatchPattern":"if err := d.getFileLink(...); err != nil && strings.Contains(err.Error(), \"not find file id\") {\n    return nil, fmt.Errorf(\"share URL is not a downloadable file link (deleted/folder?): %w\", err)\n}","preventionTips":["Use direct file share URLs, not folder listing URLs, for download automation","Verify shares in a browser and prune dead links regularly","Provide the correct password so the pre-file page contains the id fragment"],"tags":["lanzou","scraping","share-link","parsing","openlist"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}