{"record":{"id":"9be194b2c48e6926","repo":"tonhowtf/omniget","slug":"download-reported-success-but-no-matching-file-appeared-in","errorCode":null,"errorMessage":"Download reported success but no matching file appeared in {:?}. This can happen on Windows with a non-UTF-8 console locale when the title contains non-Latin characters. Try `chcp 65001` in a terminal before launching the app, or update yt-dlp in Settings → Dependencies.","messagePattern":"Download reported success but no matching file appeared in (.+?)\\. This can happen on Windows with a non-UTF-8 console locale when the title contains non-Latin characters\\. Try `chcp 65001` in a terminal before launching the app, or update yt-dlp in Settings → Dependencies\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src-tauri/omniget-core/src/core/ytdlp.rs","lineNumber":4815,"sourceCode":"            }\n            if let Ok(meta) = entry.metadata() {\n                if meta.len() == 0 {\n                    continue;\n                }\n                if let Ok(modified) = meta.modified() {\n                    if now.duration_since(modified).unwrap_or_default() < fallback_limit {\n                        if newest.as_ref().map_or(true, |(_, t)| modified > *t) {\n                            newest = Some((path, modified));\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    newest\n        .map(|(p, _)| p)\n        .ok_or_else(|| anyhow!(\n            \"Download reported success but no matching file appeared in {:?}. \\\n             This can happen on Windows with a non-UTF-8 console locale when the title contains non-Latin characters. \\\n             Try `chcp 65001` in a terminal before launching the app, or update yt-dlp in Settings → Dependencies.\",\n            output_dir\n        ))\n}\n\npub fn parse_formats(json: &serde_json::Value) -> Vec<FormatInfo> {\n    let formats = match json.get(\"formats\").and_then(|v| v.as_array()) {\n        Some(f) => f,\n        None => return Vec::new(),\n    };\n\n    let mut result = Vec::new();\n    for f in formats {\n        let format_id = match f.get(\"format_id\").and_then(|v| v.as_str()) {\n            Some(id) => id.to_string(),\n            None => continue,","sourceCodeStart":4797,"sourceCodeEnd":4833,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/ytdlp.rs#L4797-L4833","documentation":"Raised after yt-dlp exits successfully but the wrapper cannot find a new file matching the expected title in the output directory. The known cause is Windows console encoding: with a non-UTF-8 code page, yt-dlp's output title is mis-decoded so the filename match fails, especially with non-Latin titles.","triggerScenarios":"`find_newest_matching_file` (ok_or_else at ytdlp.rs:4815) returns None after a successful download: filename mismatch due to console code page mangling non-ASCII titles, or the file landed outside output_dir.","commonSituations":"Windows machines with legacy locales (cp936/cp1251 etc.), downloads of videos with Cyrillic/CJK/Arabic titles, or custom output templates changing the filename.","solutions":["Run `chcp 65001` in a terminal before launching the app to force UTF-8 console output","Update yt-dlp in Settings → Dependencies; newer versions write JSON metadata that avoids encoding issues","Check the output directory for the file under a slightly different (mangled) name","Set a fixed output template (-o) without title-derived characters to sidestep matching"],"exampleFix":"// before\n// Windows console in cp936: title 'Видео' garbled, no file matched\n// after\n// chcp 65001 && app.exe  (or update yt-dlp in Settings → Dependencies)\nnewest.map(|(p, _)| p).ok_or_else(|| anyhow!(\"Download reported success but no matching file appeared in {:?}.\", output_dir))","handlingStrategy":"fallback","validationCode":"// Windows only: detect a non-UTF-8 console code page\n#[cfg(windows)]\nlet cp = std::process::Command::new(\"cmd\").args([\"/c\", \"chcp\"]).output()?;\nlet utf8 = String::from_utf8_lossy(&cp.stdout).contains(\"65001\");\nif !utf8 { eprintln!(\"Run 'chcp 65001' before launching to avoid filename mismatches\"); }","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"no matching file appeared\") => {\n        scan_output_dir_for_recent_files(output_dir) // fall back to mtime scan\n    }\n    other => other,\n}","preventionTips":["Force UTF-8 console (chcp 65001) on Windows launches","Read the download filename from yt-dlp's JSON/progress output instead of parsing text","Scan the output dir by mtime as a fallback","Keep yt-dlp updated; newer versions emit safer metadata"],"tags":["windows","encoding","filesystem","yt-dlp"],"backgroundTag":"file-not-found","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"}