tonhowtf/omniget · error
No media found in post
Error message
No media found in post
What it means
The post data was fetched successfully, but parse_media returned None — the post's JSON contains no recognized media (no reddit_video, no crosspost_parent video, no gallery, no image preview). native_get_media_info treats media-less posts as an error.
Solutions
- Check the post in a browser — if it is a text/link/poll post, there is nothing to download; inform the user.
- Inspect the post JSON's media, secure_media, is_gallery and crosspost_parent fields to see what parse_media missed.
- Extend parse_media to handle crosspost_parent media extraction if crossposts fail.
- Handle this as a 'no downloadable media' result rather than a hard error in the UI.
Example fix
// before
let media = Self::parse_media(&data).ok_or_else(|| anyhow!("No media found in post"))?;
// after: try crossposts before failing
let media = Self::parse_media(&data)
.or_else(|| Self::parse_crosspost_media(&data))
.ok_or_else(|| anyhow!("No media found in post"))?; Defensive patterns
Strategy: type-guard
Type guard
fn has_downloadable_media(post_json: &serde_json::Value) -> bool {
let p = post_json.pointer("/data/children/0/data");
p.map(|d| {
d.get("media").map(|m| !m.is_null()).unwrap_or(false)
|| d.get("is_gallery").and_then(|g| g.as_bool()).unwrap_or(false)
|| d.get("crosspost_parent_list").map(|c| !c.as_array().map_or(true, |a| a.is_empty())).unwrap_or(false)
}).unwrap_or(false)
} Try / catch
match native_get_media_info(url).await {
Err(e) if e.to_string() == "No media found in post" => {
show_user("This post contains no downloadable media (text/link post?)");
}
other => other,
} Prevention
- Check the post type in a browser before attempting downloads (text/link/poll posts have no media).
- Guard calls with a media-presence check on the post JSON (media, is_gallery, crosspost_parent_list).
- Keep parse_media updated for new Reddit media types and crosspost structures.
- Surface 'no media' as an informational result, not a hard failure.
When it happens
Trigger: fetch_post_data succeeds but the post is a text post, link post, poll, or has only embedded third-party media that parse_media does not recognize.
Common situations: Users paste URLs to text/self posts, external-link posts, or polls; crossposts where parse_media doesn't traverse crosspost_parent; new Reddit media types added after this code was written.
Related errors
- resposta inesperada do Reddit (não é a lista de dois…
- o post não veio na resposta (removido, privado ou apagado?)
- Could not extract post ID
- No video URL
- Nenhum URL GIF
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/8d5100c99bff1d67.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/platforms/reddit.rs:421
impl RedditDownloader {
async fn fallback_ytdlp(&self, url: &str) -> anyhow::Result<MediaInfo> {
let ytdlp_path = crate::core::ytdlp::ensure_ytdlp().await?;
let json = crate::core::ytdlp::get_video_info(&ytdlp_path, url, &[]).await?;
crate::platforms::generic_ytdlp::GenericYtdlpDownloader::parse_video_info(&json)
}
async fn native_get_media_info(&self, url: &str) -> anyhow::Result<MediaInfo> {
let canonical = self.resolve_to_canonical(url).await?;
let post_id = Self::extract_post_id(&canonical)
.ok_or_else(|| anyhow!("Could not extract post ID"))?;
let subreddit = Self::extract_subreddit(&canonical).unwrap_or_default();
let data = self.fetch_post_data(&post_id).await?;
let media = Self::parse_media(&data).ok_or_else(|| anyhow!("No media found in post"))?;
let source_id = if subreddit.is_empty() {
post_id.clone()
} else {
format!("{}_{}", subreddit.to_lowercase(), post_id)
};
let title = format!("reddit_{}", source_id);
match media {
RedditMedia::Video {
video_url,
duration,
} => {
let audio = self.find_audio_url(&video_url).await;
let mut qualities = vec![VideoQuality {
label: "video".to_string(),
width: 0,View on GitHub (pinned to 8600b91f42)