|
@@ -1,3 +1,4 @@
|
|
|
+import sys
|
|
|
from pathlib import Path
|
|
|
|
|
|
import yaml
|
|
@@ -6,7 +7,7 @@ __all__ = [
|
|
|
'mongo_conf', 'redis_conf', 'oss_conf', 'es_conf',
|
|
|
'constants',
|
|
|
'headers', 'jy_proxy', 'node_module', 'crawler_url',
|
|
|
- 'region'
|
|
|
+ 'region', 'analyze_url', 'node_module_path'
|
|
|
]
|
|
|
|
|
|
base_path = Path(__file__).parent
|
|
@@ -27,7 +28,14 @@ with open(yaml_constants, encoding="utf-8") as fp:
|
|
|
jy_proxy: dict = constants['proxy']
|
|
|
node_module: dict = constants['node_module']
|
|
|
crawler_url: dict = constants['crawler_url']
|
|
|
+ analyze_url = f'http://{es_conf["host"]}:{es_conf["port"]}/{es_conf["db"]}/_analyze'
|
|
|
|
|
|
with open(yaml_areas, encoding="utf-8") as fr:
|
|
|
areas = yaml.safe_load(fr)
|
|
|
region: dict = areas['area']
|
|
|
+
|
|
|
+
|
|
|
+if sys.platform == 'linux':
|
|
|
+ node_module_path = node_module['linux']
|
|
|
+else:
|
|
|
+ node_module_path = node_module['windows']
|