{"record":{"id":"4c0f62daa1a4673b","repo":"AlistGo/alist","slug":"baidu-youth-list-metadata-incomplete-for-s","errorCode":null,"errorMessage":"baidu youth list metadata incomplete for %s","messagePattern":"baidu youth list metadata incomplete for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/baidu_youth/util.go","lineNumber":357,"sourceCode":"func (d *BaiduYouth) resolveDownloadMeta(ctx context.Context, file model.Obj) (string, string, string, error) {\n\tparentDir := stdpath.Dir(file.GetPath())\n\tif parentDir == \".\" {\n\t\tparentDir = \"/\"\n\t}\n\n\tfiles, err := d.getFiles(ctx, parentDir)\n\tif err != nil {\n\t\treturn \"\", \"\", \"\", err\n\t}\n\tfor _, listedFile := range files {\n\t\tif listedFile.Path != file.GetPath() {\n\t\t\tcontinue\n\t\t}\n\t\tfileID := strconv.FormatInt(listedFile.FsId, 10)\n\t\tif listedFile.Path != \"\" && fileID != \"\" && listedFile.Md5 != \"\" {\n\t\t\treturn listedFile.Path, fileID, listedFile.Md5, nil\n\t\t}\n\t\treturn \"\", \"\", \"\", fmt.Errorf(\"baidu youth list metadata incomplete for %s\", file.GetPath())\n\t}\n\treturn \"\", \"\", \"\", errs.NewErr(errs.ObjectNotFound, \"baidu youth list metadata not found: %s\", file.GetPath())\n}\n\nfunc normalizeLocatedownloadURL(rawURL string) (string, error) {\n\tif rawURL == \"\" {\n\t\treturn \"\", fmt.Errorf(\"baidu youth locatedownload url is empty\")\n\t}\n\tif !strings.Contains(rawURL, \"response-cache-control=\") {\n\t\tsep := \"&\"\n\t\tif !strings.Contains(rawURL, \"?\") {\n\t\t\tsep = \"?\"\n\t\t}\n\t\trawURL += sep + \"response-cache-control=private\"\n\t}\n\treturn rawURL, nil\n}\n","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/baidu_youth/util.go#L339-L375","documentation":"Returned by BaiduYouth.resolveDownloadMeta (drivers/baidu_youth/util.go:357): the file was found in the directory listing by path, but its entry is missing path, fs_id, or md5, so the trio needed to sign a locatedownload cannot be assembled. It indicates a truncated/unusual server listing rather than a missing file (a total miss returns the ObjectNotFound error below it).","triggerScenarios":"Listing returns a matching path whose Md5 is empty (folders, special files, or server-side redacted entries); concurrent deletion between list and resolve; API returning partial metadata for some entries.","commonSituations":"Calling Link on an object that is actually a directory; files Baidu keeps without md5 (streaming uploads still processing); race with a delete.","solutions":["Confirm the target of Link is a file, not a folder","Re-list the parent directory to refresh metadata and retry resolve","If md5 stays empty for that file, use the video dlink path (buildVideoLink) for media instead"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// resolve metadata from a fresh listing and require all fields before signing\nfiles, err := d.getFiles(ctx, parentDir)\nif err != nil {\n    return err\n}\nfor _, f := range files {\n    if f.Path == file.GetPath() && f.Path != \"\" && f.Md5 != \"\" && f.FsId != 0 {\n        return signAndServe(f)\n    }\n}\nreturn errs.NewErr(errs.ObjectNotFound, \"file %s lacks download metadata\", file.GetPath())","typeGuard":"func hasDownloadMeta(f File) bool {\n    return f.Path != \"\" && f.FsId != 0 && f.Md5 != \"\"\n}","tryCatchPattern":null,"preventionTips":["Never call Link on directories with this driver","Re-list the parent right before downloading instead of trusting old metadata","For files whose md5 stays empty, route to the video-dlink path"],"tags":["baidu-youth","metadata","download","go"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}