{"record":{"id":"cf2f8a8ada9b4e9d","repo":"tonhowtf/omniget","slug":"unsupported-media-type-reddit","errorCode":null,"errorMessage":"Unsupported media type","messagePattern":"Unsupported media type","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/platforms/reddit.rs","lineNumber":767,"sourceCode":"                        Some(&opts.cancel_token),\n                    )\n                    .await?;\n\n                    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            _ => Err(anyhow!(\"Unsupported media type\")),\n        }\n    }\n}\n","sourceCodeStart":749,"sourceCodeEnd":771,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/platforms/reddit.rs#L749-L771","documentation":"native_download in reddit.rs terminates its match on the media type with a catch-all `_ =>` arm that returns this anyhow error. It means the reddit media item resolved to a type the downloader does not implement (neither direct file, HLS/DASH stream, nor torrent path handled above). The library throws it when a post contains an unsupported media kind, so it refuses to download rather than produce a corrupt file.","triggerScenarios":"Calling download on a Reddit post whose resolved media type falls into the default match arm — e.g. a gallery, live post, poll, crosspost, or a new embed type not covered by the handled variants.","commonSituations":"Reddit introduces/renames a media type in its API; users submit gallery or live-stream URLs; the platform handler's URL pattern matched but the inner media kind was never supported.","solutions":["Check which media type the post resolved to and add a handler for it in native_download's match","Verify the URL is a supported Reddit post type (video/image, not gallery/poll/live)","Update the library to a newer version that may support this media type","Handle the error in the caller and surface a 'post type not supported' message instead of retrying"],"exampleFix":"// before\n_ => Err(anyhow!(\"Unsupported media type\")),\n// after\nSome(MediaType::Gallery) => Err(anyhow!(\"Reddit galleries are not supported yet; download items individually\")),\n_ => Err(anyhow!(\"Unsupported media type: {:?}\", media.media_type)),","handlingStrategy":"validation","validationCode":"const SUPPORTED_MEDIA_TYPES = [\"video\", \"image\", \"hls\", \"torrent\"];\nif (!SUPPORTED_MEDIA_TYPES.includes(String(post.media_type))) {\n  throw new Error(`Reddit media type '${post.media_type}' is not supported for download`);\n}","typeGuard":"function isDownloadableRedditMedia(m) {\n  return m != null && [\"video\", \"image\", \"hls\", \"torrent\"].includes(String(m.media_type));\n}","tryCatchPattern":"match platform.download(url).await {\n    Err(e) if e.to_string().contains(\"Unsupported media type\") => warn_user(\"This Reddit post type is not supported\"),\n    other => other?,\n}","preventionTips":["Filter URLs by supported Reddit post kinds before dispatching to download","Log the resolved media type alongside the error for diagnosis","Keep the match arm list in sync with Reddit API media variants","Check the library changelog for newly supported media types"],"tags":["reddit","unsupported-media","download"],"backgroundTag":"unsupported-operation","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"}