{"record":{"id":"9733ac25d9301650","repo":"AlistGo/alist","slug":"s-s-9733ac","errorCode":null,"errorMessage":" %s; %s; ","messagePattern":" %s; %s; ","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/baidu_share/driver.go","lineNumber":73,"sourceCode":"\t\t\tSeckey  string      `json:\"seckey\"`\n\t\t} `json:\"data\"`\n\t}{}\n\tresp, err := d.client.R().\n\t\tSetBody(url.Values{\n\t\t\t\"pwd\":      {d.Pwd},\n\t\t\t\"root\":     {\"1\"},\n\t\t\t\"shorturl\": {d.Surl},\n\t\t}.Encode()).\n\t\tSetResult(&respJson).\n\t\tPost(\"share/wxlist?channel=weixin&version=2.2.2&clienttype=25&web=1\")\n\tif err == nil {\n\t\tif resp.IsSuccess() && respJson.Errno == 0 {\n\t\t\td.info.Root = path.Dir(respJson.Data.List[0].Path)\n\t\t\td.info.Seckey = respJson.Data.Seckey\n\t\t\td.info.Shareid = respJson.Data.Shareid.String()\n\t\t\td.info.Uk = respJson.Data.Uk.String()\n\t\t} else {\n\t\t\terr = fmt.Errorf(\" %s; %s; \", resp.Status(), resp.Body())\n\t\t}\n\t}\n\treturn err\n}\n\nfunc (d *BaiduShare) Drop(ctx context.Context) error {\n\treturn nil\n}\n\nfunc (d *BaiduShare) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error) {\n\t// TODO return the files list, required\n\treqDir := dir.GetPath()\n\tisRoot := \"0\"\n\tif reqDir == d.RootFolderPath {\n\t\treqDir = path.Join(d.info.Root, reqDir)\n\t}\n\tif reqDir == d.info.Root {\n\t\tisRoot = \"1\"","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/baidu_share/driver.go#L55-L91","documentation":"Generic failure wrapper in BaiduShare.Init (drivers/baidu_share/driver.go:73): the share/wxlist call either returned a non-2xx status or errno != 0, and the driver reports the raw status plus body (' %s; %s; '). Init extracts root/seckey/shareid/uk from this response, so failure here means the share metadata could not be loaded at all.","triggerScenarios":"Mounting a BaiduShare storage whose surl is wrong/deleted/expired; rate limiting (errno 2) from too many share-info requests; share requiring a password not yet handled; WeChat-channel endpoint blocked.","commonSituations":"Typo in the share short URL; the share owner cancelled the share; hitting Baidu's anti-crawl limits from one IP; expired share links older than the retention window.","solutions":["Open the share URL in a browser to confirm it is still valid and does not need a password","Fix the surl value in the storage config (the code after the '1' prefix in the link)","Slow down requests / change IP if the body shows rate-limit errno","Include the response body text when reporting: it contains the errno that pinpoints the cause"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before mounting, confirm the share is live and extract surl correctly\n// share link https://pan.baidu.com/s/1AbCdEf -> surl is \"AbCdEf\" (drop the leading \"1\")\nif !strings.HasPrefix(surl, \"\") || len(surl) < 4 {\n    return fmt.Errorf(\"invalid baidu share surl\")\n}","typeGuard":null,"tryCatchPattern":"err := d.Init(ctx)\nif err != nil && strings.Contains(err.Error(), \";\") {\n    // error text is \"status; body;\" — surface the body so the errno is visible\n    return fmt.Errorf(\"baidu share init failed (check link validity/expiry): %w\", err)\n}","preventionTips":["Open the share URL in a browser before configuring the mount","Re-check the surl value (short code after /s/1) for typos","Rate-limit share-info calls from one IP; Baidu throttles aggressively"],"tags":["baidu-share","init","api","share-link"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}