{"record":{"id":"e0d250af16abb0b0","repo":"tonhowtf/omniget","slug":"no-video-quality-available","errorCode":null,"errorMessage":"No video quality available","messagePattern":"No video quality available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/platforms/twitch.rs","lineNumber":56,"sourceCode":"        Self::new()\n    }\n}\n\nimpl TwitchClipsDownloader {\n    async fn fallback_ytdlp(&self, url: &str) -> anyhow::Result<MediaInfo> {\n        let ytdlp_path = crate::core::ytdlp::ensure_ytdlp().await?;\n        let json = crate::core::ytdlp::get_video_info(&ytdlp_path, url, &[]).await?;\n        crate::platforms::generic_ytdlp::GenericYtdlpDownloader::parse_video_info(&json)\n    }\n\n    async fn native_get_media_info(&self, url: &str) -> anyhow::Result<MediaInfo> {\n        let slug =\n            Self::extract_clip_slug(url).ok_or_else(|| anyhow!(\"Could not extract clip slug\"))?;\n\n        let clip = self.fetch_clip_metadata(&slug).await?;\n\n        if clip.video_qualities.is_empty() {\n            return Err(anyhow!(\"No video quality available\"));\n        }\n\n        let broadcaster = clip\n            .broadcaster_login\n            .as_deref()\n            .ok_or_else(|| anyhow!(\"Dados do clip incompletos\"))?;\n\n        let token = self.fetch_access_token(&slug).await?;\n\n        let clip_title = clip.title.trim().to_string();\n\n        let available_qualities: Vec<VideoQuality> = clip\n            .video_qualities\n            .iter()\n            .map(|q| {\n                let height: u32 = q.quality.parse().unwrap_or(0);\n                let authenticated_url = Self::build_authenticated_url(&q.source_url, &token);\n                VideoQuality {","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/platforms/twitch.rs#L38-L74","documentation":"Raised by native_get_media_info after the clip metadata GraphQL query succeeds but the returned videoQualities array is empty, meaning Twitch returned the clip record with no playable quality renditions.","triggerScenarios":"fetch_clip_metadata returns a clip whose videoQualities array is empty — typical for deleted/expired clips, sub-only content, or clips in restricted regions; also when the GQL response fields are filtered out.","commonSituations":"A clip was deleted or made subscriber-only after the link was shared; geo-restriction strips renditions; Twitch API changes the videoQualities shape so all entries are filtered by filter_map.","solutions":["Fall back to the yt-dlp-based extraction path for the clip","Re-check the clip in a browser to confirm it still exists and is public","Add logging on the parsed videoQualities count to detect GQL schema drift"],"exampleFix":"// before\nif clip.video_qualities.is_empty() {\n    return Err(anyhow!(\"No video quality available\"));\n}\n// after\nif clip.video_qualities.is_empty() {\n    return self.fallback_ytdlp(url).await;\n}","handlingStrategy":"fallback","validationCode":"// After get_media_info succeeds, before download:\nif info.available_qualities.is_empty() {\n    eprintln!(\"Twitch clip exposed no qualities; clip may be deleted or restricted\");\n}","typeGuard":"fn has_playable_qualities(info: &MediaInfo) -> bool {\n    !info.available_qualities.is_empty() && info.available_qualities.iter().all(|q| !q.url.is_empty())\n}","tryCatchPattern":"match downloader.get_media_info(url).await {\n    Err(e) if e.to_string().contains(\"No video quality available\") => fallback_ytdlp_info(url).await,\n    other => other,\n}","preventionTips":["Confirm the clip is public and not subscriber-only before downloading","Use the yt-dlp fallback whenever native extraction yields no qualities","Monitor GQL videoQualities shape so filter_map silently dropping entries is caught"],"tags":["rust","twitch","empty-list","api"],"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"}