将api加入到插拔式配置

This commit is contained in:
Jing Ling
2020-08-14 13:00:39 +08:00
parent 091167acb2
commit e16b7dada0
23 changed files with 135 additions and 57 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
import time
from config import api
from config import settings
from common.search import Search
@@ -11,8 +11,8 @@ class GoogleAPI(Search):
self.source = 'GoogleAPISearch'
self.addr = 'https://www.googleapis.com/customsearch/v1'
self.delay = 1
self.key = api.google_api_key
self.id = api.google_api_id
self.key = settings.google_api_key
self.id = settings.google_api_id
self.per_page_num = 10 # 每次只能请求10个结果
def search(self, domain, filtered_subdomain=''):