tonhowtf/omniget · error · anyhow::Error

Segment download failed

Error message

Segment download failed: {}

What it means

Aggregation error in download_media_playlist: one or more HLS segment downloads failed after retries; the collected error map (message -> count) is summarized into this bail message and the partial part-file is deleted, aborting the whole download.

Solutions

  1. Check network stability and retry the download; transient segment failures are the most common cause
  2. Increase max_retries for segment fetches
  3. Verify the source server is not rate-limiting or blocking consecutive segment requests
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src-tauri/omniget-core/src/core/hls_downloader.rs:419 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/hls_downloader.rs:419

        if cancel_token.is_cancelled() {
            let _ = std::fs::remove_file(&part_path);
            anyhow::bail!("Download cancelled by user");
        }

        let errs = errors.lock().await;
        if !errs.is_empty() {
            let _ = std::fs::remove_file(&part_path);
            let summary: Vec<String> = errs
                .iter()
                .map(|(msg, count)| {
                    if *count > 1 {
                        format!("{} (x{})", msg, count)
                    } else {
                        msg.clone()
                    }
                })
                .collect();
            anyhow::bail!("Segment download failed: {}", summary.join("; "));
        }
        drop(errs);

        writer_result?;

        finalize_container(&part_path, &output).await?;

        let file_size = std::fs::metadata(&output)?.len();

        Ok(HlsDownloadResult {
            path: output,
            file_size,
            segments: total_segments,
        })
    }

    async fn fetch_encryption_info(
        &self,

View on GitHub (pinned to 8600b91f42)