mirror of
https://github.com/yattee/yattee.git
synced 2026-10-26 06:32:53 +00:00
Add an option to share videos via privacy frontend URLs
When enabled (the default), share links to YouTube videos point to the active source's web watch page instead of youtube.com. Invidious serves its frontend at the API URL; Piped uses its configured frontend URL. Videos the active source can't serve (PeerTube, extracted sources) and sources without a web frontend keep their original links. The toggle lives in Settings > Layout & Navigation > Sharing on iOS and macOS, and is shown only when an enabled source has a web watch page.
This commit is contained in:
@@ -174,6 +174,18 @@ struct Instance: Identifiable, Codable, Hashable, Sendable {
|
||||
frontendURL ?? url
|
||||
}
|
||||
|
||||
/// Base URL of the web watch page for building shareable YouTube links,
|
||||
/// when this instance has one: Invidious serves its frontend at the API
|
||||
/// URL, Piped needs the separately configured frontend URL (its API host
|
||||
/// has no watch pages), and Yattee Server has no web frontend at all.
|
||||
var watchPageBaseURL: URL? {
|
||||
switch type {
|
||||
case .invidious: return frontendURL ?? url
|
||||
case .piped: return frontendURL
|
||||
case .peertube, .yatteeServer: return nil
|
||||
}
|
||||
}
|
||||
|
||||
var contentSource: ContentSource {
|
||||
type.contentSource(for: url)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user