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
@@ -545,6 +545,8 @@ struct AdminSettingsValues {
|
||||
youtube_proxy_id: String,
|
||||
#[serde(default)]
|
||||
youtube_cookie_id: String,
|
||||
#[serde(default)]
|
||||
podcast_audio_proxy_enabled: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
|
||||
@@ -615,6 +617,7 @@ struct AdminSettingsSources {
|
||||
torrent_proxy_id: &'static str,
|
||||
youtube_proxy_id: &'static str,
|
||||
youtube_cookie_id: &'static str,
|
||||
podcast_audio_proxy_enabled: &'static str,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
@@ -667,6 +670,8 @@ pub(super) struct UpdateSettingsRequest {
|
||||
youtube_proxy_id: String,
|
||||
#[serde(default)]
|
||||
youtube_cookie_id: String,
|
||||
#[serde(default)]
|
||||
podcast_audio_proxy_enabled: bool,
|
||||
}
|
||||
|
||||
fn default_similarity_model() -> String {
|
||||
@@ -1370,6 +1375,10 @@ pub async fn update_settings(
|
||||
("torrent_proxy_id", torrent_proxy_id),
|
||||
("youtube_proxy_id", youtube_proxy_id),
|
||||
("youtube_cookie_id", youtube_cookie_id),
|
||||
(
|
||||
"podcast_audio_proxy_enabled",
|
||||
body.podcast_audio_proxy_enabled.to_string(),
|
||||
),
|
||||
];
|
||||
for (key, value) in fields {
|
||||
let mut entry = ConfigEntry::new(key.to_string(), value);
|
||||
@@ -1714,6 +1723,7 @@ fn settings_dto(
|
||||
torrent_proxy_id: config.torrent_proxy_id,
|
||||
youtube_proxy_id: config.youtube_proxy_id,
|
||||
youtube_cookie_id: config.youtube_cookie_id,
|
||||
podcast_audio_proxy_enabled: config.podcast_audio_proxy_enabled,
|
||||
},
|
||||
sources: AdminSettingsSources {
|
||||
auth_password_enabled: sources.auth_password_enabled.code(),
|
||||
@@ -1750,6 +1760,7 @@ fn settings_dto(
|
||||
torrent_proxy_id: sources.torrent_proxy_id.code(),
|
||||
youtube_proxy_id: sources.youtube_proxy_id.code(),
|
||||
youtube_cookie_id: sources.youtube_cookie_id.code(),
|
||||
podcast_audio_proxy_enabled: sources.podcast_audio_proxy_enabled.code(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user