tonhowtf/omniget · error

yt-dlp not found

Error message

yt-dlp not found

What it means

get_media_info for Bilibili resolves the yt-dlp binary via ytdlp::find_ytdlp_cached(); if no yt-dlp executable is found (cached lookup returns None), it aborts with 'yt-dlp not found'. The Bilibili backend depends entirely on yt-dlp for extraction.

Solutions

  1. Install yt-dlp in Settings → Dependencies (the app can self-download it)
  2. Install yt-dlp system-wide (pip install yt-dlp) and ensure it is on PATH
  3. Verify `yt-dlp --version` resolves in the environment the app runs from
  4. Clear/rebuild the app's dependency cache so find_ytdlp_cached re-detects it

Example fix

// before
let ytdlp_path = ytdlp::find_ytdlp_cached().await.ok_or_else(|| anyhow!("yt-dlp not found"))?;
// after
// ensure dependency setup ran first:
//   app ensures yt-dlp exists (download to cache) before calling get_media_info
let ytdlp_path = ensure_ytdlp_available().await?;
Defensive patterns

Strategy: validation

Validate before calling

// check yt-dlp availability before calling get_media_info
if ytdlp::find_ytdlp_cached().await.is_none() {
    return Err(anyhow!("Run dependency setup: install yt-dlp first"));
}

Try / catch

match get_media_info(url).await {
    Err(e) if e.to_string() == "yt-dlp not found" => prompt_dependency_install(),
    other => other,
}

Prevention

When it happens

Trigger: Calling get_media_info before yt-dlp has been downloaded/bundled: find_ytdlp_cached() checks known paths and app cache and finds nothing.

Common situations: First run without completing dependency setup, users who deleted the app's yt-dlp cache, Linux installs without yt-dlp in PATH, or PATH differences between terminal and GUI launch.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/b7338a8f2328c0d7. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/platforms/bilibili/legacy.rs:70

    }
    if parts.next() != Some("lists") {
        return false;
    }
    let sid = parts.next().unwrap_or("");
    !sid.is_empty() && sid.chars().all(|c| c.is_ascii_digit())
}

pub fn bilibili_extra_flags() -> Vec<String> {
    vec![
        "--referer".to_string(),
        "https://www.bilibili.com".to_string(),
    ]
}

pub async fn get_media_info(url: &str) -> anyhow::Result<MediaInfo> {
    let ytdlp_path = ytdlp::find_ytdlp_cached()
        .await
        .ok_or_else(|| anyhow!("yt-dlp not found"))?;

    let extra = bilibili_extra_flags();

    if is_playlist_or_series(url) {
        let (title, entries) = ytdlp::get_playlist_info(&ytdlp_path, url, &extra).await?;

        if entries.is_empty() {
            return Err(anyhow!("Playlist empty or unavailable"));
        }

        let qualities: Vec<MediaVideoQuality> = entries
            .iter()
            .enumerate()
            .map(|(i, e)| MediaVideoQuality {
                label: format!("{}. {}", i + 1, e.title),
                width: 0,
                height: 0,
                url: e.url.clone(),

View on GitHub (pinned to 8600b91f42)