tonhowtf/omniget · error

o yt-dlp não baixou nada

Error message

o yt-dlp não baixou nada{}{}

What it means

run_ytdlp collects produced file paths from yt-dlp's stdout; after the process exits, if zero files were produced it throws "o yt-dlp não baixou nada", appending " (falhou)" when the exit status was non-zero and yt-dlp's stderr tail for diagnosis. yt-dlp exiting successfully but producing no files is still treated as an error so callers never get an empty result.

Solutions

  1. Read the stderr tail appended to the error for yt-dlp's own diagnostic
  2. Update yt-dlp (pip install -U yt-dlp) — stale extractors are the most common cause
  3. Check the URL points to actual media (post not removed/private)
  4. Try the URL directly with yt-dlp on the command line to reproduce outside the app

Example fix

// before: outdated yt-dlp failing silently-ish
$ omniget download <reddit url>
Erro: o yt-dlp não baixou nada (falhou): ERROR: Unsupported URL
// after
$ pip install -U yt-dlp
Defensive patterns

Strategy: retry

Validate before calling

// dry-run the URL through yt-dlp before the full flow
let probe = std::process::Command::new("yt-dlp")
    .args(["--simulate", "--no-warnings", url])
    .output()?;
if !probe.status.success() {
    eprintln!("yt-dlp não suporta essa URL");
}

Try / catch

match run(&args).await {
    Err(e) if e.to_string().contains("não baixou nada") => {
        eprintln!("{e}"); // stderr tail já vem anexado
        update_ytdlp_and_retry_once().await?;
    }
    other => other?,
}

Prevention

When it happens

Trigger: yt-dlp ran but matched no downloadable media (age-restricted post, removed media, unsupported URL), or yt-dlp failed with non-zero exit and wrote nothing; also on silent failures where stdout parsing yields no file lines.

Common situations: Private/deleted Reddit media, geo-blocked or login-gated content, yt-dlp out of date and no longer supporting the site extractor, wrong output template so files land outside the scanned location.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/reddit/download.rs:456

    });
    let err_task = tokio::spawn(async move {
        let mut tail = Vec::new();
        if let Some(e) = stderr {
            let mut lines = BufReader::new(e).lines();
            while let Ok(Some(line)) = lines.next_line().await {
                tail.push(line);
                if tail.len() > 8 {
                    tail.remove(0);
                }
            }
        }
        tail.join("\n")
    });
    let status = child.wait().await?;
    let files = out_task.await.unwrap_or_default();
    let tail = err_task.await.unwrap_or_default();
    if files.is_empty() {
        return Err(anyhow!(
            "o yt-dlp não baixou nada{}{}",
            if status.success() { "" } else { " (falhou)" },
            if tail.is_empty() {
                String::new()
            } else {
                format!(": {}", tail)
            }
        ));
    }
    Ok((files, tail))
}

// ───────────────────────── execução ─────────────────────────

async fn fetch_post(fetcher: &Fetcher, id: &str) -> Result<Value> {
    let v = fetcher
        .get_json(&super::post_json_url(id, "top", 1))
        .await?;

View on GitHub (pinned to 8600b91f42)