tonhowtf/omniget · error

Engine failed

Error message

Engine failed: {}

What it means

api_engine_download() hands the parsed content to engine::run_parsed_content, which performs the actual download/mux. Any engine failure is wrapped as 'Engine failed: {i18n_key}'. This is the download/mux execution stage: network I/O, CDN fetch, ffmpeg muxing, or danmaku/cover handling can all surface here.

Solutions

  1. Read the embedded i18n_key to identify the stage (network vs mux vs IO) and fix that specifically.
  2. Verify ffmpeg is installed and on PATH if the key points to muxing.
  3. Check disk space and write permissions for the output directory.
  4. Retry the download; CDN failures are often transient — re-fetch info to get fresh URLs.

Example fix

// before
.map_err(|e| anyhow!("Engine failed: {}", e.i18n_key()))?;
// after
.map_err(|e| anyhow!("Engine failed: {} (stage: {:?})", e.i18n_key(), e.stage()))?;
Defensive patterns

Strategy: retry

Validate before calling

// pre-flight checks before download
assert!(which("ffmpeg").is_ok(), "ffmpeg must be installed");
assert!(free_space(output_dir)? > required_bytes, "insufficient disk space");

Try / catch

match download(url).await {
    Err(e) if e.to_string().contains("Engine failed") => {
        match classify_stage(&e) {
            Stage::Network => retry_with_backoff(url, 3).await,
            Stage::Mux => verify_ffmpeg_and_retry(url).await,
            _ => report(e),
        }
    }
    other => other,
}

Prevention

When it happens

Trigger: download() -> api_engine_download() where engine::run_parsed_content returns Err: CDN download failures, expired stream URLs, ffmpeg/mux errors, disk write failures, or user cancellation propagated from the engine.

Common situations: Bilibili CDN rejecting requests (missing referer/UA, region mismatch); ffmpeg not installed or wrong version; disk full or no write permission; unstable network mid-download.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/platforms/bilibili/mod.rs:307

        } else {
            preview::AUDIO_AUTO
        },
        embed_cover: settings.download.embed_thumbnail,
        keep_streams: false,
        filename,
        cancel: opts.cancel_token.clone(),
        danmaku_enabled: settings.download.bilibili_danmaku_enabled,
        danmaku_format: Some(danmaku_format),
        nfo_enabled: settings.download.bilibili_nfo_enabled,
        cover_sidecar_enabled: settings.download.bilibili_cover_sidecar,
        cover_format,
        cdn_alt_hosts,
        cdn_prefer_alternatives: settings.download.bilibili_cdn_prefer_alternatives,
    };

    let result = engine::run_parsed_content(&client, &parsed, &kind, &engine_opts, progress)
        .await
        .map_err(|e| anyhow!("Engine failed: {}", e.i18n_key()))?;

    Ok(DownloadResult {
        file_path: result.final_path,
        file_size_bytes: result.bytes,
        duration_seconds: parsed
            .items
            .first()
            .and_then(|i| i.duration_seconds)
            .unwrap_or(0.0),
        torrent_id: None,
    })
}

fn build_api_client(
    slug: Option<&str>,
    user_agent: Option<&str>,
) -> anyhow::Result<api::ApiClient> {
    let mut client =

View on GitHub (pinned to 8600b91f42)