{"record":{"id":"ae29d57a6d5e6333","repo":"AlistGo/alist","slug":"emby-user-has-no-download-permission-and-item-is-n","errorCode":null,"errorMessage":"emby user has no download permission and item is not streamable","messagePattern":"emby user has no download permission and item is not streamable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/emby/driver.go","lineNumber":116,"sourceCode":"\t// no download permission: fall back to the direct-play stream of the original file\n\tvar resp ItemsResp\n\terr := d.request(ctx, \"/Users/\"+d.userID+\"/Items\", map[string]string{\"Ids\": file.GetID()}, &resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(resp.Items) > 0 {\n\t\tswitch resp.Items[0].MediaType {\n\t\tcase \"Video\":\n\t\t\treturn &model.Link{\n\t\t\t\tURL: fmt.Sprintf(\"%s/Videos/%s/stream?static=true&api_key=%s\", d.baseURL(), file.GetID(), d.token),\n\t\t\t}, nil\n\t\tcase \"Audio\":\n\t\t\treturn &model.Link{\n\t\t\t\tURL: fmt.Sprintf(\"%s/Audio/%s/stream?static=true&api_key=%s\", d.baseURL(), file.GetID(), d.token),\n\t\t\t}, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"emby user has no download permission and item is not streamable\")\n}\n\nvar _ driver.Driver = (*Emby)(nil)\nvar _ driver.GetRooter = (*Emby)(nil)\n","sourceCodeStart":98,"sourceCodeEnd":121,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/emby/driver.go#L98-L121","documentation":"Returned by the Emby driver's link resolution when the authenticated Emby user lacks EnableContentDownloading AND the item is not directly streamable as Video or Audio. The driver builds a direct stream URL only for Video/Audio media types; anything else (e.g. a folder-ish item, book, photo without a stream endpoint, or an empty Items array) falls through to this error when download permission is off.","triggerScenarios":"Calling link() on an item whose playbackInfo query returns no items or a MediaType outside Video/Audio while d.canDownload is false; Emby user policy has downloading disabled in the server dashboard; the file id maps to a non-media item (image, subtitle, collection).","commonSituations":"Admin created a restricted Emby user with downloads disabled expecting the driver to stream anyway; pointing the mount at a library containing photos/books; item id staleness after Emby library rebuilds returns empty Items.","solutions":["In the Emby dashboard, edit the user's Access settings and enable 'Allow media downloads', then restart/re-init the driver","Verify the item actually is a Video or Audio item by opening it in the Emby web client","Re-list the directory so file ids are refreshed, then retry the download","If the library legitimately holds non-streamable types, exclude them from this mount"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before requesting a link, check permission flag exposed by the driver\nif !embyUserCanDownload { // derived from user policy EnableContentDownloading\n    return errors.New(\"downloads disabled for this Emby user; enable 'Allow media downloads'\")\n}\nif item.Type != \"Video\" && item.Type != \"Audio\" {\n    return errors.New(\"item is not streamable; cannot build a link\")\n}","typeGuard":null,"tryCatchPattern":"link, err := d.link(ctx, obj)\nif err != nil && strings.Contains(err.Error(), \"no download permission\") {\n    // instruct user instead of retrying; this only changes server-side\n    return nil, fmt.Errorf(\"enable 'Allow media downloads' for the Emby user %s\", d.Username)\n}","preventionTips":["Enable download permission on the dedicated API user before mounting","Only expose Video/Audio libraries through this driver","Handle this error as a configuration error, not a transient failure"],"tags":["emby","permissions","streaming","auth"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}