tonhowtf/omniget · error
não consegui baixar o áudio para transcrever
Error message
não consegui baixar o áudio para transcrever
What it means
`download_audio` builds a yt-dlp command (with optional cookies from the session's Netscape file) to extract audio to a known output path. After `run_ytdlp` returns, it verifies the file actually exists; if yt-dlp exited without producing the file, this error is thrown. It guards against yt-dlp failing silently or writing to an unexpected path.
Solutions
- Run yt-dlp manually with the same URL/cookies to see the real underlying error.
- Update yt-dlp (app update function or `yt-dlp -U`) — YouTube breakages are frequent.
- Refresh the Netscape session cookies in `opts.session_netscape` if the video requires login.
- Verify the URL is a valid, public video and disk space/permissions allow writing the output.
- Check `is_flatpak()` sandboxing: the Flatpak runtime may not expose yt-dlp to this call.
Defensive patterns
Strategy: retry
Validate before calling
if !Path::new(&cookie_file).exists() && video_requires_login(&url) {
return Err("refresh session cookies before downloading audio");
} Try / catch
match download_audio(&opts).await {
Err(e) if e.to_string().contains("não consegui baixar o áudio") => {
// update yt-dlp, refresh cookies, retry once
}
other => other?,
} Prevention
- Keep yt-dlp up to date — YouTube layout changes break old versions frequently.
- Refresh Netscape session cookies regularly for login-required content.
- Test the URL manually with yt-dlp CLI before automating.
- Ensure disk space and write permissions for the output directory.
When it happens
Trigger: yt-dlp exits (possibly with code 0 or a swallowed error) but the expected output file is absent: bad URL, video unavailable, network failure, cookies expired, or output path changed.
Common situations: Private/deleted videos, geo-blocked content, expired `session_netscape` cookies, yt-dlp out-of-date against a YouTube change, or disk/path issues preventing the file from being created.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/17ad2b4d44c5d257.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/yt_notes.rs:668
Ok(found)
}
async fn download_audio(opts: &Options) -> anyhow::Result<std::path::PathBuf> {
let out = super::temp_dir().join(format!("yt-notes-{}.m4a", uuid::Uuid::new_v4()));
let mut args = vec![
"-f".to_string(),
"bestaudio/best".to_string(),
"--no-warnings".to_string(),
"--no-playlist".to_string(),
"-o".to_string(),
out.to_string_lossy().to_string(),
];
let cookie = super::yt_archive::CookieFile::new(opts.session_netscape.as_deref())?;
cookie.push_args(&mut args);
args.push(opts.url.trim().to_string());
super::yt_archive::run_ytdlp(&args).await?;
if !out.exists() {
return Err(anyhow!("não consegui baixar o áudio para transcrever"));
}
Ok(out)
}
/// O Whisper devolve o `Cue` do `subtitle_merge` (ms sem sinal); aqui tudo
/// trabalha com o `Cue` do módulo de legenda.
struct Transcript {
cues: Vec<Cue>,
language: String,
seconds: f64,
}
async fn transcribe(
input: &std::path::Path,
opts: &Options,
progress: super::ProgressFn,
) -> anyhow::Result<Transcript> {
let r = super::whisper::transcribe(View on GitHub (pinned to 8600b91f42)