更新了新的browser代码,使得其能够兼容两种不同的API
This commit is contained in:
parent
3336f1e954
commit
2b78349c58
|
@ -172,7 +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());
|
||||
search.append('customconfig', config.CUSTOM_CONFIG_ID);
|
||||
if (config.CUSTOM_CONFIG_ID !== undefined) {
|
||||
search.append('customconfig', config.CUSTOM_CONFIG_ID);
|
||||
}
|
||||
const url = `${config.BING_SEARCH_API_URL}/search?${search.toString()}`;
|
||||
console.log('Full URL:', url); // 输出完整的 URL查看是否正确
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
export default {
|
||||
LOG_LEVEL: 'debug',
|
||||
|
||||
BROWSER_TIMEOUT: 10000,
|
||||
BING_SEARCH_API_URL: 'https://api.bing.microsoft.com/v7.0/custom/',
|
||||
BING_SEARCH_API_KEY: 'YOUR_BING_SEARCH_API_KEY',
|
||||
|
@ -8,3 +7,5 @@ export default {
|
|||
HOST: 'localhost',
|
||||
PORT: 3000,
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue