mirror of
https://github.com/yattee/yattee.git
synced 2026-06-05 14:24:19 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user