tonhowtf/omniget · warning

[study-music] yt error:

Error message

[study-music] yt error:

What it means

YouTube track playback/lookup failed in the study-music player and the error component was mounted. A $effect calls resolve(error) to normalize the raw error for display and logs the raw value with console.warn.

Solutions

  1. Read the logged raw error to classify availability vs expiry vs network
  2. Refresh the stream URL (player refresh_url path) and retry playback
  3. Skip the track or enable auto-skip-on-error
  4. Open the video in browser via the component's link to confirm availability

Example fix

// before
$effect(() => {
  void resolve(error);
  console.warn("[study-music] yt error:", error);
});
// after
$effect(() => {
  const resolved = resolve(error);
  console.warn("[study-music] yt error:", resolved?.kind ?? "unknown", error);
});
Defensive patterns

Strategy: fallback

Validate before calling

if (!videoId || !/^[\w-]{11}$/.test(videoId)) throw new Error("invalid youtube video id");

Type guard

function isResolvableYtTrack(t: unknown): t is YtTrack {
  return !!t && typeof t === "object" && typeof (t as YtTrack).youtube_video_id === "string" && (t as YtTrack).youtube_video_id.length === 11;
}

Try / catch

try {
  await ytPlayer.play(track);
} catch (e) {
  console.warn("[study-music] yt error:", e);
  await refreshTrackUrl(track); // refresh_url path
  skipToNextTrack();
}

Prevention

When it happens

Trigger: A YouTube source fails during resolve or streaming (invalid video id, unavailable/private video, expired stream URL, network or API error) and YoutubeError receives it as the error prop.

Common situations: Deleted or age/region-restricted videos, expiring googlevideo stream URLs, yt-dlp/backend extractor breakage after YouTube changes, or network offline.

Related errors


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

Appendix: source

Thrown at src/lib/study-music-youtube-components/YoutubeError.svelte:28

    onFallback?: () => void;
  };
  let { error, onRetry, fallbackLabel, onFallback }: Props = $props();

  let humanized = $state<string>("");
  let showDetails = $state(false);

  async function resolve(err: string) {
    try {
      const res = await studyYoutubeHumanizeError({ error: err });
      humanized = res.humanized;
    } catch {
      /* keep default */
    }
  }

  $effect(() => {
    void resolve(error);
    console.warn("[study-music] yt error:", error);
  });
</script>

<div class="yt-error" role="alert">
  <svg
    viewBox="0 0 24 24"
    width="22"
    height="22"
    fill="none"
    stroke="currentColor"
    stroke-width="1.6"
    stroke-linecap="round"
    stroke-linejoin="round"
    aria-hidden="true"
  >
    <circle cx="12" cy="12" r="10" />
    <line x1="12" y1="8" x2="12" y2="13" />
    <line x1="12" y1="16" x2="12" y2="16.01" />

View on GitHub (pinned to 8600b91f42)