{"record":{"id":"e2b3f86e2daa2a4e","repo":"tonhowtf/omniget","slug":"yt-dlp-not-found-tiktok","errorCode":null,"errorMessage":"yt-dlp not found","messagePattern":"yt-dlp not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/platforms/tiktok.rs","lineNumber":579,"sourceCode":"                                duration_seconds: info.duration_seconds.unwrap_or(0.0),\n                                torrent_id: None,\n                            });\n                        }\n                        Err(e) => {\n                            tracing::warn!(\n                                \"[tiktok] direct download failed: {}, falling back to yt-dlp\",\n                                e\n                            );\n                            let _ = tokio::fs::remove_file(&output).await;\n                        }\n                    }\n                }\n\n                let ytdlp_path = match &opts.ytdlp_path {\n                    Some(p) => p.clone(),\n                    None => crate::core::ytdlp::find_ytdlp_cached()\n                        .await\n                        .ok_or_else(|| anyhow!(\"yt-dlp not found\"))?,\n                };\n\n                crate::core::ytdlp::download_video(\n                    &ytdlp_path,\n                    &quality.url,\n                    &opts.output_dir,\n                    None,\n                    progress,\n                    opts.download_mode.as_deref(),\n                    None,\n                    opts.filename_template.as_deref(),\n                    opts.referer.as_deref().or(Some(\"https://www.tiktok.com/\")),\n                    opts.cancel_token.clone(),\n                    None,\n                    opts.concurrent_fragments,\n                    false,\n                    &[],\n                    opts.audio_format.as_deref(),","sourceCodeStart":561,"sourceCodeEnd":597,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/platforms/tiktok.rs#L561-L597","documentation":"During download of a non-direct (yt-dlp-playable) video quality, the library needs the yt-dlp binary. It uses opts.ytdlp_path if provided; otherwise it calls find_ytdlp_cached(), and if that returns None it fails with the shorter 'yt-dlp not found' message.","triggerScenarios":"download() selects a quality whose format is not tiktok_direct, opts.ytdlp_path is None, and find_ytdlp_cached() finds no yt-dlp executable on PATH or in the app cache.","commonSituations":"yt-dlp never installed or removed from PATH; running the app in a clean environment/container; yt-dlp auto-update breaking the cached path; direct URL expired so the download fell back to the yt-dlp path where the binary is missing.","solutions":["Install yt-dlp (pip install -U yt-dlp / brew install yt-dlp) or use the app Settings installer.","Pass opts.ytdlp_path pointing at an explicit yt-dlp binary.","Confirm `yt-dlp --version` works in the same environment/user as the app.","If a cached binary is broken, clear the app cache so find_ytdlp_cached() re-resolves it."],"exampleFix":"// before: download fails at runtime\nlet opts = DownloadOpts { ytdlp_path: None, ..Default::default() };\ntiktok.download(&info, &opts).await?;\n// after: resolve yt-dlp up front\nlet ytdlp = opts.ytdlp_path.clone()\n    .or_else(crate::core::ytdlp::resolve_on_disk())\n    .ok_or_else(|| anyhow!(\"yt-dlp not found — install it in Settings\"))?;\nlet opts = DownloadOpts { ytdlp_path: Some(ytdlp), ..opts };\ntiktok.download(&info, &opts).await?;","handlingStrategy":"validation","validationCode":"// resolve before download, not inside it\nlet ytdlp = opts.ytdlp_path.clone().or_else(find_ytdlp_on_disk)\n    .ok_or_else(|| anyhow!(\"yt-dlp not found — install it in Settings\"))?;","typeGuard":"fn ytdlp_available(opts: &DownloadOpts) -> bool {\n    opts.ytdlp_path.as_ref().map(|p| p.exists()).unwrap_or(false)\n        || std::process::Command::new(\"yt-dlp\").arg(\"--version\").output().map(|o| o.status.success()).unwrap_or(false)\n}","tryCatchPattern":"match tiktok.download(&info, &opts).await {\n    Err(e) if e.to_string() == \"yt-dlp not found\" => Err(UserActionRequired::InstallYtdlp),\n    other => other,\n}","preventionTips":["Set opts.ytdlp_path explicitly to a verified binary path.","Verify yt-dlp runs (`yt-dlp --version`) in the app's environment at startup.","Install yt-dlp via the app Settings installer on first run.","Refresh the cached binary periodically since TikTok changes break old yt-dlp versions."],"tags":["yt-dlp","missing-binary","dependency","download"],"backgroundTag":"missing-dependency","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"}