tonhowtf/omniget · error
No URL found in MediaInfo
Error message
No URL found in MediaInfo
What it means
magnet.rs raises this in download() when MediaInfo.available_qualities is empty, so there is no candidate URL to download. The resolver produced a MediaInfo struct but with no usable quality/URL entries, so the downloader bails immediately at the first progress update (0%).
Solutions
- Validate info.available_qualities is non-empty before calling download(); return a clearer upstream error if it is empty.
- Check how MediaInfo was produced: ensure the resolver populated available_qualities (not list-only mode, no empty torrent).
- Inspect the magnet/metadata response — a torrent with zero files or only unsupported entries yields no URLs.
- Update/fix the platform resolver so quality URLs are extracted for this content type.
Example fix
// before
let url = match info.available_qualities.first() {
Some(q) => &q.url,
None => anyhow::bail!("No URL found in MediaInfo"),
};
// after
if info.available_qualities.is_empty() {
anyhow::bail!(
"Torrent '{}' contains no downloadable files",
info.title
);
}
let url = &info.available_qualities[0].url; Defensive patterns
Strategy: validation
Validate before calling
// before calling download
if info.available_qualities.is_empty() {
return Err(anyhow!(
"No downloadable files in '{}'; refusing to start download",
info.title
));
} Prevention
- Always inspect MediaInfo.available_qualities right after resolving
- Reject torrents with zero files or only unsupported extensions early
- Add a resolver test asserting qualities are populated for known magnets
When it happens
Trigger: Calling download() with opts/info whose available_qualities vector is empty: match info.available_qualities.first() { Some(q) => &q.url, None => bail!("No URL found in MediaInfo") } at magnet.rs:97.
Common situations: Magnet metadata fetch returned torrents/files but the quality-extraction step matched nothing (unsupported file types, empty torrent); resolver ran in list-only mode and produced entries without URLs; upstream metadata parsing changed shape after a library update.
Understand the failure class
Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.
Related errors
- Download cancelled
- Torrent download failed
- Download cancelled during session creation
- Torrent was added in list-only mode
- Failed to add torrent
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/4ebf356045fb34b1.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/platforms/magnet.rs:97
url: url.to_string(),
format: "torrent".to_string(),
}],
media_type: MediaType::Video,
file_size_bytes: None,
})
}
async fn download(
&self,
info: &MediaInfo,
opts: &DownloadOptions,
progress: mpsc::Sender<ProgressUpdate>,
) -> anyhow::Result<DownloadResult> {
let _ = progress.send(ProgressUpdate::percent(0.0)).await;
let url = match info.available_qualities.first() {
Some(q) => &q.url,
None => anyhow::bail!("No URL found in MediaInfo"),
};
let output_dir = &opts.output_dir;
// Get or create the shared session, recreating if output_dir changed
let session = {
let mut guard = self.session.lock().await;
let mut dir_guard = self.session_output_dir.lock().await;
let need_new_session = match (&*guard, &*dir_guard) {
(Some(_), Some(prev_dir)) => prev_dir != output_dir,
(None, _) => true,
_ => true,
};
if need_new_session {
if guard.is_some() {
tracing::info!("[magnet] output dir changed, recreating session");
}
let listen_port = opts.torrent_listen_port.unwrap_or(6881).min(65525);View on GitHub (pinned to 8600b91f42)