{"record":{"id":"9da4f657398242c0","repo":"tonhowtf/omniget","slug":"yt-dlp-not-found-in-path-or-app-data-dir","errorCode":null,"errorMessage":"yt-dlp not found in PATH or app data dir","messagePattern":"yt-dlp not found in PATH or app data dir","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src-tauri/omniget-cli/src/reporter.rs","lineNumber":84,"sourceCode":"                \"type\": \"complete\",\n                \"success\": success,\n                \"message\": message,\n            });\n            println!(\"{}\", json);\n        } else {\n            if success {\n                self.pb.finish_with_message(format!(\"✓ {}\", message));\n            } else {\n                self.pb.finish_with_message(format!(\"✗ {}\", message));\n            }\n        }\n    }\n}\n\npub async fn find_yt_dlp() -> Result<PathBuf> {\n    find_tool(\"yt-dlp\")\n        .await\n        .ok_or_else(|| anyhow::anyhow!(\"yt-dlp not found in PATH or app data dir\"))\n}\n\npub fn default_output_dir() -> PathBuf {\n    directories::UserDirs::new()\n        .and_then(|d| d.download_dir().map(PathBuf::from))\n        .unwrap_or_else(|| std::env::current_dir().unwrap_or_default())\n}\n\npub fn default_cookie_path() -> Option<PathBuf> {\n    let app_dir = app_data_dir()?;\n    let cookie_file = app_dir.join(\"cookies\").join(\"cookies.txt\");\n    if cookie_file.exists() {\n        Some(cookie_file)\n    } else {\n        None\n    }\n}\n","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-cli/src/reporter.rs#L66-L102","documentation":"Lookup failure in the CLI reporter: find_yt_dlp() wraps find_tool(\"yt-dlp\"), which checks the system PATH and the app data directory for the yt-dlp binary; when neither location yields an executable it converts the None into an error. It fires when yt-dlp is simply not installed, is not on PATH, or was not bundled into the app data dir, so any download that depends on it cannot proceed.","triggerScenarios":"Calling any download/report flow that invokes find_yt_dlp when yt-dlp is neither installed in PATH nor placed in the app data directory.","commonSituations":"Fresh installs where yt-dlp was never installed; venvs where yt-dlp isn't on PATH; Windows installs missing .exe extension resolution; yt-dlp renamed (e.g. youtube-dl).","solutions":["Install yt-dlp: pip install yt-dlp (or brew install yt-dlp) and confirm with 'yt-dlp --version'.","Alternatively download the yt-dlp binary and place it in the app data directory the CLI checks.","Verify PATH includes the directory containing yt-dlp (echo $PATH / where yt-dlp)."],"exampleFix":"// before\n$ omniget download <url>  # yt-dlp not installed\n// after\n$ pip install yt-dlp\n$ omniget download <url>","handlingStrategy":"validation","validationCode":"const { execSync } = require('child_process');\ntry { execSync('yt-dlp --version', { stdio: 'ignore' }); }\ncatch { throw new Error('Install yt-dlp first: pip install yt-dlp'); }","typeGuard":null,"tryCatchPattern":"try {\n  await startDownload(url);\n} catch (e) {\n  if (String(e).includes('yt-dlp not found')) {\n    // surface an install instruction to the user\n  } else throw e;\n}","preventionTips":["Check for yt-dlp at app startup and prompt installation early","Pin yt-dlp in your environment setup script (pip install yt-dlp)","Keep the binary on PATH or in the app data dir the tool checks"],"tags":["dependency","path","yt-dlp"],"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"}