iawia002/lux · error
Could not extract media name from page
Error message
Could not extract media name from page
What it means
Companion check on the same embed HTML: the extractor greps for video_name = "..." to title the stream. Thrown when that assignment is missing, usually for the same reasons the media URL fails (challenge page or template change). Note the regex's ["|'] character class also matches a literal pipe, which is a latent bug for titles containing |.
Source
Thrown at extractors/bitchute/bitchute.go:73
b, err := io.ReadAll(reader)
if err != nil {
return nil, errors.WithStack(err)
}
// There is also an API that provides meta data
// POST https://api.bitchute.com/api/beta9/video {"video_id": <video_id>}
html := string(b)
regMediaURL := regexp.MustCompile(`media_url\s*=\s*['|"](https:\/\/[^.]+\.bitchute\.com\/.*\.mp4)`)
matchMediaURL := regMediaURL.FindStringSubmatch(html)
if len(matchMediaURL) < 2 {
return nil, errors.New("Could not extract media URL from page")
}
mediaURL := matchMediaURL[1]
regVideoName := regexp.MustCompile(`(?m)video_name\s*=\s*["|']\\?"?(.*)["|'];?$`)
matchVideoName := regVideoName.FindStringSubmatch(html)
if len(matchVideoName) < 2 {
return nil, errors.New("Could not extract media name from page")
}
videoName := strings.ReplaceAll(matchVideoName[1], `\"`, "")
streams := make(map[string]*extractors.Stream, 1)
size, err := request.Size(mediaURL, u)
if err != nil {
return nil, errors.WithStack(err)
}
streams["Default"] = &extractors.Stream{
Parts: []*extractors.Part{
{
URL: mediaURL,
Size: size,
Ext: "mp4",
},
},
Size: size,
Quality: "Default",View on GitHub (pinned to dd00f6d258)
Solutions
- Triage exactly as for 'Could not extract media URL from page': verify the embed page in a browser and retry with a clean session.
- Fetch the title from the beta9 video API (POST https://api.bitchute.com/api/beta9/video) instead of the embed HTML.
- Tighten the regex — replace the buggy ["|'] class with ('|') style alternation and re-test.
Example fix
// before
regVideoName := regexp.MustCompile(`(?m)video_name\s*=\s*["|']\\?"?(.*)["|'];$`)
// after — explicit quote alternation, no literal pipe
regVideoName := regexp.MustCompile(`(?m)video_name\s*=\s*('([^']*)'|"([^"]*)")`) Defensive patterns
Strategy: try-catch
Type guard
func isMediaNameMissing(err error) bool {
return err != nil && strings.Contains(err.Error(), "Could not extract media name")
} Try / catch
Catch and substitute a default title (the name is only used for the output file name) — e.g. fall back to the video id — then continue. Re-raise any other error.
Prevention
- Treat title extraction as best-effort: never let a naming miss block a download
- Prefer structured metadata (beta9 API) over scraping the embed HTML
- When editing the regex, remember ["|'] also matches a literal pipe character
When it happens
Trigger: An anti-bot page that still exposes media_url but not video_name; a template migration renaming the variable; titles whose quoting does not fit the ["|'] class or the optional backslash-quote prefix.
Common situations: Same contexts as the media-URL failure; videos with unusual titles; long-running scrapers after a BitChute update.
Related errors
- Could not extract media URL from page
- this page has no playlist
- could not find video in page
- Invalid video URL: Missing video ID parameter
- ErrURLParseFailed
AI-assisted analysis of iawia002/lux@dd00f6d258 (2026-08-15).
Data as JSON: /api/errors/40b65b65e78cc387.
Report an issue: GitHub.