tonhowtf/omniget · error
Console encoding error (non-UTF-8 locale). Update yt-dlp in…
Error message
Console encoding error (non-UTF-8 locale). Update yt-dlp in Settings → Dependencies, or run `chcp 65001` in a terminal and reopen the app.
What it means
A friendly remapping produced by the error-message classifier (ytdlp.rs:4423): yt-dlp emitted an 'Exception ignored'/TextIOWrapper 'errno 22' traceback caused by the child process writing to a console with a non-UTF-8 codepage (typical on Windows with a legacy locale). The library detects these markers and surfaces an actionable message instead of raw Python noise.
Solutions
- Run `chcp 65001` in the terminal and reopen the app (switches console to UTF-8).
- Update yt-dlp via Settings → Dependencies (newer versions handle encodings better).
- Set the system 'Beta: Use Unicode UTF-8 for worldwide language support' option on Windows.
- Set environment variables PYTHONIOENCODING=utf-8 / PYTHONUTF8=1 for the spawned process.
Example fix
// before (cmd.xml)
cmd.arg("yt-dlp").arg(url);
// after
cmd.arg("yt-dlp").arg(url)
.env("PYTHONUTF8", "1")
.env("PYTHONIOENCODING", "utf-8"); Defensive patterns
Strategy: fallback
Prevention
- On Windows, switch the console to UTF-8 (`chcp 65001`) or enable the system-wide UTF-8 beta option.
- Keep yt-dlp current — newer releases handle legacy codepages more gracefully.
- Set PYTHONUTF8=1 for the spawned yt-dlp process in launcher scripts.
- Prefer launching the app from a UTF-8 terminal rather than a legacy OEM codepage console.
When it happens
Trigger: Running yt-dlp on Windows with a non-UTF-8 console codepage (e.g. chcp 936/1252) where yt-dlp's output triggers an errno 22 TextIOWrapper encoding exception that appears in captured stderr.
Common situations: Chinese/Eastern-European Windows locales with legacy codepages; older yt-dlp versions sensitive to console encoding; running from a terminal with OEM codepage rather than UTF-8.
Related errors
- Download reported success but no matching file appeared in
- PowerShell Set-Clipboard failed
- corpo ilegivel de
- is in use by another process ( ). Wait for active downloads…
- Failed to replace
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/4c600bf8c1bb2ca9.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/ytdlp.rs:4423
"video is private",
"no video formats found",
"unsupported url",
"is not a valid url",
"http error 404",
"http error 410",
];
PATTERNS.iter().any(|p| stderr_lower.contains(p))
}
fn translate_ytdlp_error(stderr: &str) -> anyhow::Error {
let lower = stderr.to_lowercase();
if lower.contains("errno 22")
&& (lower.contains("textiowrapper")
|| lower.contains("encoding=")
|| lower.contains("exception ignored"))
{
return anyhow!(
"Console encoding error (non-UTF-8 locale). Update yt-dlp in Settings → Dependencies, or run `chcp 65001` in a terminal and reopen the app."
);
}
if lower.contains("http error 429") {
return anyhow!("Server returned error 429 (too many requests). Try again later.");
}
if lower.contains("http error 403") || lower.contains("forbidden") {
return anyhow!("Access denied (403). The video may be private or region-restricted.");
}
if lower.contains("sign in to confirm")
|| lower.contains("login required")
|| stderr.contains("请先登录")
|| stderr.contains("需要登录")
|| stderr.contains("登录后可")
|| stderr.contains("仅登录用户")
|| lower.contains("this video is only available") && lower.contains("members")
{View on GitHub (pinned to 8600b91f42)