Fix www.duckduckgo.com misrouting to yt-dlp external video extraction (#962)

This commit is contained in:
Yuri Chukhlib
2026-08-23 12:21:50 +02:00
committed by GitHub
parent f4cf9e8b8d
commit 63b625bcde
2 changed files with 21 additions and 1 deletions

View File

@@ -84,7 +84,7 @@ struct URLRouter: Sendable {
let excludedHosts = [ let excludedHosts = [
"google.com", "www.google.com", "google.com", "www.google.com",
"bing.com", "www.bing.com", "bing.com", "www.bing.com",
"duckduckgo.com", "duckduckgo.com", "www.duckduckgo.com",
"apple.com", "www.apple.com", "apple.com", "www.apple.com",
"github.com", "www.github.com" "github.com", "www.github.com"
] ]

View File

@@ -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 // MARK: - YouTube Channel URL Tests
@Test("Parse YouTube channel URL") @Test("Parse YouTube channel URL")