AlistGo/alist · error
not find file id
Error message
not find file id
What it means
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.
Source
Thrown at drivers/lanzou/util.go:402
// 需要密码
if strings.Contains(sharePageData, "pwdload") || strings.Contains(sharePageData, "passwddiv") {
sharePageData, err := getJSFunctionByName(sharePageData, "down_p")
if err != nil {
return nil, err
}
param, err := htmlJsonToMap(sharePageData)
if err != nil {
return nil, err
}
param["p"] = pwd
fileIDs := findFileIDReg.FindStringSubmatch(sharePageData)
var fileID string
if len(fileIDs) > 1 {
fileID = fileIDs[1]
} else {
return nil, fmt.Errorf("not find file id")
}
var resp FileShareInfoAndUrlResp[string]
_, err = d.post(d.ShareUrl+"/ajaxm.php?file="+fileID, func(req *resty.Request) { req.SetFormData(param) }, &resp)
if err != nil {
return nil, err
}
file.NameAll = resp.Inf
file.Pwd = pwd
baseUrl = resp.GetBaseUrl()
downloadUrl = resp.GetDownloadUrl()
} else {
urlpaths := findDownPageParamReg.FindStringSubmatch(sharePageData)
if len(urlpaths) != 2 {
log.Errorf("lanzou: err => not find file page param ,data => %s\n", sharePageData)
return nil, fmt.Errorf("not find file page param")
}
nextPageData, err := d.getHtml(fmt.Sprint(d.ShareUrl, urlpaths[1]), nil)
if err != nil {View on GitHub (pinned to 843d9dc814)
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
Defensive patterns
Strategy: validation
Validate before calling
// Ensure the link is a FILE share before the download flow
if !findFileIDReg.MatchString(sharePageData) && !looksLikeFilePage(sharePageData) {
return nil, fmt.Errorf("link does not expose a file id (folder or deleted share?)")
} Type guard
func hasLanzouFileID(html string) bool {
return len(findFileIDReg.FindStringSubmatch(html)) > 1
} Try / catch
if err := d.getFileLink(...); err != nil && strings.Contains(err.Error(), "not find file id") {
return nil, fmt.Errorf("share URL is not a downloadable file link (deleted/folder?): %w", err)
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- not find %s function
- not find data
- not find file sgin
- 无法匹配acw_sc__v2
- dynamic: fmt.Errorf(info) - message passthrough from API 'in
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/e9038c312c1e25f5.
Report an issue: GitHub.