iawia002/lux · error

404 music not found

Error message

404 music not found

What it means

Thrown by the NetEase extractor after it successfully downloads the page HTML for a music.163.com /mv?id=... or /video?id=... URL. If the HTML contains the marker 'u-errlg-404' (the element NetEase renders on its 404 page), the item is considered missing and this error is returned. It means the HTTP request itself worked, but NetEase's own page says the content does not exist.

Source

Thrown at extractors/netease/netease.go:38

// New returns a netease extractor.
func New() extractors.Extractor {
	return &extractor{}
}

// Extract is the main function to extract the data.
func (e *extractor) Extract(url string, option extractors.Options) ([]*extractors.Data, error) {
	url = strings.Replace(url, "/#/", "/", 1)
	vid := utils.MatchOneOf(url, `/(mv|video)\?id=(\w+)`)
	if vid == nil {
		return nil, errors.New("invalid url for netease music")
	}

	html, err := request.Get(url, url, nil)
	if err != nil {
		return nil, errors.WithStack(err)
	}
	if strings.Contains(html, "u-errlg-404") {
		return nil, errors.New("404 music not found")
	}

	titles := utils.MatchOneOf(html, `<meta property="og:title" content="(.+?)" />`)
	if titles == nil || len(titles) < 2 {
		return nil, errors.WithStack(extractors.ErrURLParseFailed)
	}
	title := titles[1]

	realURLs := utils.MatchOneOf(html, `<meta property="og:video" content="(.+?)" />`)
	if realURLs == nil || len(realURLs) < 2 {
		return nil, errors.WithStack(extractors.ErrURLParseFailed)
	}
	realURL, _ := netURL.QueryUnescape(realURLs[1])

	size, err := request.Size(realURL, url)
	if err != nil {
		return nil, errors.WithStack(err)
	}

View on GitHub (pinned to dd00f6d258)

Solutions

  1. Open the same URL in a browser and confirm the MV actually exists; if it 404s there too, remove the URL from your input
  2. Verify the id captured by the /(mv|video)\?id=(\w+) regex matches the intended MV (print it before calling Extract)
  3. If the video exists but is region-locked, retry from an appropriate network or accept it as unavailable
  4. In batch downloaders, catch this specific message and skip the URL instead of aborting the run

Example fix

// before
_, err := extractor.Extract(deadNeteaseURL, opts)
if err != nil { return err } // aborts whole batch

// after
_, err := extractor.Extract(neteaseURL, opts)
if err != nil && strings.Contains(err.Error(), "404 music not found") {
    log.Printf("skipping dead track %s", neteaseURL)
    continue
}
Defensive patterns

Strategy: try-catch

Validate before calling

var neteaseIDRe = regexp.MustCompile(`/(mv|video)\?id=\w+`)

func isNeteaseCandidateURL(raw string) bool {
    return neteaseIDRe.MatchString(strings.Replace(raw, "/#/", "/", 1))
}

Try / catch

_, err := netease.Extract(url, opts)
if err != nil {
    if strings.Contains(err.Error(), "404 music not found") {
        // content gone; skip, do not retry
    }
    if strings.Contains(err.Error(), "invalid url for netease music") {
        // fix the URL shape
    }
    return err
}

Prevention

When it happens

Trigger: Calling Extract with a URL whose id parameter refers to a deleted or removed MV (e.g. https://music.163.com/?#/mv?id=XXX where XXX no longer exists), or an id typo'd so the page renders the 404 layout. The URL passed the initial /(mv|video)\?id=(\w+) shape check, but the fetched HTML contains 'u-errlg-404'.

Common situations: MV taken down for copyright reasons, region-locked MV serving the 404 layout to foreign IPs, or a mistyped/garbled id in a script-generated URL list. Batch jobs scraping playlists hit this on dead links.

Related errors


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