fix(discover): provide language when fetching

some engines provide empty response when no language is provided.

fix #618
This commit is contained in:
amoshydra
2025-07-17 02:01:45 +08:00
parent cf8dec53ca
commit f7b4e32218

View File

@ -36,6 +36,7 @@ export const GET = async (req: Request) => {
{ {
engines: ['bing news'], engines: ['bing news'],
pageno: 1, pageno: 1,
language: "en",
}, },
) )
).results; ).results;
@ -49,7 +50,11 @@ export const GET = async (req: Request) => {
data = ( data = (
await searchSearxng( await searchSearxng(
`site:${articleWebsites[Math.floor(Math.random() * articleWebsites.length)]} ${topics[Math.floor(Math.random() * topics.length)]}`, `site:${articleWebsites[Math.floor(Math.random() * articleWebsites.length)]} ${topics[Math.floor(Math.random() * topics.length)]}`,
{ engines: ['bing news'], pageno: 1 }, {
engines: ['bing news'],
pageno: 1,
language: "en"
},
) )
).results; ).results;
} }