{"record":{"id":"1d2b16c079cfb36a","repo":"AlistGo/alist","slug":"cannot-get-link-from-cdn","errorCode":null,"errorMessage":"cannot get link from cdn","messagePattern":"cannot get link from cdn","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/quqi/util.go","lineNumber":227,"sourceCode":"\t\t\t\"Cookie\": []string{d.Cookie},\n\t\t},\n\t}, nil\n}\n\nfunc (d *Quqi) linkFromCDN(id string) (*model.Link, error) {\n\tdownloadLink, err := d.linkFromDownload(id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar urlExchangeResp UrlExchangeResp\n\tif _, err = d.request(\"api.quqi.com\", \"/preview/downloadInfo/url/exchange\", resty.MethodGet, func(req *resty.Request) {\n\t\treq.SetQueryParam(\"url\", downloadLink.URL)\n\t}, &urlExchangeResp); err != nil {\n\t\treturn nil, err\n\t}\n\tif urlExchangeResp.Data.Url == \"\" {\n\t\treturn nil, errors.New(\"cannot get link from cdn\")\n\t}\n\n\t// 假设存在未加密的情况\n\tif !urlExchangeResp.Data.IsEncrypted {\n\t\treturn &model.Link{\n\t\t\tURL: urlExchangeResp.Data.Url,\n\t\t\tHeader: http.Header{\n\t\t\t\t\"Origin\": []string{\"https://quqi.com\"},\n\t\t\t\t\"Cookie\": []string{d.Cookie},\n\t\t\t},\n\t\t}, nil\n\t}\n\n\t// 根据sio(https://github.com/minio/sio/blob/master/DARE.md)描述及实际测试，得出以下结论：\n\t// 1. 加密后大小(encrypted_size)-原始文件大小(size) = 加密包的头大小+身份验证标识 = (16+16) * N  ->  N为加密包的数量\n\t// 2. 原始文件大小(size)+64*1024-1 / (64*1024) = N  ->  每个包的有效负载为64K\n\tremoteClosers := utils.EmptyClosers()\n\tpayloadSize := int64(1 << 16)","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/quqi/util.go#L209-L245","documentation":"Error \"cannot get link from cdn\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at drivers/quqi/util.go:227 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the storage configuration and the provider's service status, fix the indicated cause, and retry the operation."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}