iawia002/lux · error
暂不支持斗鱼直播
Error message
暂不支持斗鱼直播
What it means
The douyu extractor in this codebase supports recorded videos only. Any URL matching https?://www.douyu.com/(\S+) is classified as a live-room link and rejected up front with this Chinese message, which translates to 'Douyu live streaming is not supported yet'. No network request is made.
Source
Thrown at extractors/douyu/douyu.go:67
}
data = append(data, temp)
}
return data, totalSize, nil
}
type extractor struct{}
// New returns a douyu 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) {
var err error
liveVid := utils.MatchOneOf(url, `https?://www.douyu.com/(\S+)`)
if liveVid != nil {
return nil, errors.New("暂不支持斗鱼直播")
}
html, err := request.Get(url, url, nil)
if err != nil {
return nil, errors.WithStack(err)
}
titles := utils.MatchOneOf(html, `<title>(.*?)</title>`)
if titles == nil || len(titles) < 2 {
return nil, errors.WithStack(extractors.ErrURLParseFailed)
}
title := titles[1]
vids := utils.MatchOneOf(url, `https?://v.douyu.com/show/(\S+)`)
if vids == nil || len(vids) < 2 {
return nil, errors.WithStack(extractors.ErrURLParseFailed)
}
vid := vids[1]
View on GitHub (pinned to dd00f6d258)
Solutions
- Use the recorded video URL form (https://v.douyu.com/<id>) copied from the replay page, not the live room.
- For live rooms, use a tool that supports live-stream capture; this library intentionally rejects them.
Example fix
// before $ lux "https://www.douyu.com/12345" // after $ lux "https://v.douyu.com/show/abcdefgh"
Defensive patterns
Strategy: validation
Validate before calling
if utils.MatchOneOf(url, `https?://www\.douyu\.com/(\S+)`) != nil {
return errors.New("douyu live rooms are not supported; use a v.douyu.com recorded-video URL")
} Type guard
func isDouyuLiveRoom(url string) bool {
return utils.MatchOneOf(url, `https?://www\.douyu\.com/(\S+)`) != nil
} Prevention
- Filter input URLs by domain: only v.douyu.com links are extractable
- Keep a separate tool for live-room capture
- Document in job specs that www.douyu.com paths are rejected by design
When it happens
Trigger: Passing a live-room URL such as www.douyu.com/<roomId>, or any topic/subject page on the main domain, instead of a recorded-video link.
Common situations: Pasting a streamer's room link from a share button; assuming live VODs on the main domain are downloadable.
Related errors
- Invalid video URL: Missing video ID parameter
- unable to get video ID
- couldn't extract the media short code from the link
- invalid url for netease music
- invalid URL format
AI-assisted analysis of iawia002/lux@dd00f6d258 (2026-08-15).
Data as JSON: /api/errors/87bea4c300275943.
Report an issue: GitHub.