diff --git a/Yattee/Services/Navigation/URLRouter.swift b/Yattee/Services/Navigation/URLRouter.swift index 67042e4f..98c9e45f 100644 --- a/Yattee/Services/Navigation/URLRouter.swift +++ b/Yattee/Services/Navigation/URLRouter.swift @@ -84,7 +84,7 @@ struct URLRouter: Sendable { let excludedHosts = [ "google.com", "www.google.com", "bing.com", "www.bing.com", - "duckduckgo.com", + "duckduckgo.com", "www.duckduckgo.com", "apple.com", "www.apple.com", "github.com", "www.github.com" ] diff --git a/YatteeTests/NavigationTests.swift b/YatteeTests/NavigationTests.swift index 56639136..aa46c789 100644 --- a/YatteeTests/NavigationTests.swift +++ b/YatteeTests/NavigationTests.swift @@ -273,6 +273,26 @@ struct URLRouterTests { } } + // MARK: - External Host Exclusion Tests + + @Test("www.duckduckgo.com is excluded from external video routing") + func wwwDuckDuckGoExcluded() { + let url = URL(string: "https://www.duckduckgo.com/?q=cat+videos")! + let destination = router.route(url) + if case .externalVideo = destination { + Issue.record("www.duckduckgo.com must not route to externalVideo; yt-dlp extraction should not run for a search engine") + } + } + + @Test("duckduckgo.com bare host remains excluded from external video") + func duckDuckGoBareExcluded() { + let url = URL(string: "https://duckduckgo.com/?q=test")! + let destination = router.route(url) + if case .externalVideo = destination { + Issue.record("duckduckgo.com must not route to externalVideo; yt-dlp extraction should not run for a search engine") + } + } + // MARK: - YouTube Channel URL Tests @Test("Parse YouTube channel URL")