AlistGo/alist · error

download url is empty

Error message

download url is empty

What it means

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.

Source

Thrown at drivers/yunpan360/driver.go:139

			}
			continue
		}
		if !resp.GetHasNextPage() {
			break
		}
	}
	return objs, nil
}

func (d *Yunpan360) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) {
	if d.authMode() == authTypeCookie {
		resp, err := d.cookieDownloadURL(ctx, file)
		if err != nil {
			return nil, err
		}
		downloadURL := strings.TrimSpace(resp.GetURL())
		if downloadURL == "" {
			return nil, errors.New("download url is empty")
		}
		return &model.Link{
			URL: downloadURL,
			Header: map[string][]string{
				"Accept":  {"text/javascript, text/html, application/xml, text/xml, */*"},
				"Origin":  {baseURL},
				"Referer": {baseURL + indexPath},
			},
		}, nil
	}
	if d.authMode() != authTypeAPIKey {
		return nil, errs.NotImplement
	}

	resp, err := d.openDownloadURL(ctx, file)
	if err != nil {
		return nil, err
	}

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Refresh the cookie: log in to yunpan.360.cn again and update the storage config
  2. Retry the link request — transient empty responses occur under rate limiting
  3. If it persists for specific files only, check whether those files need VIP or are restricted
  4. Consider switching the storage to auth_type=api_key, whose download path returns a cleaner URL
Defensive patterns

Strategy: retry

Try / catch

link, err := d.Link(ctx, file, args)
if err != nil {
    if strings.Contains(err.Error(), "download url is empty") && d.authMode() == authTypeCookie {
        // session likely degraded: prompt for cookie refresh, retry once
        return nil, fmt.Errorf("yunpan360 cookie session needs refresh: %w", err)
    }
    return nil, err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/a39215b4ac035392. Report an issue: GitHub.