Proxy podcast audio from publishers on request

Browsers stream episode audio from the publisher by default. For
publishers they cannot play directly (CORS, mixed content), the
administrator can enable podcast_audio_proxy_enabled (admin Settings,
FURU_PODCAST_AUDIO_PROXY_ENABLED). The endpoints live in a new app at
/api/podcasts:

- GET /episodes/{episode_id}/audio streams an episode of the signed-in
  account. The URL comes from the account's catalog, never from the
  request. Requests go through SafeHttp with one sanitized byte Range and
  no client headers; 200/206/416 pass through, only audio content types
  are served, with nosniff and a sandbox CSP, and responses stop at 1 GiB
  or 4 hours.
- GET /episodes/{episode_id}/source returns the publisher URL and, when
  enabled, the proxy URL.
- POST /{podcast_id}/refresh refreshes one subscribed feed now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
sanapachandClaude Opus 5.5 committed 2026-11-20 15:12:38 +02:00
1 parent bf9a6abc3f
commit 2c0c3d21aa
12 files changed
+1164 -5

No files matched your search

+7
View File
@@ -1566,6 +1566,13 @@ async fn postgres_podcast_refresh_job_schedules_backs_off_and_moves_feeds() {
let episode_id = episodes[0].episode.episode_id.clone();
assert_eq!(episodes[0].episode.audio_url, server.url("/audio/one.mp3"));
// The proxy and the source endpoint only find episodes of the account.
assert_eq!(
store.audio_source(a, &episode_id).await.unwrap(),
Some((server.url("/audio/one.mp3"), Some("audio/mpeg".to_string())))
);
assert_eq!(store.audio_source(c, &episode_id).await.unwrap(), None);
// Nothing is due before the interval; afterwards the request is
// conditional and the catalog stays as it is.
assert!(due_for(&store, &users, t0 + 1000).await.is_empty());