mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 21:07:50 +08:00
@@ -10,7 +10,7 @@ class BingAPI(Search):
|
|||||||
self.module = 'Search'
|
self.module = 'Search'
|
||||||
self.source = 'BingAPISearch'
|
self.source = 'BingAPISearch'
|
||||||
self.addr = 'https://api.cognitive.microsoft.com/' \
|
self.addr = 'https://api.cognitive.microsoft.com/' \
|
||||||
'bingcustomsearch/v7.0/search'
|
'bing/v7.0/search'
|
||||||
self.id = api.bing_api_id
|
self.id = api.bing_api_id
|
||||||
self.key = api.bing_api_key
|
self.key = api.bing_api_key
|
||||||
self.limit_num = 1000 # 必应同一个搜索关键词限制搜索条数
|
self.limit_num = 1000 # 必应同一个搜索关键词限制搜索条数
|
||||||
@@ -31,8 +31,8 @@ class BingAPI(Search):
|
|||||||
self.header = {'Ocp-Apim-Subscription-Key': self.key}
|
self.header = {'Ocp-Apim-Subscription-Key': self.key}
|
||||||
self.proxy = self.get_proxy(self.source)
|
self.proxy = self.get_proxy(self.source)
|
||||||
query = 'site:' + domain + filtered_subdomain
|
query = 'site:' + domain + filtered_subdomain
|
||||||
params = {'q': query, 'customconfig': self.id, 'safesearch': 'Off',
|
params = {'q': query, 'safesearch': 'Off', 'count': self.per_page_num,
|
||||||
'count': self.per_page_num, 'offset': self.page_num}
|
'offset': self.page_num}
|
||||||
resp = self.get(self.addr, params)
|
resp = self.get(self.addr, params)
|
||||||
if not resp:
|
if not resp:
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user