tonhowtf/omniget · error · anyhow::Error
No URL available
Error message
No URL available
What it means
Douyin `download` picks the first entry of `available_qualities` as the canonical URL; if the list is empty or the URL is empty it aborts. It means the MediaInfo has no usable download URL even though download was invoked.
Solutions
- Re-run get_media_info to obtain fresh MediaInfo with populated URLs before downloading.
- Check yt-dlp output for the Douyin link to confirm the platform actually exposes a direct media URL.
- Validate in get_media_info that at least one non-empty URL exists and fail there with a clearer message.
- Refresh cookies/auth for Douyin if extraction returns metadata but no media URLs.
Example fix
// before
let canonical = info.available_qualities.first().map(|q| q.url.as_str()).unwrap_or("");
if canonical.is_empty() { return Err(anyhow!("No URL available")); }
// after
let canonical = info
.available_qualities
.iter()
.map(|q| q.url.as_str())
.find(|u| !u.is_empty())
.ok_or_else(|| anyhow!("No URL available for Douyin media '{}' (qualities empty)", info.title))?; Defensive patterns
Strategy: validation
Validate before calling
// Rust, before calling download
if info.available_qualities.iter().all(|q| q.url.is_empty()) {
return Err(anyhow!("Douyin MediaInfo has no usable URL; re-run get_media_info"));
} Prevention
- Validate MediaInfo immediately after get_media_info and before queuing the download.
- Re-resolve fresh info rather than caching MediaInfo across long-running sessions.
- Keep yt-dlp current so Douyin extraction keeps returning media URLs.
When it happens
Trigger: Calling `download` with MediaInfo whose `available_qualities.first()` is None or whose first quality URL is an empty string.
Common situations: get_media_info partially failed (found title/qualities but no URL), a Douyin page whose video requires a refreshed resolution, or stale cached MediaInfo passed to a later download step.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/175999b0c2b1e17d.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/src/platforms/douyin/mod.rs:264
opts: &DownloadOptions,
progress: mpsc::Sender<ProgressUpdate>,
) -> anyhow::Result<DownloadResult> {
let _ = progress.send(ProgressUpdate::percent(0.0)).await;
let ytdlp_path = match &opts.ytdlp_path {
Some(p) => p.clone(),
None => ytdlp::find_ytdlp_cached()
.await
.ok_or_else(|| anyhow!("yt-dlp not found"))?,
};
let canonical = info
.available_qualities
.first()
.map(|q| q.url.as_str())
.unwrap_or("");
if canonical.is_empty() {
return Err(anyhow!("No URL available"));
}
let canonical = Self::resolve_url(canonical).await;
let quality_height = opts
.quality
.as_ref()
.and_then(|q| q.trim_end_matches('p').parse::<u32>().ok());
let extra = Self::extra_flags();
ytdlp::download_video(
&ytdlp_path,
&canonical,
&opts.output_dir,
quality_height,
progress,
opts.download_mode.as_deref(),
opts.format_id.as_deref(),View on GitHub (pinned to 8600b91f42)