tonhowtf/omniget · error

yt-dlp not found in Flatpak sandbox

Error message

yt-dlp not found in Flatpak sandbox

What it means

`ensure_ytdlp` looks for an existing yt-dlp binary and, if absent, downloads one. Under Flatpak, downloading to the managed path is not possible (sandbox restrictions), so when the binary is not found inside the sandbox the function errors immediately with this message instead of attempting a download. It tells the user yt-dlp must come from the Flatpak runtime or host system.

Solutions

  1. Install the yt-dlp Flatpak extension or ensure the runtime provides yt-dlp.
  2. Grant the sandbox access to a host yt-dlp binary (filesystem override for its directory) and make it visible on PATH.
  3. Install/update yt-dlp on the host and ensure the Flatpak can see it (e.g. `flatpak override --filesystem=...`).
  4. Update the Flatpak app itself so its bundled/runtime yt-dlp version is current.
Defensive patterns

Strategy: validation

Validate before calling

let yt_dlp_available = which::which("yt-dlp").is_ok();
if is_flatpak() && !yt_dlp_available {
    // prompt user to install the yt-dlp Flatpak extension before proceeding
}

Type guard

fn flatpak_ytdlp_ready() -> bool {
    crate::core::dependencies::is_flatpak() && which::which("yt-dlp").is_ok()
}

Try / catch

match ensure_ytdlp().await {
    Err(e) if e.to_string().contains("Flatpak sandbox") => {
        // show install-the-extension guidance to the user
    }
    other => other?,
}

Prevention

When it happens

Trigger: Running inside a Flatpak sandbox where `crate::core::dependencies::is_flatpak()` is true and no usable yt-dlp binary was found on PATH or in the managed location.

Common situations: Flatpak install of the app without the `yt-dlp` runtime extension; host yt-dlp not visible in the sandbox due to missing filesystem/PATH permissions.

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/985af850a79ba10c. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/core/ytdlp.rs:1757

        std::thread::Builder::new()
            .name("js-runtime-check".into())
            .spawn(|| {
                let rt = tokio::runtime::Builder::new_current_thread()
                    .enable_all()
                    .build()
                    .expect("js-runtime runtime");
                rt.block_on(async {
                    crate::core::dependencies::ensure_js_runtime().await;
                });
            })
            .ok();
        tracing::debug!("[perf] ensure_ytdlp took {:?}", _timer_start.elapsed());
        return Ok(path);
    }

    if crate::core::dependencies::is_flatpak() {
        tracing::debug!("[perf] ensure_ytdlp took {:?}", _timer_start.elapsed());
        return Err(anyhow!("yt-dlp not found in Flatpak sandbox"));
    }

    let path = download_ytdlp_binary().await?;
    reset_ytdlp_cache();
    std::thread::Builder::new()
        .name("js-runtime-check".into())
        .spawn(|| {
            let rt = tokio::runtime::Builder::new_current_thread()
                .enable_all()
                .build()
                .expect("js-runtime runtime");
            rt.block_on(async {
                crate::core::dependencies::ensure_js_runtime().await;
            });
        })
        .ok();
    tracing::debug!("[perf] ensure_ytdlp took {:?}", _timer_start.elapsed());
    Ok(path)

View on GitHub (pinned to 8600b91f42)