mirror of
https://github.com/yattee/yattee.git
synced 2026-08-26 00:42:33 +00:00
Fix www.duckduckgo.com misrouting to yt-dlp external video extraction (#962)
This commit is contained in:
@@ -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"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|||||||
Reference in New Issue
Block a user