8000 Add google_api_addr and bing_api_addr settings by Specstreamai · Pull Request #425 · shmilylty/OneForAll · GitHub
[go: up one dir, main page]

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# cognitive-services/bing-web-search-api/#web-json
bing_api_id = ''
bing_api_key = ''
# bing_api_addr默认空使用https://api.bing.microsoft.com/v7.0/search
bing_api_addr = ''

# SecurityTrails可以免费注册获取API:https://securitytrails.com/corp/api
securitytrails_api = ''
Expand All @@ -32,6 +34,8 @@
google_api_id = '' # Google API自定义搜索引擎id
# https://developers.google.com/custom-search/v1/overview#api_key
google_api_key = '' # Google API自定义搜索key
# google_api_addr默认空使用https://www.googleapis.com/customsearch/v1
google_api_addr = ''

# https://api.passivetotal.org/api/docs/
riskiq_api_username = ''
Expand Down
< 8000 div class="js-expand-full-wrapper d-inline-block">
4 changes: 4 additions & 0 deletions config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@
# cognitive-services/bing-web-search-api/#web-json
bing_api_id = ''
bing_api_key = ''
# bing_api_addr默认空使用https://api.bing.microsoft.com/v7.0/search
bing_api_addr = ''

# SecurityTrails可以免费注册获取API:https://securitytrails.com/corp/api
securitytrails_api = ''
Expand All @@ -200,6 +202,8 @@
google_api_id = '' # Google API自定义搜索引擎id
# https://developers.google.com/custom-search/v1/overview#api_key
google_api_key = '' # Google API自定义搜索key
# google_api_addr默认空使用https://www.googleapis.com/customsearch/v1
google_api_addr = ''

# https://api.passivetotal.org/api/docs/
riskiq_api_username = ''
Expand Down
2 changes: 1 addition & 1 deletion
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def __init__(self, domain):
self.domain = domain
self.module = 'Search'
self.source = 'BingAPISearch'
self.addr = 'https://api.bing.microsoft.com/v7.0/search'
self.addr = settings.bing_api_addr or 'https://api.bing.microsoft.com/v7.0/search'
self.id = settings.bing_api_id
self.key = settings.bing_api_key
self.limit_num = 1000 # 必应同一个搜索关键词限制搜索条数
Expand Down
2 changes: 1 addition & 1 deletion modules/search/google_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def __init__(self, domain):
self.domain = domain
self.module = 'Search'
self.source = 'GoogleAPISearch'
self.addr = 'https://www.googleapis.com/customsearch/v1'
self.addr = settings.google_api_addr or 'https://www.googleapis.com/customsearch/v1'
self.delay = 1
self.key = settings.google_api_key
self.id = settings.google_api_id
Expand Down
0