{"record":{"id":"932035d3defd7045","repo":"tonhowtf/omniget","slug":"no-video-url-available-mod","errorCode":null,"errorMessage":"No video URL available","messagePattern":"No video URL available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/src/platforms/tiktok/mod.rs","lineNumber":540,"sourceCode":"                    opts.concurrent_fragments,\n                    false,\n                    &[],\n                    opts.audio_format.as_deref(),\n                )\n                .await;\n            }\n        }\n\n        let cookies = self.captured_cookies.lock().await.clone();\n        let mut headers = self.download_headers(&cookies);\n        crate::core::http_client::inject_ua_header(&mut headers, opts.user_agent.as_deref());\n\n        match info.media_type {\n            MediaType::Video => {\n                let quality = info\n                    .available_qualities\n                    .first()\n                    .ok_or_else(|| anyhow!(\"No video URL available\"))?;\n\n                if quality.format == \"tiktok_direct\" {\n                    let filename = format!(\"{}.mp4\", sanitize_filename::sanitize(&info.title));\n                    let output = opts.output_dir.join(&filename);\n\n                    let result = direct_downloader::download_direct_with_headers(\n                        &self.client,\n                        &quality.url,\n                        &output,\n                        progress.clone(),\n                        Some(headers),\n                        Some(&opts.cancel_token),\n                    )\n                    .await;\n\n                    match result {\n                        Ok(bytes) => {\n                            return Ok(DownloadResult {","sourceCodeStart":522,"sourceCodeEnd":558,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/platforms/tiktok/mod.rs#L522-L558","documentation":"For MediaType::Video downloads, download() takes the first entry of info.available_qualities as the stream to fetch. This error is thrown when that list is empty, i.e., the MediaInfo was constructed without any downloadable video URL/quality entry.","triggerScenarios":"Calling download() on a MediaInfo of type Video whose available_qualities vector is empty — typically when extract_video_url() returned None (no valid playAddr/downloadAddr/bitrate URL) yet info was still built, or the native parse produced no direct URL.","commonSituations":"Region-blocked or login-gated videos where playAddr is withheld; TikTok removing direct-URL fields; scraper succeeded structurally but all candidate URLs failed is_valid_play_addr.","solutions":["Re-fetch media info (get_media_info) to repopulate available_qualities.","Use the yt-dlp fallback info path if the native scraper returned no direct URLs.","Check that the post is publicly accessible and not age-gated.","Add a guard in get_media_info so MediaInfo is never returned with an empty available_qualities."],"exampleFix":"// before\nlet quality = info.available_qualities.first()\n    .ok_or_else(|| anyhow!(\"No video URL available\"))?;\n// after\nif info.available_qualities.is_empty() {\n    let info = self.get_media_info_via_ytdlp(&url, &post_id).await?;\n}\nlet quality = info.available_qualities.first()\n    .ok_or_else(|| anyhow!(\"No video URL available for this post\"))?;","handlingStrategy":"validation","validationCode":"// Guard before calling download\nif info.media_type == MediaType::Video && info.available_qualities.is_empty() {\n    eprintln!(\"no video qualities; re-fetch info or use yt-dlp\");\n}","typeGuard":null,"tryCatchPattern":"match downloader.download(info, opts).await {\n    Err(e) if e.to_string().contains(\"No video URL\") => retry_with_ytdlp(url).await,\n    other => other,\n}","preventionTips":["Re-fetch media info before retrying a failed download.","Never cache MediaInfo with empty available_qualities.","Verify the post is publicly accessible (not age-gated/region-blocked)."],"tags":["tiktok","download","missing-url","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-15T23:17:13.987Z"}