{"record":{"id":"a39215b4ac035392","repo":"AlistGo/alist","slug":"download-url-is-empty","errorCode":null,"errorMessage":"download url is empty","messagePattern":"download url is empty","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/yunpan360/driver.go","lineNumber":139,"sourceCode":"\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif !resp.GetHasNextPage() {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn objs, nil\n}\n\nfunc (d *Yunpan360) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) {\n\tif d.authMode() == authTypeCookie {\n\t\tresp, err := d.cookieDownloadURL(ctx, file)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdownloadURL := strings.TrimSpace(resp.GetURL())\n\t\tif downloadURL == \"\" {\n\t\t\treturn nil, errors.New(\"download url is empty\")\n\t\t}\n\t\treturn &model.Link{\n\t\t\tURL: downloadURL,\n\t\t\tHeader: map[string][]string{\n\t\t\t\t\"Accept\":  {\"text/javascript, text/html, application/xml, text/xml, */*\"},\n\t\t\t\t\"Origin\":  {baseURL},\n\t\t\t\t\"Referer\": {baseURL + indexPath},\n\t\t\t},\n\t\t}, nil\n\t}\n\tif d.authMode() != authTypeAPIKey {\n\t\treturn nil, errs.NotImplement\n\t}\n\n\tresp, err := d.openDownloadURL(ctx, file)\n\tif err != nil {\n\t\treturn nil, err\n\t}","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/yunpan360/driver.go#L121-L157","documentation":"Thrown by Yunpan360 Link() in cookie mode: the web scrape endpoint cookieDownloadURL responded without a transport error, but the extracted URL (resp.GetURL(), trimmed) is empty. The driver refuses to return a Link with no URL. The returned link would carry browser-session headers (Accept/Origin/Referer) since the URL is only valid with them, which is why WebProxy is forced on in this mode.","triggerScenarios":"Requesting a download link while the session cookie has degraded (server returns a login/interstitial HTML page that parses but contains no URL), the file's download endpoint returns an empty url field, or the web API changed its response shape so GetURL() no longer finds the field.","commonSituations":"Cookie expired or partially invalidated (list still works, downloads don't); files that require VIP/permission so the web player returns no direct URL; 360 changed the web endpoint; rate-limited download-link requests.","solutions":["Refresh the cookie: log in to yunpan.360.cn again and update the storage config","Retry the link request — transient empty responses occur under rate limiting","If it persists for specific files only, check whether those files need VIP or are restricted","Consider switching the storage to auth_type=api_key, whose download path returns a cleaner URL"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"link, err := d.Link(ctx, file, args)\nif err != nil {\n    if strings.Contains(err.Error(), \"download url is empty\") && d.authMode() == authTypeCookie {\n        // session likely degraded: prompt for cookie refresh, retry once\n        return nil, fmt.Errorf(\"yunpan360 cookie session needs refresh: %w\", err)\n    }\n    return nil, err\n}","preventionTips":["Refresh the browser cookie proactively on a schedule — list calls often outlive download auth","Keep WebProxy enabled for cookie mode so browser headers are forwarded","Prefer api_key mode for download-heavy workloads"],"tags":["yunpan360","driver","download-link","cookie","web-scrape","validation"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}