tonhowtf/omniget · error
Unsupported media type for download
Error message
Unsupported media type for download
What it means
Catch-all in BlueskyDownloader::download for MediaType variants other than Video, Photo, Carousel, Gif, and the ytdlp-formatted early path (e.g. MediaType::Audio or any other variant). The Bluesky downloader simply cannot download that media type.
Solutions
- Route the MediaInfo to the platform downloader that produced it, not the Bluesky one.
- Check info.media_type before calling download() and handle unsupported kinds in the caller.
- If you added a MediaType variant, extend this match to handle or explicitly reject it.
Example fix
// before
match info.media_type { ... _ => Err(anyhow!("Unsupported media type for download")) }
// after (caller)
if !matches!(info.media_type, MediaType::Video | MediaType::Photo | MediaType::Carousel | MediaType::Gif) {
return Err(anyhow!("bluesky downloader cannot handle {:?}", info.media_type));
} Defensive patterns
Strategy: type-guard
Validate before calling
use MediaType::*;
if !matches!(info.media_type, Video | Photo | Carousel | Gif) {
return Err(anyhow!("{:?} not supported by bluesky downloader", info.media_type));
} Type guard
fn is_bluesky_downloadable(mt: &MediaType) -> bool {
matches!(mt, MediaType::Video | MediaType::Photo | MediaType::Carousel | MediaType::Gif)
} Try / catch
match downloader.download(&info, &opts, tx).await {
Err(e) if e.to_string() == "Unsupported media type for download" => {
eprintln!("route {:?} to its originating platform downloader", info.media_type);
}
other => other,
} Prevention
- Only pass Bluesky-produced MediaInfo to the Bluesky downloader
- Check media_type before dispatching to a platform downloader
- Update the match when adding new MediaType variants (make it exhaustive instead of _)
When it happens
Trigger: Calling download() with a MediaInfo whose media_type is a variant the Bluesky platform does not implement (e.g. Audio, or any future variants added to MediaType).
Common situations: Piping MediaInfo produced by another platform downloader into the Bluesky downloader, or code that adds a new MediaType variant without updating this match.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- No HLS URL available
- No GIF URL available
- Unsupported media type
- Track sem metadata pra resolver no YouTube
- download falhou: HTTP
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/27046e999c4aef2a.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/platforms/bluesky.rs:379
let output = opts.output_dir.join(&filename);
let bytes = direct_downloader::download_direct(
&self.client,
gif_url,
&output,
progress,
Some(&opts.cancel_token),
)
.await?;
Ok(DownloadResult {
file_path: output,
file_size_bytes: bytes,
duration_seconds: 0.0,
torrent_id: None,
})
}
_ => Err(anyhow!("Unsupported media type for download")),
}
}
}
View on GitHub (pinned to 8600b91f42)