{"record":{"id":"700fd6fc23a25481","repo":"AlistGo/alist","slug":"share-ids-is-required","errorCode":null,"errorMessage":"share_ids is required","messagePattern":"share_ids is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/123_open/other.go","lineNumber":355,"sourceCode":"\tTrafficLimitSwitch int     `json:\"traffic_limit_switch\"`\n\tTrafficLimit       int64   `json:\"traffic_limit\"`\n}\n\ntype shareListArgs struct {\n\tLimit       int   `json:\"limit\"`\n\tLastShareID int64 `json:\"last_share_id\"`\n}\n\ntype shareUpdateArgs struct {\n\tShareIDs           []int64 `json:\"share_ids\"`\n\tTrafficSwitch      int     `json:\"traffic_switch\"`\n\tTrafficLimitSwitch int     `json:\"traffic_limit_switch\"`\n\tTrafficLimit       int64   `json:\"traffic_limit\"`\n}\n\nfunc (a shareUpdateArgs) toRequest() (*pan123.ShareUpdateRequest, error) {\n\tif len(a.ShareIDs) == 0 {\n\t\treturn nil, errors.New(\"share_ids is required\")\n\t}\n\treturn &pan123.ShareUpdateRequest{\n\t\tShareIDs:           a.ShareIDs,\n\t\tTrafficSwitch:      pan123.TrafficSwitch(a.TrafficSwitch),\n\t\tTrafficLimitSwitch: a.TrafficLimitSwitch,\n\t\tTrafficLimit:       a.TrafficLimit,\n\t}, nil\n}\n\nfunc otherShareCreate(d *Open123, ctx context.Context, args model.OtherArgs) (interface{}, error) {\n\tvar req shareCreateArgs\n\tif err := decodeOtherArgs(args.Data, &req); err != nil {\n\t\treturn nil, err\n\t}\n\tfileIDs, err := resolveFileIDs(args, req.FileIDs)\n\tif err != nil {\n\t\treturn nil, err\n\t}","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/123_open/other.go#L337-L373","documentation":"Wrapped error from XunLeiCommon's offline task listing (drivers/thunder/driver.go:644) when the GET to TASK_API_URL (type=offline, limit=10000) fails at the transport/request layer or the common Request helper returns an error. The %w preserves the underlying cause (network failure, expired captcha token surfacing as an API error, auth loss).","triggerScenarios":"Listing offline (XunLei/Thunder) download tasks when the session token expired, the captchaToken became invalid (they rotate), the device/signature was invalidated, or plain network errors reaching the Thunder API host.","commonSituations":"After the XunLei session ages out (re-login needed); after triggering anti-abuse (invalid captcha token from repeated requests); server sleep/wake changing device fingerprint; API endpoint changes in the thunder driver.","solutions":["Retry after re-initializing/re-logging the Thunder/XunLei storage (refreshes tokens and captcha token).","Inspect the wrapped cause with errors.Unwrap — if it is a captcha-token error, force the verify flow before listing again.","Check network reachability of the Thunder API endpoints from the host.","Update to a current driver version if Thunder changed endpoints or parameters."],"exampleFix":"// before\ntasks, err := xc.GetOfflineTasks(ctx, token)\nif err != nil {\n\treturn err\n}\n\n// after\ntasks, err := xc.GetOfflineTasks(ctx, token)\nif err != nil {\n\tif isAuthOrCaptchaErr(errors.Unwrap(err)) {\n\t\tif e := xc.refreshSession(ctx); e != nil {\n\t\t\treturn e\n\t\t}\n\t\ttasks, err = xc.GetOfflineTasks(ctx, token)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":"func isOfflineListErr(err error) bool {\n\treturn err != nil && strings.Contains(err.Error(), \"failed to get offline list\")\n}","tryCatchPattern":"tasks, err := xc.GetOfflineTasks(ctx, token)\nif isOfflineListErr(err) {\n\tif isAuthOrCaptchaErr(errors.Unwrap(err)) {\n\t\t_ = xc.refreshSession(ctx)\n\t\ttasks, err = xc.GetOfflineTasks(ctx, token)\n\t}\n}","preventionTips":["Refresh the XunLei session/captcha token on a schedule.","Unwrap and inspect the cause before retrying blindly.","Keep the driver updated for Thunder endpoint changes."],"tags":["thunder","xunlei","offline-tasks","auth"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}