|
|
@ -2,7 +2,7 @@ |
|
|
|
* 爬虫主程序 |
|
|
|
* 爬虫主程序 |
|
|
|
* 负责监听任务目录里的新任务,并自动抓取数据保存到数据目录。 |
|
|
|
* 负责监听任务目录里的新任务,并自动抓取数据保存到数据目录。 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
import configs from './config.mjs'; |
|
|
|
import getConfigs from './config.mjs'; |
|
|
|
import common from './lib/common.mjs'; |
|
|
|
import common from './lib/common.mjs'; |
|
|
|
import TaskMoniter from "./lib/taskMoniter.mjs"; |
|
|
|
import TaskMoniter from "./lib/taskMoniter.mjs"; |
|
|
|
import TaJian from "./lib/tajian.mjs"; |
|
|
|
import TaJian from "./lib/tajian.mjs"; |
|
|
@ -16,6 +16,8 @@ import Bilibili from './bot/Bilibili.mjs'; |
|
|
|
import cron from 'node-cron'; |
|
|
|
import cron from 'node-cron'; |
|
|
|
|
|
|
|
|
|
|
|
(async () => { |
|
|
|
(async () => { |
|
|
|
|
|
|
|
//设置configs为全局变量
|
|
|
|
|
|
|
|
global.configs = await getConfigs(); |
|
|
|
|
|
|
|
|
|
|
|
const taskMoniter = new TaskMoniter(configs.task_list_dir); |
|
|
|
const taskMoniter = new TaskMoniter(configs.task_list_dir); |
|
|
|
const tajian = new TaJian(configs.data_save_dir); |
|
|
|
const tajian = new TaJian(configs.data_save_dir); |
|
|
|