{"record":{"id":"87bea4c300275943","repo":"iawia002/lux","slug":"error","errorCode":null,"errorMessage":"暂不支持斗鱼直播","messagePattern":"暂不支持斗鱼直播","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"extractors/douyu/douyu.go","lineNumber":67,"sourceCode":"\t\t}\n\t\tdata = append(data, temp)\n\t}\n\treturn data, totalSize, nil\n}\n\ntype extractor struct{}\n\n// New returns a douyu extractor.\nfunc New() extractors.Extractor {\n\treturn &extractor{}\n}\n\n// Extract is the main function to extract the data.\nfunc (e *extractor) Extract(url string, option extractors.Options) ([]*extractors.Data, error) {\n\tvar err error\n\tliveVid := utils.MatchOneOf(url, `https?://www.douyu.com/(\\S+)`)\n\tif liveVid != nil {\n\t\treturn nil, errors.New(\"暂不支持斗鱼直播\")\n\t}\n\n\thtml, err := request.Get(url, url, nil)\n\tif err != nil {\n\t\treturn nil, errors.WithStack(err)\n\t}\n\ttitles := utils.MatchOneOf(html, `<title>(.*?)</title>`)\n\tif titles == nil || len(titles) < 2 {\n\t\treturn nil, errors.WithStack(extractors.ErrURLParseFailed)\n\t}\n\ttitle := titles[1]\n\n\tvids := utils.MatchOneOf(url, `https?://v.douyu.com/show/(\\S+)`)\n\tif vids == nil || len(vids) < 2 {\n\t\treturn nil, errors.WithStack(extractors.ErrURLParseFailed)\n\t}\n\tvid := vids[1]\n","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/iawia002/lux/blob/dd00f6d258d80b6684a0b9402d7124e5c18ef42f/extractors/douyu/douyu.go#L49-L85","documentation":"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.","triggerScenarios":"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.","commonSituations":"Pasting a streamer's room link from a share button; assuming live VODs on the main domain are downloadable.","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."],"exampleFix":"// before\n$ lux \"https://www.douyu.com/12345\"\n// after\n$ lux \"https://v.douyu.com/show/abcdefgh\"","handlingStrategy":"validation","validationCode":"if utils.MatchOneOf(url, `https?://www\\.douyu\\.com/(\\S+)`) != nil {\n\treturn errors.New(\"douyu live rooms are not supported; use a v.douyu.com recorded-video URL\")\n}","typeGuard":"func isDouyuLiveRoom(url string) bool {\n\treturn utils.MatchOneOf(url, `https?://www\\.douyu\\.com/(\\S+)`) != nil\n}","tryCatchPattern":null,"preventionTips":["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"],"tags":["douyu","unsupported","live-stream","url-validation"],"backgroundTag":null,"analyzedSha":"dd00f6d258d80b6684a0b9402d7124e5c18ef42f","analyzedAt":"2026-08-15T16:57:31.080Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}