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:
1 parent
bf9a6abc3f
commit
2c0c3d21aa
12 files changed
+1164
-5
No files matched your search
@@ -149,6 +149,7 @@ pub struct ConfigSources {
|
||||
pub torrent_proxy_id: ConfigSource,
|
||||
pub youtube_proxy_id: ConfigSource,
|
||||
pub youtube_cookie_id: ConfigSource,
|
||||
pub podcast_audio_proxy_enabled: ConfigSource,
|
||||
}
|
||||
|
||||
impl Default for ConfigSources {
|
||||
@@ -190,6 +191,7 @@ impl Default for ConfigSources {
|
||||
torrent_proxy_id: ConfigSource::Default,
|
||||
youtube_proxy_id: ConfigSource::Default,
|
||||
youtube_cookie_id: ConfigSource::Default,
|
||||
podcast_audio_proxy_enabled: ConfigSource::Default,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -407,6 +409,10 @@ pub struct AppConfig {
|
||||
pub youtube_proxy_id: String,
|
||||
/// Saved cookie-file id used by yt-dlp; empty means no cookies.
|
||||
pub youtube_cookie_id: String,
|
||||
/// Whether the server proxies podcast episode audio from publishers for
|
||||
/// browsers that cannot load it directly (CORS, mixed content). Off by
|
||||
/// default: browsers stream from the publisher URL.
|
||||
pub podcast_audio_proxy_enabled: bool,
|
||||
}
|
||||
|
||||
impl Default for AppConfig {
|
||||
@@ -451,6 +457,7 @@ impl Default for AppConfig {
|
||||
torrent_proxy_id: String::new(),
|
||||
youtube_proxy_id: String::new(),
|
||||
youtube_cookie_id: String::new(),
|
||||
podcast_audio_proxy_enabled: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -493,6 +500,7 @@ impl_env_overrides!(
|
||||
torrent_proxy_id,
|
||||
youtube_proxy_id,
|
||||
youtube_cookie_id,
|
||||
podcast_audio_proxy_enabled,
|
||||
);
|
||||
|
||||
impl AppConfig {
|
||||
@@ -636,6 +644,7 @@ impl AppConfig {
|
||||
apply_db_field!(torrent_proxy_id);
|
||||
apply_db_field!(youtube_proxy_id);
|
||||
apply_db_field!(youtube_cookie_id);
|
||||
apply_db_field!(podcast_audio_proxy_enabled);
|
||||
}
|
||||
|
||||
pub fn parsed_download_proxies(&self) -> anyhow::Result<Vec<DownloadProxy>> {
|
||||
@@ -693,6 +702,7 @@ mod tests {
|
||||
assert!(cfg.torrent_downloads_enabled);
|
||||
assert!(cfg.youtube_downloads_enabled);
|
||||
assert!(cfg.parsed_download_proxies().unwrap().is_empty());
|
||||
assert!(!cfg.podcast_audio_proxy_enabled);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user