fix(discover): provide language when fetching
some engines provide empty response when no language is provided. fix #618
This commit is contained in:
parent
cf8dec53ca
commit
f7b4e32218
1 changed files with 6 additions and 1 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue