mirror of
https://github.com/NanmiCoder/MediaCrawler.git
synced 2026-04-20 18:57:44 +08:00
feat: 增加配置项支持自由选择数据是否保存到关系型数据库中
This commit is contained in:
6
main.py
6
main.py
@@ -2,8 +2,8 @@ import sys
|
||||
import asyncio
|
||||
import argparse
|
||||
|
||||
import db
|
||||
import config
|
||||
from tools import utils
|
||||
from base import proxy_account_pool
|
||||
from media_platform.douyin import DouYinCrawler
|
||||
from media_platform.xhs import XiaoHongShuCrawler
|
||||
@@ -29,6 +29,10 @@ async def main():
|
||||
# init account pool
|
||||
account_pool = proxy_account_pool.create_account_pool()
|
||||
|
||||
# init db
|
||||
if config.IS_SAVED_DATABASED:
|
||||
await db.init_db()
|
||||
|
||||
args = parser.parse_args()
|
||||
crawler = CrawlerFactory().create_crawler(platform=args.platform)
|
||||
crawler.init_config(
|
||||
|
||||
Reference in New Issue
Block a user