mirror of
https://github.com/yattee/yattee.git
synced 2026-02-21 10:19:46 +00:00
Add video proxy support with live toggle for Invidious/Piped instances
Adds a "Proxy videos" toggle in instance settings that routes video streams through the instance instead of connecting directly to YouTube CDN. Includes auto-detection of 403 blocks and live re-application of proxy settings without requiring app restart or video reload.
This commit is contained in:
@@ -189,6 +189,32 @@ struct StreamResolution: Codable, Hashable, Sendable, Comparable, CustomStringCo
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - URL Rewriting
|
||||
|
||||
extension Stream {
|
||||
/// Creates a copy of this stream with a different URL.
|
||||
/// Used for proxying streams through an instance.
|
||||
func withURL(_ newURL: URL) -> Stream {
|
||||
Stream(
|
||||
url: newURL,
|
||||
resolution: resolution,
|
||||
format: format,
|
||||
videoCodec: videoCodec,
|
||||
audioCodec: audioCodec,
|
||||
bitrate: bitrate,
|
||||
fileSize: fileSize,
|
||||
isAudioOnly: isAudioOnly,
|
||||
isLive: isLive,
|
||||
mimeType: mimeType,
|
||||
audioLanguage: audioLanguage,
|
||||
audioTrackName: audioTrackName,
|
||||
isOriginalAudio: isOriginalAudio,
|
||||
httpHeaders: httpHeaders,
|
||||
fps: fps
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Preview Data
|
||||
|
||||
extension Stream {
|
||||
|
||||
Reference in New Issue
Block a user