From 1d6ddabb7bb96026e55d4f8da3b652fb366eb530 Mon Sep 17 00:00:00 2001 From: mrwnslz Date: Thu, 15 Oct 2026 14:28:37 +0200 Subject: [PATCH] =?UTF-8?q?Podcast-Player:=20abgelaufene=20Download-Links?= =?UTF-8?q?=20=C3=BCberstehen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SoundCloud leitet die Feed-Adresse auf einen signierten Link um, der nach zwei Minuten abläuft. Das Audio-Element fragt für jeden weiteren Teil der Datei diesen Link an, wird abgewiesen (MEDIA_ERR_NETWORK) und blieb danach kaputt, bis die App neu startete. Jetzt wird die Folge bei einem Fehler an derselben Stelle neu geladen (bis zu dreimal pro Minute), und nach dem Aufgeben beim nächsten Abspielen frisch. Co-Authored-By: Claude Opus 5.5 --- static/js/podcasts-web.js | 16 +++++++++++++++- static/js/sw.js | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/static/js/podcasts-web.js b/static/js/podcasts-web.js index 108da64..519ad2f 100644 --- a/static/js/podcasts-web.js +++ b/static/js/podcasts-web.js @@ -920,12 +920,26 @@ applyKind(); report(); }); + // Some hosts hand out a signed address that runs out within minutes (SoundCloud: 2). + // The element keeps asking that one for the next part of the file and gets refused: + // loaded anew from the feed's address (a fresh link) at the same place, it plays on. + // An element that failed can't play again, so after giving up it's loaded anew on play. + let failures = 0; + let failedAt = 0; audio.addEventListener('error', () => { if (!loaded || !audio.getAttribute('src')) return; + const at = posMs(); + const play = wantPlay; + if (Date.now() - failedAt > 60000) failures = 0; + failedAt = Date.now(); + loaded = false; + startAt = at; + mustReach = null; + if (play && ++failures <= 3) { resume(); return; } error = 'MEDIA_ERR_' + (audio.error ? audio.error.code : 0); wantPlay = false; buffering = false; - toast('Diese Folge lässt sich gerade nicht abspielen'); + if (play) toast('Diese Folge lässt sich gerade nicht abspielen'); report(); syncSoon(); }); diff --git a/static/js/sw.js b/static/js/sw.js index 5fe14c6..9e77855 100644 --- a/static/js/sw.js +++ b/static/js/sw.js @@ -2,7 +2,7 @@ * diora service worker — caches the app shell for offline use. */ -const CACHE = 'diora-v110'; +const CACHE = 'diora-v111'; const SHELL = [ '/static/css/app.css', '/static/js/app/01-core.js',