iawia002/lux · error

youkuData.Data.Error.Note

Error message

youkuData.Data.Error.Note

What it means

The Youku extractor calls youkuUps(vid, option), which resolves a utid from the 'cna' cookie (or fetches one) and queries ups.youku.com get.json with ccode/ckey parameters. If the UPS response carries Data.Error.Code != 0, Youku's own ErrorMsg/Note becomes the error. It means the whole exchange succeeded but Youku refused to hand out stream data for this vid.

Source

Thrown at extractors/youku/youku.go:233

	return &extractor{}
}

// Extract is the main function to extract the data.
func (e *extractor) Extract(url string, option extractors.Options) ([]*extractors.Data, error) {
	vids := utils.MatchOneOf(
		url, `id_(.+?)\.html`, `id_(.+)`,
	)
	if vids == nil || len(vids) < 2 {
		return nil, errors.WithStack(extractors.ErrURLParseFailed)
	}
	vid := vids[1]

	youkuData, err := youkuUps(vid, option)
	if err != nil {
		return nil, errors.WithStack(err)
	}
	if youkuData.Data.Error.Code != 0 {
		return nil, errors.New(youkuData.Data.Error.Note)
	}
	streams := genData(youkuData.Data)
	var title string
	if youkuData.Data.Show.Title == "" || strings.Contains(
		youkuData.Data.Video.Title, youkuData.Data.Show.Title,
	) {
		title = youkuData.Data.Video.Title
	} else {
		title = fmt.Sprintf("%s %s", youkuData.Data.Show.Title, youkuData.Data.Video.Title)
	}

	return []*extractors.Data{
		{
			Site:    "优酷 youku.com",
			Title:   title,
			Type:    extractors.DataTypeVideo,
			Streams: streams,
			URL:     url,

View on GitHub (pinned to dd00f6d258)

Solutions

  1. Pass a real browser session cookie containing cna=... via extractors.Options.Cookie
  2. Override the ccode/ckey via the YoukuCcode and YoukuCkey options (CLI flags --youku-ccode / --youku-ckey) with values captured from a working browser session
  3. Confirm the video plays on v.youku.com in a browser from the same network and without VIP if it is member content
  4. If ErrorNote says the video does not exist, drop the URL; if it mentions rights/region, use an appropriate network

Example fix

// before
options := extractors.Options{} // no cookie, default ccode/ckey
_, err := youku.Extract(url, options)

// after
options := extractors.Options{
    Cookie:     "cna=YOUR_CNA_FROM_BROWSER; ...",
    YoukuCcode: "0510",
    YoukuCkey:  "YOUR_CAPTURED_CKEY",
}
_, err := youku.Extract(url, options)
Defensive patterns

Strategy: try-catch

Try / catch

_, err := youku.Extract(url, opts)
if err != nil {
    if strings.Contains(err.Error(), "ckey") || strings.Contains(err.Error(), "版权") || strings.Contains(err.Error(), "地区") {
        // auth/geo refusal: refresh cna cookie + ccode/ckey options, retry once
        opts.Cookie = freshCookie()
        opts.YoukuCkey = freshCkey()
        _, err = youku.Extract(url, opts)
    }
    return err
}

Prevention

When it happens

Trigger: Missing or stale cna cookie so the utid sent to UPS is empty/invalid; the default YoukuCcode/YoukuCkey combination being rejected by UPS; deleted or copyright-removed videos; region-restricted content; member-only videos requested without a VIP session.

Common situations: Running without any Youku cookies; Youku rotating ckey requirements so the built-in pair stops working; non-mainland IPs being denied certain titles. This is the classic lux+Youku failure mode and usually needs fresh cookies/options.

Related errors


AI-assisted analysis of iawia002/lux@dd00f6d258 (2026-08-15). Data as JSON: /api/errors/58bd0011238d7b78. Report an issue: GitHub.