{"record":{"id":"e92adce238769fc5","repo":"tonhowtf/omniget","slug":"playlist-empty-or-unavailable-mod","errorCode":null,"errorMessage":"Playlist empty or unavailable","messagePattern":"Playlist empty or unavailable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/src/platforms/youtube/mod.rs","lineNumber":87,"sourceCode":"                if key == \"v\" && !value.is_empty() {\n                    has_video = true;\n                }\n            }\n\n            return has_list && !has_video;\n        }\n        false\n    }\n\n    pub async fn fetch_with_ytdlp(\n        url: &str,\n        ytdlp_path: &std::path::Path,\n    ) -> anyhow::Result<MediaInfo> {\n        if Self::is_playlist_url(url) {\n            let (playlist_title, entries) = ytdlp::get_playlist_info(ytdlp_path, url, &[]).await?;\n\n            if entries.is_empty() {\n                return Err(anyhow!(\"Playlist empty or unavailable\"));\n            }\n\n            let qualities: Vec<MediaVideoQuality> = entries\n                .into_iter()\n                .enumerate()\n                .map(|(i, entry)| MediaVideoQuality {\n                    label: format!(\"{}. {}\", i + 1, entry.title),\n                    width: 0,\n                    height: 0,\n                    url: entry.url,\n                    format: \"ytdlp_playlist\".to_string(),\n                })\n                .collect();\n\n            return Ok(MediaInfo {\n                title: sanitize_filename::sanitize(&playlist_title),\n                author: playlist_title,\n                platform: \"youtube\".to_string(),","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/platforms/youtube/mod.rs#L69-L105","documentation":"Thrown by YouTubeDownloader::fetch_with_ytdlp when the URL is detected as a playlist (is_playlist_url) and ytdlp::get_playlist_info returns an empty entries list. It means the playlist exists at the URL level but yielded no downloadable video entries.","triggerScenarios":"Calling fetch_with_ytdlp (e.g. via get_media_info) on a playlist URL where get_playlist_info returns zero entries: empty playlists, private/unlisted-removed playlists, region-blocked entries, or yt-dlp failing to expand the playlist.","commonSituations":"Sharing a playlist URL whose videos have all been deleted or made private; region-restricted playlists; outdated yt-dlp failing against YouTube changes; passing a malformed URL that looks like a playlist but points to nothing.","solutions":["Verify the playlist is non-empty and public in a browser.","Update yt-dlp to the latest version.","Check the playlist ID in the URL is correct (list=... parameter).","Handle the error upstream by prompting the user to supply a direct video URL instead.","Log yt-dlp's raw output to distinguish an empty playlist from an extraction failure."],"exampleFix":"// before\nif entries.is_empty() {\n    return Err(anyhow!(\"Playlist empty or unavailable\"));\n}\n// after: distinguish empty vs fetch failure\nlet (playlist_title, entries) = ytdlp::get_playlist_info(ytdlp_path, url, &[]).await?;\nif entries.is_empty() {\n    return Err(anyhow!(\"Playlist '{}' is empty or its videos are private/unavailable\", playlist_title));\n}","handlingStrategy":"validation","validationCode":"// pre-check the playlist yields entries before full fetch\nlet (title, entries) = ytdlp::get_playlist_info(&ytdlp_path, url, &[]).await?;\nif entries.is_empty() {\n    eprintln!(\"playlist '{}' has no public entries — ask user for a video URL instead\", title);\n}","typeGuard":"fn is_populated_playlist(entries: &[PlaylistEntry]) -> bool {\n    !entries.is_empty()\n}","tryCatchPattern":"match downloader.get_media_info(&url).await {\n    Err(e) if e.to_string().contains(\"Playlist empty or unavailable\") => {\n        // prompt user: playlist is empty/private; try a direct video URL\n        ask_for_direct_video_url();\n    }\n    other => other,\n}","preventionTips":["Verify the playlist is public and non-empty in a browser before processing.","Keep yt-dlp updated so playlist expansion doesn't silently fail.","Check the list= parameter is a valid playlist ID.","Handle region-restricted entries by supplying cookies where supported.","Cache playlist lookups to avoid repeated failures on stale links."],"tags":["youtube","playlist","empty-list","ytdlp"],"backgroundTag":"empty-result-set","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}