{"record":{"id":"dd642dd0cff12f8e","repo":"iawia002/lux","slug":"data-msg","errorCode":null,"errorMessage":"data.Msg","messagePattern":"data\\.Msg","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"extractors/qq/qq.go","lineNumber":214,"sourceCode":"\t\t}\n\n\t\tvids = utils.MatchOneOf(\n\t\t\tu, `vid=(\\w+)`, `vid:\\s*[\"'](\\w+)`, `vid\\s*=\\s*[\"']\\s*(\\w+)`,\n\t\t)\n\t\tif vids == nil || len(vids) < 2 {\n\t\t\treturn nil, errors.WithStack(extractors.ErrURLParseFailed)\n\t\t}\n\t\tvid = vids[1]\n\t}\n\n\tdata, err := getVinfo(vid, \"shd\", url)\n\tif err != nil {\n\t\treturn nil, errors.WithStack(err)\n\t}\n\n\t// API request error\n\tif data.Msg != \"\" {\n\t\treturn nil, errors.New(data.Msg)\n\t}\n\tcdn := data.Vl.Vi[0].Ul.UI[0].URL\n\tstreams, err := genStreams(vid, cdn, data)\n\tif err != nil {\n\t\treturn nil, errors.WithStack(err)\n\t}\n\n\treturn []*extractors.Data{\n\t\t{\n\t\t\tSite:    \"腾讯视频 v.qq.com\",\n\t\t\tTitle:   data.Vl.Vi[0].Ti,\n\t\t\tType:    extractors.DataTypeVideo,\n\t\t\tStreams: streams,\n\t\t\tURL:     url,\n\t\t},\n\t}, nil\n}\n","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/iawia002/lux/blob/dd00f6d258d80b6684a0b9402d7124e5c18ef42f/extractors/qq/qq.go#L196-L232","documentation":"The QQ Video extractor calls the internal vinfo API (getVinfo with the 'shd' definition) and checks the Msg field of the response. A non-empty Msg means the API accepted the HTTP request but rejected the video request server-side, and lux surfaces that message verbatim as the error (e.g. 'wrong vid' or region notices).","triggerScenarios":"Calling Extract on a v.qq.com URL whose vid the vinfo API does not recognize (deleted drama/movie/episode), or from an IP region the API refuses (much QQ Video content is mainland-China only). The vid regex matched, so failure happens at the getVinfo(vid, \"shd\", url) call.","commonSituations":"Running the downloader outside mainland China against geo-locked content; URLs to episodes that were taken down; trailer/preview ids that the shd definition does not serve.","solutions":["Open the same v.qq.com URL in a browser from the same network; if it refuses to play there, the API rejection is expected","If region-blocked, retry from a mainland-China network or pick a non-restricted video","Try a different definition in getVinfo (e.g. 'sd' or 'hd' instead of 'shd') — some vids only have lower definitions registered","Surface data.Msg to the end user and skip the URL in batch runs"],"exampleFix":"// before\n_, err := qq.Extract(url, opts)\nif err != nil { return err }\n\n// after\n_, err := qq.Extract(url, opts)\nif err != nil {\n    if strings.Contains(err.Error(), \"vid\") || strings.Contains(err.Error(), \"地区\") {\n        log.Printf(\"qq video unavailable for this vid/region: %v\", err)\n        continue\n    }\n    return err\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"_, err := qq.Extract(url, opts)\nif err != nil {\n    // err.Error() carries the vinfo API Msg verbatim; branch on it\n    if strings.Contains(err.Error(), \"vid\") || strings.Contains(err.Error(), \"不存在\") {\n        // dead or geo-restricted video: skip\n    }\n    return err\n}","preventionTips":["Expect QQ Video API refusals outside mainland China; pick test URLs accordingly","Treat any non-empty Msg as terminal for that vid — retrying the same vid rarely helps","Log data.Msg text; it names the actual server-side reason"],"tags":["qq-video","api-error","geo-restriction"],"backgroundTag":null,"analyzedSha":"dd00f6d258d80b6684a0b9402d7124e5c18ef42f","analyzedAt":"2026-08-15T16:57:31.080Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}