tonhowtf/omniget · error

All playlist item(s) failed to download. First error

Error message

All {} playlist item(s) failed to download. First error: {}

What it means

After iterating all playlist items, download_playlist() reports total failure if success_count == 0. It includes the first item's error as detail ('unknown error' if none was captured) so the caller learns why every item failed.

Solutions

  1. Inspect 'First error: ...' in the message — fix the underlying per-item error it reports.
  2. Re-fetch media info right before downloading so CDN URLs are fresh, then retry.
  3. Check network/proxy connectivity and account cookies if the first error mentions auth or 403.
  4. Improve the code to aggregate all item errors (not just the first) for better diagnostics.

Example fix

// before
return Err(anyhow!("All {} playlist item(s) failed to download. First error: {}", total, detail));
// after
let details: Vec<String> = item_errors.iter().map(|e| e.to_string()).take(3).collect();
return Err(anyhow!("All {} playlist item(s) failed. First errors: {}", total, details.join("; ")));
Defensive patterns

Strategy: retry

Try / catch

match download(...).await {
    Err(e) if e.to_string().starts_with("All ") && e.to_string().contains("playlist item(s) failed") => {
        let first = extract_first_error(&e.to_string());
        retry_with_fresh_info(url).await
    }
    other => other,
}

Prevention

When it happens

Trigger: download() -> download_playlist() where every playlist item's download future returned Err (network failures, expired CDN URLs, per-item extraction errors), leaving success_count at 0.

Common situations: Bilibili CDN URLs expired because fetching info and downloading were separated by too long; network/proxy outage; all items hit the same auth or region restriction; the per-item downloader has a systematic bug after an API change.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/platforms/bilibili/legacy.rs:327

                success_count += 1;
                last_result.file_size_bytes += result.file_size_bytes;
                last_result.duration_seconds += result.duration_seconds;
                last_result.file_path = result.file_path;
            }
            Err(e) => {
                tracing::error!("[bilibili] playlist item {} failed: {}", i + 1, e);
                if first_error.is_none() {
                    first_error = Some(e);
                }
            }
        }
    }

    if success_count == 0 {
        let detail = first_error
            .map(|e| e.to_string())
            .unwrap_or_else(|| "unknown error".to_string());
        return Err(anyhow!(
            "All {} playlist item(s) failed to download. First error: {}",
            total,
            detail
        ));
    }

    let _ = progress.send(ProgressUpdate::percent(100.0)).await;
    Ok(last_result)
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn cheese_episode_is_not_playlist() {
        assert!(!is_playlist_or_series(
            "https://www.bilibili.com/cheese/play/ep2143"

View on GitHub (pinned to 8600b91f42)