iawia002/lux · error

data.Message

Error message

data.Message

What it means

After the YinYueTai getMvInfo API responds and the JSON is unmarshalled, a top-level Error flag of true means the API itself rejected the request; the API's own Message field becomes the error text. This is an application-level error from YinYueTai, not a transport or parse failure.

Source

Thrown at extractors/yinyuetai/yinyuetai.go:61

	if vid == nil || len(vid) < 2 {
		return nil, errors.New("invalid url for yinyuetai")
	}
	params := fmt.Sprintf("videoId=%s", vid[1])
	// generate api url
	apiURL := genAPI(actionGetMvInfo, params)
	var err error
	html, err := request.Get(apiURL, url, nil)
	if err != nil {
		return nil, errors.WithStack(err)
	}
	// parse yinyuetai data
	data := yinyuetaiMvData{}
	if err = json.Unmarshal([]byte(html), &data); err != nil {
		return nil, errors.WithStack(extractors.ErrURLParseFailed)
	}
	// handle api error
	if data.Error {
		return nil, errors.New(data.Message)
	}
	if data.VideoInfo.CoreVideoInfo.Error {
		return nil, errors.New(data.VideoInfo.CoreVideoInfo.ErrorMsg)
	}
	title := data.VideoInfo.CoreVideoInfo.VideoName
	streams := make(map[string]*extractors.Stream, len(data.VideoInfo.CoreVideoInfo.VideoURLModels))
	// set streams
	for _, model := range data.VideoInfo.CoreVideoInfo.VideoURLModels {
		urlData := &extractors.Part{
			URL:  model.VideoURL,
			Size: model.FileSize,
			Ext:  "mp4",
		}
		streams[model.QualityLevel] = &extractors.Stream{
			Parts:   []*extractors.Part{urlData},
			Size:    model.FileSize,
			Quality: model.QualityLevelName,
		}

View on GitHub (pinned to dd00f6d258)

Solutions

  1. Open the video page in a browser and confirm the MV still exists and plays from your region
  2. Try the alternate URL form (video/h5/<id> or m2 video.html?id=) which resolves to the same id — if the id is valid the API call should succeed
  3. Print data.Msg from the API response to see YinYueTai's own reason and act on it
  4. Skip the URL in batch runs when the API consistently reports errors for it

Example fix

// before
_, err := yinyuetai.Extract(url, opts)
if err != nil { return err }

// after
_, err := yinyuetai.Extract(url, opts)
if err != nil {
    log.Printf("yinyuetai API rejected %s: %v", url, err)
    if strings.Contains(err.Error(), "不存在") || strings.Contains(err.Error(), "not exist") {
        continue // dead MV, skip
    }
    return err
}
Defensive patterns

Strategy: try-catch

Try / catch

_, err := yinyuetai.Extract(url, opts)
if err != nil {
    // err.Error() is the API's own Message; treat non-empty Message as terminal
    if strings.Contains(err.Error(), "invalid url") {
        // URL shape problem: fix input
    } else {
        // API refusal (dead/geo MV): skip
    }
    return err
}

Prevention

When it happens

Trigger: The videoId extracted from the URL is invalid or deleted, the MV is geo-restricted, or YinYueTai's API error envelope changed so Error is set on otherwise-fine responses.

Common situations: Dead MV links in old playlists; API behavior drift after site updates; ids that only resolve for logged-in or mainland users.

Related errors


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