{"record":{"id":"457cabdc5f156dd9","repo":"tonhowtf/omniget","slug":"segment-download-failed","errorCode":null,"errorMessage":"Segment download failed: {}","messagePattern":"Segment download failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/hls_downloader.rs","lineNumber":419,"sourceCode":"        if cancel_token.is_cancelled() {\n            let _ = std::fs::remove_file(&part_path);\n            anyhow::bail!(\"Download cancelled by user\");\n        }\n\n        let errs = errors.lock().await;\n        if !errs.is_empty() {\n            let _ = std::fs::remove_file(&part_path);\n            let summary: Vec<String> = errs\n                .iter()\n                .map(|(msg, count)| {\n                    if *count > 1 {\n                        format!(\"{} (x{})\", msg, count)\n                    } else {\n                        msg.clone()\n                    }\n                })\n                .collect();\n            anyhow::bail!(\"Segment download failed: {}\", summary.join(\"; \"));\n        }\n        drop(errs);\n\n        writer_result?;\n\n        finalize_container(&part_path, &output).await?;\n\n        let file_size = std::fs::metadata(&output)?.len();\n\n        Ok(HlsDownloadResult {\n            path: output,\n            file_size,\n            segments: total_segments,\n        })\n    }\n\n    async fn fetch_encryption_info(\n        &self,","sourceCodeStart":401,"sourceCodeEnd":437,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/hls_downloader.rs#L401-L437","documentation":"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.","triggerScenarios":"Thrown at src-tauri/omniget-core/src/core/hls_downloader.rs:419 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check network stability and retry the download; transient segment failures are the most common cause","Increase max_retries for segment fetches","Verify the source server is not rate-limiting or blocking consecutive segment requests"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}