Wire Yattee Server playback through /proxy/relay when proxiesVideos is on

The Sources -> Edit Source -> Proxy toggle now renders for Yattee
Server entries (supportsVideoProxying gains .yatteeServer). When the
toggle is on, playback fetches go through
videoWithProxyStreamsAndCaptionsAndStoryboards with mode .relay, so
the server returns signed /proxy/relay URLs (byte-relay, supports
HTTP Range, no on-disk caching). Downloads keep going through mode
.download so the server-side /proxy/fast/ flow continues to cache
files for repeat use.

InvidiousAPI.proxyStreamsIfNeeded early-returns for .yatteeServer
since proxying is now done at fetch time via ?proxy=true rather than
client-side host rewriting.
This commit is contained in:
Arkadiusz Fal
2026-05-04 08:01:51 +02:00
parent 73e3d8164b
commit 93240b4314
4 changed files with 46 additions and 16 deletions

View File

@@ -597,6 +597,10 @@ extension InvidiousAPI {
/// - Returns: Streams with YouTube CDN URLs rewritten to go through the instance
static func proxyStreamsIfNeeded(_ streams: [Stream], instance: Instance) async -> [Stream] {
guard instance.supportsVideoProxying else { return streams }
// Yattee Server does proxying server-side via the ?proxy=true query
// on the videos endpoint (the converter mints signed /proxy/relay
// URLs). Don't second-guess that here by host-rewriting CDN URLs.
if instance.type == .yatteeServer { return streams }
// Find first YouTube CDN URL for 403 detection
let firstCDNURL = streams.first(where: { isYouTubeCDNURL($0.url) })?.url