{"record":{"id":"f2a1bc488f8ab9bd","repo":"iawia002/lux","slug":"errurlparsefailed","errorCode":"ErrURLParseFailed","errorMessage":"url parse failed","messagePattern":"url parse failed","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"extractors/errors.go","lineNumber":9,"sourceCode":"package extractors\n\nimport (\n\t\"errors\"\n)\n\nvar (\n\t// ErrURLParseFailed defines url parse failed error.\n\tErrURLParseFailed            = errors.New(\"url parse failed\")\n\tErrInvalidRegularExpression  = errors.New(\"invalid regular expression\")\n\tErrURLQueryParamsParseFailed = errors.New(\"url query params parse failed\")\n\tErrBodyParseFailed           = errors.New(\"body parse failed\")\n)\n","sourceCodeStart":1,"sourceCodeEnd":14,"githubUrl":"https://github.com/iawia002/lux/blob/dd00f6d258d80b6684a0b9402d7124e5c18ef42f/extractors/errors.go#L1-L14","documentation":"Shared sentinel in extractors/errors.go, wrapped with a stack trace by ~30 throw sites across the codebase (douyu, bilibili, netease, twitter, tiktok, qq, youku, rumble, and many more) whenever an extractor's regex over the URL or the fetched HTML fails. It means 'the page or URL did not look like what this extractor expects' — not a network failure.","triggerScenarios":"Site layout changes breaking HTML regexes (title/meta/script matching); login-walled, region-locked or anti-bot pages served instead of real content; URLs that do not match the extractor's expected id pattern for that site.","commonSituations":"Extractor goes stale after a site redesign; scraping from datacenter IPs; wrong, truncated or hand-typed URLs.","solutions":["Identify which extractor raised it — the errors.WithStack trace or errors.Is against the sentinel tells you — and open that exact URL in an incognito browser.","If the page requires login or serves a challenge, supply a cookie (lux -c) or a different egress IP.","Update the specific failing regex in that extractor to the site's current HTML/URL shape."],"exampleFix":"// identify the sentinel across wrapped stacks\nif errors.Is(err, extractors.ErrURLParseFailed) {\n\tlog.Printf(\"site layout or URL not recognized: %v\", err)\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"func isURLParseFailed(err error) bool {\n\treturn errors.Is(err, extractors.ErrURLParseFailed)\n}","tryCatchPattern":"Check errors.Is(err, extractors.ErrURLParseFailed) after each Extract call; log the site and URL, skip the item, and continue the batch. The stack attached by errors.WithStack identifies which extractor's regex failed.","preventionTips":["Test target URLs in an incognito browser before batching them","Keep the library updated — stale regexes are the top cause of this sentinel","Supply cookies (-c) for login-walled or risk-controlled sites","Track the ErrURLParseFailed rate per site as an early signal of a layout change"],"tags":["extractors","sentinel-error","html-parsing","regex"],"backgroundTag":null,"analyzedSha":"dd00f6d258d80b6684a0b9402d7124e5c18ef42f","analyzedAt":"2026-08-15T16:57:31.080Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}