iawia002/lux · error

ErrURLQueryParamsParseFailed

ErrURLQueryParamsParseFailed

Error message

url query params parse failed

What it means

Sentinel meaning 'url query params parse failed'. Two throw sites exist: douyin.go:76, when neturl.Parse of the constructed aweme-detail API URL fails (effectively unreachable with the current hardcoded string), and rumble.go:107, when the page's application/ld+json script block cannot be matched — there the name is misleading, since it is actually a body-parse failure.

Source

Thrown at extractors/errors.go:11

package extractors

import (
	"errors"
)

var (
	// ErrURLParseFailed defines url parse failed error.
	ErrURLParseFailed            = errors.New("url parse failed")
	ErrInvalidRegularExpression  = errors.New("invalid regular expression")
	ErrURLQueryParamsParseFailed = errors.New("url query params parse failed")
	ErrBodyParseFailed           = errors.New("body parse failed")
)

View on GitHub (pinned to dd00f6d258)

Solutions

  1. For rumble, inspect the fetched page for a script[type=application/ld+json] block; if absent, update the readPayload regex.
  2. For douyin, log the constructed api string and confirm it is a valid absolute URL.
  3. Retry from a different IP or with a cookie if an anti-bot page was served.

Example fix

// before
matchPayload := utils.MatchOneOf(html, `\<script\stype=?"application\/ld\+json"?\>(.+?)\<\/script>`)
// after — simpler matcher, same semantics
matchPayload := utils.MatchOneOf(html, `<script[^>]*type="application/ld\+json"[^>]*>(.+?)</script>`)
Defensive patterns

Strategy: try-catch

Type guard

func isQueryParamsParseFailed(err error) bool {
	return errors.Is(err, extractors.ErrURLQueryParamsParseFailed)
}

Try / catch

Check with errors.Is; on rumble it almost always means the ld+json payload was missing from the page — retry once with a different session/IP, then dump the HTML for regex updating. On douyin it indicates a broken internal URL string, which is a code bug to report.

Prevention

When it happens

Trigger: Rumble: the video page has no script[type=application/ld+json] payload — template change, anti-bot page, or removed video. Douyin: only if the API URL string construction is broken by a code edit.

Common situations: Rumble template changes; scraping from blocked IPs; douyin string-building edits that break URL validity.

Related errors


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