{"record":{"id":"1754cb79c7e36048","repo":"tonhowtf/omniget","slug":"no-audio-url-available-mod","errorCode":null,"errorMessage":"No audio URL available","messagePattern":"No audio URL available","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/src/platforms/tiktok/mod.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/src/platforms/tiktok/mod.rs#L629-L665","documentation":"For MediaType::Audio downloads (e.g., extracting a TikTok sound), download() takes the first entry of info.available_qualities as the audio source. This error is thrown when that list is empty, meaning no audio URL was extracted for the media item.","triggerScenarios":"Calling download() on a MediaInfo of type Audio whose available_qualities is empty — the fetch/parse phase produced no music/playUrl entry (e.g., original video with no separate sound entry, or extraction failed silently).","commonSituations":"Attempting to download the sound of a video where TikTok returned no music metadata; slideshows with no audio track; schema change removing the music URL fields.","solutions":["Re-run get_media_info and verify a music/sound URL exists for the post in the raw JSON.","Fall back to yt-dlp extraction of the audio track if no direct audio URL exists.","Check whether the post actually has an audio track (some image posts do not).","Guard in get_media_info: only emit MediaType::Audio when an audio quality entry was found."],"exampleFix":"// before\nlet quality = info.available_qualities.first()\n    .ok_or_else(|| anyhow!(\"No audio URL available\"))?;\n// after\nmatch info.available_qualities.first() {\n    Some(q) => q,\n    None => return Err(anyhow!(\"No audio URL available — this post may have no sound track\")),\n}","handlingStrategy":"validation","validationCode":"// Guard before calling download for audio\nif info.media_type == MediaType::Audio && info.available_qualities.is_empty() {\n    eprintln!(\"post has no downloadable audio track\");\n}","typeGuard":null,"tryCatchPattern":"match download(info, opts).await {\n    Err(e) if e.to_string().contains(\"No audio URL\") => notify(\"no sound track for this post\"),\n    other => other,\n}","preventionTips":["Confirm the post has a music/sound entry before requesting audio extraction.","For posts without direct audio URLs, use yt-dlp audio extraction instead.","Re-fetch media info if the post metadata may have changed."],"tags":["tiktok","audio","download","missing-url"],"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-15T23:17:13.987Z"}