{"record":{"id":"622830c4d43229e3","repo":"AlistGo/alist","slug":"baidu-youth-video-dlink-not-found-for-s","errorCode":null,"errorMessage":"baidu youth video dlink not found for %s","messagePattern":"baidu youth video dlink not found for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/baidu_youth/util.go","lineNumber":402,"sourceCode":"\t\treq.SetContext(ctx)\n\t\treq.SetQueryParams(map[string]string{\n\t\t\t\"channel\":    videoAPIChannel,\n\t\t\t\"clienttype\": \"1\",\n\t\t\t\"devuid\":     videoAPIDevUID,\n\t\t\t\"dlink\":      \"1\",\n\t\t\t\"fs_id\":      fileID,\n\t\t\t\"media\":      \"1\",\n\t\t\t\"nom3u8\":     \"1\",\n\t\t\t\"origin\":     \"dlna\",\n\t\t\t\"path\":       path,\n\t\t\t\"type\":       \"VideoURL\",\n\t\t})\n\t}, &resp)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif resp.Info.Dlink == \"\" {\n\t\treturn \"\", fmt.Errorf(\"baidu youth video dlink not found for %s\", path)\n\t}\n\treturn resp.Info.Dlink, nil\n}\n\nfunc (d *BaiduYouth) buildVideoLink(ctx context.Context, file model.Obj) (*model.Link, error) {\n\tdlink, err := d.getMediaInfoDLink(ctx, file)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &model.Link{\n\t\tURL: dlink,\n\t\tHeader: http.Header{\n\t\t\t\"Referer\": []string{panReferer},\n\t\t},\n\t}, nil\n}\n\nfunc (d *BaiduYouth) requestLocateDownloadURL(ctx context.Context, path string, fileID string, fileMD5 string, sk string) (string, error) {","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/baidu_youth/util.go#L384-L420","documentation":"Returned by BaiduYouth.getMediaInfoDLink (drivers/baidu_youth/util.go:402): the streaming/video info endpoint (type=VideoURL, media=1) responded successfully but Info.Dlink was empty. I.e. Baidu knows about the file but did not hand out a video download link — usually because the file is not a recognized video or the account cannot stream it.","triggerScenarios":"buildVideoLink called for a non-video file; video not yet transcoded/available for streaming; media info blocked for the account or region.","commonSituations":"Driver falls back to the video path when locatedownload fails on media files; newly uploaded videos before transcoding completes; unsupported codecs.","solutions":["Fall back to the standard locatedownload path when the dlink is missing","Verify the file is actually a video (extension/mime) before choosing buildVideoLink","Retry later for freshly uploaded videos still transcoding"],"exampleFix":"// before\nfunc (d *BaiduYouth) buildVideoLink(ctx context.Context, file model.Obj) (*model.Link, error) {\n    dlink, err := d.getMediaInfoDLink(ctx, file)\n    if err != nil { return nil, err }\n    ...\n}\n\n// after\ndlink, err := d.getMediaInfoDLink(ctx, file)\nif err != nil {\n    if strings.Contains(err.Error(), \"video dlink not found\") {\n        return d.buildNormalLink(ctx, file) // locatedownload fallback\n    }\n    return nil, err\n}","handlingStrategy":"fallback","validationCode":"// prefer the media path only for likely-video objects\nfunc isLikelyVideo(obj model.Obj) bool {\n    ext := strings.ToLower(path.Ext(obj.GetName()))\n    switch ext {\n    case \".mp4\", \".mkv\", \".avi\", \".mov\", \".flv\", \".ts\", \".webm\":\n        return true\n    }\n    return false\n}","typeGuard":null,"tryCatchPattern":"dlink, err := d.getMediaInfoDLink(ctx, file)\nif err != nil && strings.Contains(err.Error(), \"video dlink not found\") {\n    // not streamable as video: fall back to the normal locatedownload flow\n    return d.buildNormalLink(ctx, file)\n}\nif err != nil {\n    return nil, err\n}","preventionTips":["Gate the video path on file type/mime instead of trying it blindly","Retry media links later for freshly uploaded videos still transcoding","Keep the locatedownload fallback wired so missing dlinks degrade gracefully"],"tags":["baidu-youth","video","download","api"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}