tonhowtf/omniget · error

No URL available

Error message

No URL available

What it means

api_engine_download() (the modern bilibili API path) takes the first URL from info.available_qualities, defaulting to "" when absent, and errors immediately if it is empty. Like the legacy path, this signals that parsing produced no usable stream URL, so the download engine cannot be invoked.

Solutions

  1. Configure a bilibili account (active_account_slug) if the content requires login, and retry.
  2. Confirm the video URL is valid and publicly viewable in a browser first.
  3. Log/inspect the parsed MediaInfo and the parser step to find why no qualities were extracted.

Example fix

// before
let url = info.available_qualities.first().map(|q| q.url.as_str()).unwrap_or("");
if url.is_empty() { return Err(anyhow!("No URL available")); }
// after
let url = info.available_qualities.first().map(|q| q.url.as_str())
    .filter(|u| !u.is_empty())
    .with_context(|| format!("no stream URL extracted for {} (may require login or be region-locked)", info.source_url))?;
Defensive patterns

Strategy: validation

Validate before calling

if !info.available_qualities.iter().any(|q| !q.url.is_empty()) { return Err(anyhow!("nothing to download: no stream URL extracted")); }
api_engine_download(info, opts, progress).await?;

Type guard

fn downloadable(info: &MediaInfo) -> bool { info.available_qualities.iter().any(|q| !q.url.is_empty()) }

Prevention

When it happens

Trigger: download() -> api_engine_download() with a MediaInfo whose available_qualities is empty or whose first entry has an empty url field.

Common situations: Region-locked, deleted, or audit-pending bilibili content; missing login account/cookies for members-only streams; upstream bilibili API response shape changed so stream URLs were never extracted.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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

Appendix: source

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

        }
        line.split('\t').nth(5) == Some("SESSDATA")
    })
}

async fn api_engine_download(
    info: &MediaInfo,
    opts: &DownloadOptions,
    progress: mpsc::Sender<ProgressUpdate>,
) -> anyhow::Result<DownloadResult> {
    let _ = cookie::ensure_fresh().await;

    let url = info
        .available_qualities
        .first()
        .map(|q| q.url.as_str())
        .unwrap_or("");
    if url.is_empty() {
        return Err(anyhow!("No URL available"));
    }

    let slug = active_account_slug();
    let client = build_api_client(slug.as_deref(), opts.user_agent.as_deref())?;

    let mut effective_url = url.to_string();
    if url_kind::is_b23_short(&effective_url) {
        if let Ok(resolved) = url_kind::resolve_b23(&client, &effective_url).await {
            effective_url = resolved;
        }
    }

    let kind = url_kind::detect(&effective_url)
        .map_err(|e| anyhow!("Failed to detect URL kind: {}", e.i18n_key()))?;
    let parsed = parser::parse(&client, &kind)
        .await
        .map_err(|e| anyhow!("Failed to parse content: {}", e.i18n_key()))?;

View on GitHub (pinned to 8600b91f42)