{"record":{"id":"2c8634e4ff2a8180","repo":"tonhowtf/omniget","slug":"player-refresh-url-failed","errorCode":null,"errorMessage":"[player] refresh_url failed","messagePattern":"\\[player\\] refresh_url failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/lib/study-music/player-store.svelte.ts","lineNumber":569,"sourceCode":"    if (!track) return;\n    this.clearError();\n    void this.play(track, this.queue.length > 0 ? this.queue : undefined);\n  }\n\n  async refreshAndRetry() {\n    const track = this.currentTrack;\n    if (!track) return;\n    this.clearError();\n    this.status = \"resolving\";\n    this.loading = true;\n    if (track.source === \"youtube\" && track.youtube_video_id) {\n      try {\n        await pluginInvoke(\"study\", \"study:music:track:refresh_url\", {\n          source: \"youtube_music\",\n          external_id: track.youtube_video_id,\n        });\n      } catch (e) {\n        console.warn(\"[player] refresh_url failed\", e);\n      }\n    }\n    void this.play(track, this.queue.length > 0 ? this.queue : undefined);\n  }\n\n  skipOnError() {\n    this.clearError();\n    this.next();\n  }\n\n  private spotifyUnsub: (() => void) | null = null;\n  private installSpotifySync() {\n    if (this.spotifyUnsub) return;\n    this.spotifyUnsub = spotifySdk.onState((state) => this.applySpotifyState(state));\n    if (typeof document !== \"undefined\" && !this._spotifyVisibilityListener) {\n      const listener = () => {\n        if (document.visibilityState === \"visible\" && this.isSpotify()) {\n          void this.spotifyResyncFromSdk();","sourceCodeStart":551,"sourceCodeEnd":587,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src/lib/study-music/player-store.svelte.ts#L551-L587","documentation":"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.","triggerScenarios":"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.","commonSituations":"Expired googlevideo URLs, removed/private YouTube videos, extractor breakage after YouTube changes, or the study plugin being unavailable.","solutions":["Check the logged cause; if the video is unavailable, skip it","Retry refresh_url once (transient network failures)","Ensure the study plugin exposing refresh_url is running and updated","Rely on skipOnError/auto-skip so playback continues past the dead track"],"exampleFix":"// before\ncatch (e) {\n  console.warn(\"[player] refresh_url failed\", e);\n}\n// after\ncatch (e) {\n  console.warn(\"[player] refresh_url failed\", e);\n  this.skipOnError();\n  return;\n}","handlingStrategy":"retry","validationCode":"if (!track?.youtube_video_id) { console.warn(\"[player] no youtube id; skipping refresh\"); return; }","typeGuard":"function needsUrlRefresh(t: Track): boolean {\n  return t.source === \"youtube_music\" && typeof t.youtube_video_id === \"string\" && isUrlExpired(t);\n}","tryCatchPattern":"try {\n  await pluginInvoke(\"study\", \"study:music:track:refresh_url\", { source: \"youtube_music\", external_id: track.youtube_video_id });\n} catch (e) {\n  console.warn(\"[player] refresh_url failed\", e);\n  this.skipOnError();\n  return;\n}\nvoid this.play(track, this.queue.length > 0 ? this.queue : undefined);","preventionTips":["Refresh URLs proactively before they expire","Enable auto-skip-on-error so playback continues","Retry refresh once for transient network failures","Keep the extraction backend updated for YouTube changes"],"tags":["youtube","stream-url","audio-player"],"backgroundTag":"upstream-api-error","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}