tonhowtf/omniget · error · Error

Track sem metadata pra resolver no YouTube

Error message

Track sem metadata pra resolver no YouTube

What it means

Raised by download when the MediaInfo produced by native_get_media_info has an empty available_qualities list. The download flow picks the requested quality or falls back to the first entry; with no entries at all there is nothing to download, so it errors.

Solutions

  1. Check upstream parsing: log how many qualities were discovered and why entries were filtered out.
  2. Validate the access token/URL construction — invalid tokens can lead to responses with no playable renditions.
  3. Verify with a browser/VLC that the clip actually has downloadable renditions.
  4. Fail early in native_get_media_info with a clearer 'no renditions' error instead of surfacing in download.

Example fix

// before
let first = info
    .available_qualities
    .first()
    .ok_or_else(|| anyhow!("No media URL available"))?;
// after
if info.available_qualities.is_empty() {
    anyhow::bail!("Clip has no downloadable renditions (slug: {}) — it may be muted or removed", slug);
}
let first = &info.available_qualities[0];
Defensive patterns

Strategy: validation

Validate before calling

// Before download, ensure at least one rendition exists
if media_info.available_qualities.is_empty() {
    return Err("no downloadable renditions for this clip");
}

Type guard

fn has_renditions(info: &MediaInfo) -> bool {
    !info.available_qualities.is_empty()
}

Try / catch

// Fall back with a clear user message
match download(url, opts).await {
    Err(e) if e.to_string() == "No media URL available" => {
        ui.show("This clip has no downloadable streams — it may be muted or removed");
    }
    other => other?,
}

Prevention

When it happens

Trigger: info.available_qualities.first() returns None — the media-info step completed but produced zero video qualities, typically because clip GET responses contained no selectable renditions.

Common situations: Clip whose formats were stripped by Twitch (e.g. muted/metadata-only clips); token built with wrong signature/value causing rendition discovery to fail silently upstream; fetch succeeded but quality parsing filtered everything out; empty-required-field style gaps from an unexpected GQL shape.

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


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/61c573dd79432e2d. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/study-music/spotify-store.svelte.ts:128

  const cover = pickImage(track.album.images, 300);
  return {
    id: hashStringToInt(track.uri),
    path: track.uri,
    title: track.name,
    artist: track.artists.map((a) => a.name).join(", "),
    album: track.album.name,
    duration_ms: track.duration_ms,
    cover_path: null,
    source: "spotify",
    spotify_uri: track.uri,
    spotify_cover_url: cover ?? undefined,
    isrc: track.isrc,
  };
}

async function resolveSpotifyToYoutube(track: MusicTrack): Promise<string> {
  if (!track.title || !track.artist) {
    throw new Error("Track sem metadata pra resolver no YouTube");
  }
  console.log("[spotify-yt] resolving:", {
    title: track.title,
    artist: track.artist,
    isrc: track.isrc,
    duration_ms: track.duration_ms,
  });
  const res = await pluginInvoke<{
    youtube_url: string;
    video_id: string;
    video_title: string;
    channel: string;
    score: number;
  }>("study", "study:spotify:resolve_youtube", {
    title: track.title,
    artist: track.artist,
    durationMs: track.duration_ms ?? 0,
    isrc: track.isrc,

View on GitHub (pinned to 8600b91f42)