# -*- coding: utf-8 -*-
# @Author: wangkun
# @Time: 2023/4/17
import argparse
import os
import sys
sys.path.append(os.getcwd())
from common.common import Common
from zhongmiaoyinxin.zhongmiaoyinxin_recommend.zhongmiaoyinxin_recommend import ZhongmiaoyinxinRecommend


def main(log_type, crawler, env):
    Common.logger(log_type, crawler).info('开始抓取:众妙音信小程序\n')
    ZhongmiaoyinxinRecommend.start_wechat(log_type, crawler, env)
    Common.del_logs(log_type, crawler)
    Common.logger(log_type, crawler).info('抓取完一轮\n')


if __name__ == "__main__":
    parser = argparse.ArgumentParser()  ## 新建参数解释器对象
    parser.add_argument('--log_type', type=str)  ## 添加参数,注明参数类型
    parser.add_argument('--crawler')  ## 添加参数
    parser.add_argument('--env')  ## 添加参数
    args = parser.parse_args()  ### 参数赋值，也可以通过终端赋值
    main(log_type=args.log_type, crawler=args.crawler, env=args.env)