tonhowtf/omniget · error · anyhow::Error

yt-dlp not found

Error message

yt-dlp not found

What it means

When a TikTok video cannot be downloaded via the direct URL (format != tiktok_direct), download() falls back to yt-dlp. If opts.ytdlp_path is None and find_ytdlp_cached() cannot locate an installed yt-dlp binary, this error aborts the download.

Solutions

  1. Install yt-dlp from the app's Settings screen.
  2. Pass DownloadOptions { ytdlp_path: Some(path_to_ytdlp), .. } explicitly.
  3. Install yt-dlp system-wide and ensure it is on PATH.
  4. Restart the app after installing so find_ytdlp_cached() re-scans.

Example fix

// before
None => crate::core::ytdlp::find_ytdlp_cached()
    .await
    .ok_or_else(|| anyhow!("yt-dlp not found"))?,
// after
None => crate::core::ytdlp::find_ytdlp_cached()
    .await
    .ok_or_else(|| anyhow!("yt-dlp not found — install it in Settings or set ytdlp_path"))?,
Defensive patterns

Strategy: validation

Validate before calling

// Ensure a yt-dlp binary exists before requesting non-direct downloads
let ytdlp = opts.ytdlp_path.clone()
    .or_else(|| { let found = find_ytdlp_cached(); found });
if ytdlp.is_none() { eprintln!("configure yt-dlp before downloading this quality"); }

Try / catch

match download(info, opts).await {
    Err(e) if e.to_string().contains("yt-dlp not found") => show_ytdlp_install_dialog(),
    other => other,
}

Prevention

When it happens

Trigger: download() called on a Video MediaInfo whose quality format is not tiktok_direct (yt-dlp path needed), with no ytdlp_path in DownloadOptions and no yt-dlp found on the system.

Common situations: Embedded/live-photo/slideshow content requiring yt-dlp; fresh install without yt-dlp; yt-dlp uninstalled or not on PATH after an environment change.

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/0e370b3584e4dc2e. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/src/platforms/tiktok/mod.rs:579

                                duration_seconds: info.duration_seconds.unwrap_or(0.0),
                                torrent_id: None,
                            });
                        }
                        Err(e) => {
                            tracing::warn!(
                                "[tiktok] direct download failed: {}, falling back to yt-dlp",
                                e
                            );
                            let _ = tokio::fs::remove_file(&output).await;
                        }
                    }
                }

                let ytdlp_path = match &opts.ytdlp_path {
                    Some(p) => p.clone(),
                    None => crate::core::ytdlp::find_ytdlp_cached()
                        .await
                        .ok_or_else(|| anyhow!("yt-dlp not found"))?,
                };

                crate::core::ytdlp::download_video(
                    &ytdlp_path,
                    &quality.url,
                    &opts.output_dir,
                    None,
                    progress,
                    opts.download_mode.as_deref(),
                    None,
                    opts.filename_template.as_deref(),
                    opts.referer.as_deref().or(Some("https://www.tiktok.com/")),
                    opts.cancel_token.clone(),
                    None,
                    opts.concurrent_fragments,
                    false,
                    &[],
                    opts.audio_format.as_deref(),

View on GitHub (pinned to 8600b91f42)