tonhowtf/omniget · error

Timeout fetching video info

Error message

Timeout fetching video info ({}s)

What it means

get_video_info wraps child.wait_with_output() in tokio::time::timeout(VIDEO_INFO_PROCESS_TIMEOUT_SECS); when the timer elapses before yt-dlp finishes, the timeout future is dropped (kill_on_drop kills the process) and this error is returned. It means yt-dlp did not produce its JSON within the configured budget.

Solutions

  1. Retry the fetch (the function already has an attempt loop); transient slowness often resolves
  2. Increase VIDEO_INFO_PROCESS_TIMEOUT_SECS if your deployment regularly has high latency
  3. Check network/proxy configuration and that yt-dlp is up to date (extractor breakage causes hangs)
  4. Surface the timeout to the user with guidance to try again later or use a smaller playlist
Defensive patterns

Strategy: retry

Validate before calling

// Pre-check connectivity and that a probe run completes quickly
let probe = tokio::time::timeout(
    std::time::Duration::from_secs(10),
    ytdlp_command(ytdlp).arg("--version").output(),
).await;
if probe.is_err() { return Err("yt-dlp is unresponsive; network or install problem".into()); }

Try / catch

match timeout(dur, get_video_info(url)).await {
    Err(_) => { /* elapsed: surface retry UI, optionally bump VIDEO_INFO_PROCESS_TIMEOUT_SECS */ }
    Ok(Err(e)) if e.to_string().contains("Timeout fetching video info") => retry_with_backoff(url),
    Ok(res) => res,
}

Prevention

When it happens

Trigger: Calling get_video_info on a URL where yt-dlp takes longer than VIDEO_INFO_PROCESS_TIMEOUT_SECS: very slow extractors, throttled networks, sites requiring slow JS challenges, or a hung yt-dlp process.

Common situations: Slow/blocked network to the video host; YouTube throttling or bot checks; proxy misconfiguration making upstream unreachable; timeout constant set too low for poor connectivity.

Understand the failure class

Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.

Related errors


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

Appendix: source

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

            .stdout(Stdio::piped())
            .stderr(Stdio::piped())
            .kill_on_drop(true)
            .spawn()
            .map_err(|e| anyhow!("Failed to run yt-dlp: {}", e))?;
        tracing::debug!(
            "[perf] get_video_info: yt-dlp process spawned at {:?} (attempt {})",
            _timer_start.elapsed(),
            attempt + 1
        );

        let result = tokio::time::timeout(
            std::time::Duration::from_secs(VIDEO_INFO_PROCESS_TIMEOUT_SECS),
            child.wait_with_output(),
        )
        .await
        .map_err(|_| {
            tracing::debug!("[perf] get_video_info took {:?}", _timer_start.elapsed());
            anyhow!(
                "Timeout fetching video info ({}s)",
                VIDEO_INFO_PROCESS_TIMEOUT_SECS
            )
        })?
        .map_err(|e| {
            tracing::debug!("[perf] get_video_info took {:?}", _timer_start.elapsed());
            anyhow!("Failed to run yt-dlp: {}", e)
        })?;

        tracing::debug!(
            "[perf] get_video_info: yt-dlp process exited at {:?} (attempt {})",
            _timer_start.elapsed(),
            attempt + 1
        );

        if result.status.success() {
            let json: serde_json::Value = serde_json::from_slice(&result.stdout)
                .map_err(|e| anyhow!("yt-dlp returned invalid JSON: {}", e))?;

View on GitHub (pinned to 8600b91f42)