更新了新的Bing search customer API支持
This commit is contained in:
parent
5885111183
commit
e5a1082359
|
@ -48,7 +48,7 @@ pnpm install
|
|||
PORT: 3000,
|
||||
};
|
||||
```
|
||||
如果您注册的是Bing Customer Search的API,您可以修改您的配置文件如下,并且填写您的Custom Configuration ID:
|
||||
如果您注册的是Bing Customer Search的API,您可以修改您的配置文件为如下,并且填写您的Custom Configuration ID:
|
||||
|
||||
```diff
|
||||
export default {
|
||||
|
@ -57,7 +57,7 @@ pnpm install
|
|||
BROWSER_TIMEOUT: 10000,
|
||||
BING_SEARCH_API_URL: 'https://api.bing.microsoft.com/v7.0/custom/',
|
||||
BING_SEARCH_API_KEY: 'YOUR_BING_SEARCH_API_KEY',
|
||||
CUSTOM_CONFIG_ID : 'YOUR_CUSTOM_CONFIG_ID', //将你的Custom Configuration ID放在此处
|
||||
CUSTOM_CONFIG_ID : 'YOUR_CUSTOM_CONFIG_ID', //将您的Custom Configuration ID放在此处
|
||||
HOST: 'localhost',
|
||||
PORT: 3000,
|
||||
};
|
||||
|
|
|
@ -172,9 +172,9 @@ abstract class BaseBrowser {
|
|||
logger.debug(`Searching for: ${query}`);
|
||||
const search = new URLSearchParams({ q: query });
|
||||
recency_days > 0 && search.append('recency_days', recency_days.toString());
|
||||
if (config.CUSTOM_CONFIG_ID !== undefined) {
|
||||
search.append('customconfig', config.CUSTOM_CONFIG_ID);
|
||||
}
|
||||
if (config.CUSTOM_CONFIG_ID) {
|
||||
search.append('customconfig', config.CUSTOM_CONFIG_ID.toString());
|
||||
}
|
||||
const url = `${config.BING_SEARCH_API_URL}/search?${search.toString()}`;
|
||||
console.log('Full URL:', url); // 输出完整的 URL查看是否正确
|
||||
|
||||
|
|
Loading…
Reference in New Issue