mirror of
https://github.com/direct-img/direct-img.link.git
synced 2026-10-17 10:17:53 +00:00
Fix: Turn off Bing SafeSearch to match Brave
safesearch=moderate isn't a Bing parameter. Bing's filter is set by the SRCHHPGUSR=ADLT=OFF cookie, so send that (plus adlt=off). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
export async function bingImageSearchFallback(query) {
|
export async function bingImageSearchFallback(query) {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`https://www.bing.com/images/search?q=${encodeURIComponent(query)}&safesearch=moderate`, {
|
// SafeSearch off, like Brave. The cookie is what actually sets it; adlt= alone is ignored.
|
||||||
headers: {
|
const res = await fetch(`https://www.bing.com/images/search?q=${encodeURIComponent(query)}&adlt=off`, {
|
||||||
|
headers: {
|
||||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
|
||||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
|
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
||||||
|
"Cookie": "SRCHHPGUSR=ADLT=OFF"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (!res.ok) return null;
|
if (!res.ok) return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user