mirror of
https://github.com/yattee/yattee.git
synced 2025-11-24 02:08:17 +00:00
Fix YouTube share links including port from Invidious instance
Fixes #870 where YouTube share links incorrectly included the port number from the user's Invidious instance URL (e.g., http://www.youtube.com:3000 instead of http://www.youtube.com). Added defensive logic to explicitly clear the port when creating share URLs with frontend URL strings containing "youtube.com". This ensures YouTube share links always use the standard format without port numbers, regardless of the user's instance configuration.
This commit is contained in:
@@ -114,6 +114,10 @@ extension VideosAPI {
|
||||
let frontendURL = URL(string: frontendURLString)
|
||||
{
|
||||
urlComponents = URLComponents(url: frontendURL, resolvingAgainstBaseURL: false)
|
||||
// Ensure port is not included when sharing to external frontends like YouTube
|
||||
if frontendURLString.contains("youtube.com") {
|
||||
urlComponents?.port = nil
|
||||
}
|
||||
} else if let instanceComponents = account?.instance?.urlComponents {
|
||||
urlComponents = instanceComponents
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user