{"record":{"id":"5f7e02ea728c15c9","repo":"tonhowtf/omniget","slug":"o-yt-dlp-n-o-baixou-nada","errorCode":null,"errorMessage":"o yt-dlp não baixou nada{}{}","messagePattern":"o yt-dlp não baixou nada(.+?)(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/reddit/download.rs","lineNumber":456,"sourceCode":"    });\n    let err_task = tokio::spawn(async move {\n        let mut tail = Vec::new();\n        if let Some(e) = stderr {\n            let mut lines = BufReader::new(e).lines();\n            while let Ok(Some(line)) = lines.next_line().await {\n                tail.push(line);\n                if tail.len() > 8 {\n                    tail.remove(0);\n                }\n            }\n        }\n        tail.join(\"\\n\")\n    });\n    let status = child.wait().await?;\n    let files = out_task.await.unwrap_or_default();\n    let tail = err_task.await.unwrap_or_default();\n    if files.is_empty() {\n        return Err(anyhow!(\n            \"o yt-dlp não baixou nada{}{}\",\n            if status.success() { \"\" } else { \" (falhou)\" },\n            if tail.is_empty() {\n                String::new()\n            } else {\n                format!(\": {}\", tail)\n            }\n        ));\n    }\n    Ok((files, tail))\n}\n\n// ───────────────────────── execução ─────────────────────────\n\nasync fn fetch_post(fetcher: &Fetcher, id: &str) -> Result<Value> {\n    let v = fetcher\n        .get_json(&super::post_json_url(id, \"top\", 1))\n        .await?;","sourceCodeStart":438,"sourceCodeEnd":474,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/reddit/download.rs#L438-L474","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the stderr tail appended to the error for yt-dlp's own diagnostic","Update yt-dlp (pip install -U yt-dlp) — stale extractors are the most common cause","Check the URL points to actual media (post not removed/private)","Try the URL directly with yt-dlp on the command line to reproduce outside the app"],"exampleFix":"// before: outdated yt-dlp failing silently-ish\n$ omniget download <reddit url>\nErro: o yt-dlp não baixou nada (falhou): ERROR: Unsupported URL\n// after\n$ pip install -U yt-dlp","handlingStrategy":"retry","validationCode":"// dry-run the URL through yt-dlp before the full flow\nlet probe = std::process::Command::new(\"yt-dlp\")\n    .args([\"--simulate\", \"--no-warnings\", url])\n    .output()?;\nif !probe.status.success() {\n    eprintln!(\"yt-dlp não suporta essa URL\");\n}","typeGuard":null,"tryCatchPattern":"match run(&args).await {\n    Err(e) if e.to_string().contains(\"não baixou nada\") => {\n        eprintln!(\"{e}\"); // stderr tail já vem anexado\n        update_ytdlp_and_retry_once().await?;\n    }\n    other => other?,\n}","preventionTips":["Keep yt-dlp updated — extractor breakage is frequent","Validate the target URL/media exists before invoking yt-dlp","Capture and store yt-dlp stderr with each download for post-mortems"],"tags":["yt-dlp","download","empty-result","rust"],"backgroundTag":"empty-result-set","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}