File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ class ConfigLoader:
2828 api_key = None
2929 app_id = None
3030 custom_settings = None
31+ dns_resolver = None
3132 extra_records = []
3233 index_name = None
3334 index_name_tmp = None
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ def run_config(config):
9595
9696 DEFAULT_REQUEST_HEADERS = headers
9797
98- process = CrawlerProcess ( {
98+ crawler_settings = {
9999 'LOG_ENABLED' : '1' ,
100100 'LOG_LEVEL' : 'ERROR' ,
101101 'USER_AGENT' : config .user_agent ,
@@ -106,7 +106,12 @@ def run_config(config):
106106 'DUPEFILTER_CLASS' : DUPEFILTER_CLASS_PATH ,
107107 'DEFAULT_REQUEST_HEADERS' : DEFAULT_REQUEST_HEADERS ,
108108 'TELNETCONSOLE_ENABLED' : False
109- })
109+ }
110+
111+ if config .dns_resolver is not None :
112+ crawler_settings ['DNS_RESOLVER' ] = config .dns_resolver
113+
114+ process = CrawlerProcess (crawler_settings )
110115
111116 process .crawl (
112117 DocumentationSpider ,
You can’t perform that action at this time.
0 commit comments