{"record":{"id":"84822b9773832103","repo":"tonhowtf/omniget","slug":"no-audio-url-available","errorCode":null,"errorMessage":"No audio URL available","messagePattern":"No audio URL available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/platforms/tiktok.rs","lineNumber":647,"sourceCode":"                    total_bytes += bytes;\n                    last_path = output;\n\n                    let percent = ((i + 1) as f64 / count as f64) * 100.0;\n                    let _ = progress.send(ProgressUpdate::percent(percent)).await;\n                }\n\n                Ok(DownloadResult {\n                    file_path: last_path,\n                    file_size_bytes: total_bytes,\n                    duration_seconds: 0.0,\n                    torrent_id: None,\n                })\n            }\n            MediaType::Audio => {\n                let quality = info\n                    .available_qualities\n                    .first()\n                    .ok_or_else(|| anyhow!(\"No audio URL available\"))?;\n\n                let filename = format!(\"{}.mp3\", sanitize_filename::sanitize(&info.title));\n                let output = opts.output_dir.join(&filename);\n\n                let bytes = direct_downloader::download_direct_with_headers(\n                    &self.client,\n                    &quality.url,\n                    &output,\n                    progress,\n                    Some(headers),\n                    Some(&opts.cancel_token),\n                )\n                .await?;\n\n                Ok(DownloadResult {\n                    file_path: output,\n                    file_size_bytes: bytes,\n                    duration_seconds: 0.0,","sourceCodeStart":629,"sourceCodeEnd":665,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/platforms/tiktok.rs#L629-L665","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Re-extract media info first and check that available_qualities is non-empty before calling download for audio","Fall back to a different extraction path (e.g. yt-dlp based downloader) for audio-only posts","Update the TikTok extractor, since the upstream API response shape may have changed"],"exampleFix":"// before\nlet quality = info.available_qualities.first().ok_or_else(|| anyhow!(\"No audio URL available\"))?;\n// after\nlet quality = match info.available_qualities.first() {\n    Some(q) => q,\n    None => return self.fallback_to_ytdlp_audio(&url, &opts).await,\n};","handlingStrategy":"fallback","validationCode":"// Rust, before download()\nif media_info.media_type == MediaType::Audio && media_info.available_qualities.is_empty() {\n    eprintln!(\"Audio post has no stream URLs; use yt-dlp fallback\");\n}","typeGuard":"fn has_audio_url(info: &MediaInfo) -> bool {\n    info.media_type == MediaType::Audio && info.available_qualities.iter().any(|q| !q.url.is_empty())\n}","tryCatchPattern":"match downloader.download(&info, &opts).await {\n    Err(e) if e.to_string().contains(\"No audio URL\") => fallback_ytdlp_download(&url, &opts).await,\n    other => other,\n}","preventionTips":["Always fetch fresh MediaInfo immediately before download","Check available_qualities is non-empty for audio posts","Keep the TikTok extractor updated for API/schema changes"],"tags":["rust","tiktok","audio","empty-list"],"backgroundTag":"empty-result-set","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}