tonhowtf/omniget · error

No audio URL available

Error message

No audio URL available

What it means

Raised by TiktokDownloader::download when the media type is Audio but the MediaInfo struct returned by parsing has an empty available_qualities list, so there is no audio stream URL to pass to the direct downloader. It means the TikTok extraction layer produced metadata for the post but no audio stream entry.

Solutions

  1. Re-extract media info first and check that available_qualities is non-empty before calling download for audio
  2. Fall back to a different extraction path (e.g. yt-dlp based downloader) for audio-only posts
  3. Update the TikTok extractor, since the upstream API response shape may have changed

Example fix

// before
let quality = info.available_qualities.first().ok_or_else(|| anyhow!("No audio URL available"))?;
// after
let quality = match info.available_qualities.first() {
    Some(q) => q,
    None => return self.fallback_to_ytdlp_audio(&url, &opts).await,
};
Defensive patterns

Strategy: fallback

Validate before calling

// Rust, before download()
if media_info.media_type == MediaType::Audio && media_info.available_qualities.is_empty() {
    eprintln!("Audio post has no stream URLs; use yt-dlp fallback");
}

Type guard

fn has_audio_url(info: &MediaInfo) -> bool {
    info.media_type == MediaType::Audio && info.available_qualities.iter().any(|q| !q.url.is_empty())
}

Try / catch

match downloader.download(&info, &opts).await {
    Err(e) if e.to_string().contains("No audio URL") => fallback_ytdlp_download(&url, &opts).await,
    other => other,
}

Prevention

When it happens

Trigger: Calling download() on a TikTok post whose parsed MediaInfo has media_type == MediaType::Audio and available_qualities.is_empty() — typically after a music/sound-only post was extracted but the extractor failed to populate audio stream URLs.

Common situations: Downloading a TikTok sound/music page where the extractor returns no stream URLs; stale extraction logic after a TikTok API/schema change; a post with restricted or removed audio.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/platforms/tiktok.rs:647

                    total_bytes += bytes;
                    last_path = output;

                    let percent = ((i + 1) as f64 / count as f64) * 100.0;
                    let _ = progress.send(ProgressUpdate::percent(percent)).await;
                }

                Ok(DownloadResult {
                    file_path: last_path,
                    file_size_bytes: total_bytes,
                    duration_seconds: 0.0,
                    torrent_id: None,
                })
            }
            MediaType::Audio => {
                let quality = info
                    .available_qualities
                    .first()
                    .ok_or_else(|| anyhow!("No audio URL available"))?;

                let filename = format!("{}.mp3", sanitize_filename::sanitize(&info.title));
                let output = opts.output_dir.join(&filename);

                let bytes = direct_downloader::download_direct_with_headers(
                    &self.client,
                    &quality.url,
                    &output,
                    progress,
                    Some(headers),
                    Some(&opts.cancel_token),
                )
                .await?;

                Ok(DownloadResult {
                    file_path: output,
                    file_size_bytes: bytes,
                    duration_seconds: 0.0,

View on GitHub (pinned to 8600b91f42)