{"record":{"id":"f233fcc4766cd1cb","repo":"tonhowtf/omniget","slug":"unsupported-media-type-for-download-tiktok","errorCode":null,"errorMessage":"Unsupported media type for download","messagePattern":"Unsupported media type for download","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/platforms/tiktok.rs","lineNumber":669,"sourceCode":"\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,\n                    torrent_id: None,\n                })\n            }\n            _ => Err(anyhow!(\"Unsupported media type for download\")),\n        }\n    }\n}\n","sourceCodeStart":651,"sourceCodeEnd":673,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/platforms/tiktok.rs#L651-L673","documentation":"Raised by TiktokDownloader::download when media_type is none of the handled variants (Video, Photo, Carousel, Audio). It is the catch-all arm of the download match, meaning the platform layer cannot route this media kind to any download strategy.","triggerScenarios":"Calling download() with a MediaInfo whose media_type is an exotic/other MediaType variant not covered by the match in tiktok.rs, e.g. a future variant added to the enum without updating this arm.","commonSituations":"A MediaType enum was extended (e.g. GIF, Story) but the TikTok downloader was not updated; extraction misclassified a post into a non-downloadable type.","solutions":["Check which MediaType value your MediaInfo carries before routing it to this downloader","Add a handler or explicit fallback for the missing MediaType variant in the match","Route unsupported types to the generic yt-dlp downloader"],"exampleFix":"// before\n_ => Err(anyhow!(\"Unsupported media type for download\")),\n// after\nmedia_type => {\n    log::warn!(\"TikTok downloader got unhandled media type {:?}; falling back to yt-dlp\", media_type);\n    self.fallback_ytdlp_download(&url, &opts).await\n}","handlingStrategy":"validation","validationCode":"const SUPPORTED: [MediaType; 4] = [MediaType::Video, MediaType::Photo, MediaType::Carousel, MediaType::Audio];\nif !SUPPORTED.contains(&info.media_type) { /* route to generic downloader */ }","typeGuard":"fn is_downloadable_tiktok_type(t: &MediaType) -> bool {\n    matches!(t, MediaType::Video | MediaType::Photo | MediaType::Carousel | MediaType::Audio)\n}","tryCatchPattern":"match downloader.download(&info, &opts).await {\n    Err(e) if e.to_string().contains(\"Unsupported media type\") => generic_downloader.download(&url, &opts).await,\n    other => other,\n}","preventionTips":["When adding MediaType variants, update every platform match arm","Check media_type before dispatching to a platform-specific downloader","Route unknown types to the generic yt-dlp path by default"],"tags":["rust","tiktok","enum","match"],"backgroundTag":"unsupported-operation","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"}