tonhowtf/omniget · warning

[player] refresh_url failed

Error message

[player] refresh_url failed

What it means

Non-fatal warning: refreshing an expired YouTube stream URL via the study plugin (study:music:track:refresh_url) failed. The store logs it and proceeds to attempt playback anyway with the (possibly stale) URL.

Solutions

  1. Check the logged cause; if the video is unavailable, skip it
  2. Retry refresh_url once (transient network failures)
  3. Ensure the study plugin exposing refresh_url is running and updated
  4. Rely on skipOnError/auto-skip so playback continues past the dead track

Example fix

// before
catch (e) {
  console.warn("[player] refresh_url failed", e);
}
// after
catch (e) {
  console.warn("[player] refresh_url failed", e);
  this.skipOnError();
  return;
}
Defensive patterns

Strategy: retry

Validate before calling

if (!track?.youtube_video_id) { console.warn("[player] no youtube id; skipping refresh"); return; }

Type guard

function needsUrlRefresh(t: Track): boolean {
  return t.source === "youtube_music" && typeof t.youtube_video_id === "string" && isUrlExpired(t);
}

Try / catch

try {
  await pluginInvoke("study", "study:music:track:refresh_url", { source: "youtube_music", external_id: track.youtube_video_id });
} catch (e) {
  console.warn("[player] refresh_url failed", e);
  this.skipOnError();
  return;
}
void this.play(track, this.queue.length > 0 ? this.queue : undefined);

Prevention

When it happens

Trigger: pluginInvoke("study", "study:music:track:refresh_url", { source: "youtube_music", external_id }) rejects before re-calling play(track, queue) — backend resolution failure, invalid/expired video id, or network error.

Common situations: Expired googlevideo URLs, removed/private YouTube videos, extractor breakage after YouTube changes, or the study plugin being unavailable.

Related errors


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

Appendix: source

Thrown at src/lib/study-music/player-store.svelte.ts:569

    if (!track) return;
    this.clearError();
    void this.play(track, this.queue.length > 0 ? this.queue : undefined);
  }

  async refreshAndRetry() {
    const track = this.currentTrack;
    if (!track) return;
    this.clearError();
    this.status = "resolving";
    this.loading = true;
    if (track.source === "youtube" && track.youtube_video_id) {
      try {
        await pluginInvoke("study", "study:music:track:refresh_url", {
          source: "youtube_music",
          external_id: track.youtube_video_id,
        });
      } catch (e) {
        console.warn("[player] refresh_url failed", e);
      }
    }
    void this.play(track, this.queue.length > 0 ? this.queue : undefined);
  }

  skipOnError() {
    this.clearError();
    this.next();
  }

  private spotifyUnsub: (() => void) | null = null;
  private installSpotifySync() {
    if (this.spotifyUnsub) return;
    this.spotifyUnsub = spotifySdk.onState((state) => this.applySpotifyState(state));
    if (typeof document !== "undefined" && !this._spotifyVisibilityListener) {
      const listener = () => {
        if (document.visibilityState === "visible" && this.isSpotify()) {
          void this.spotifyResyncFromSdk();

View on GitHub (pinned to 8600b91f42)