# -*- coding: utf-8 -*-
# @Author: wangkun
# @Time: 2023/6/12
import os
import sys
sys.path.append(os.getcwd())
from common.common import Common
from xigua.xigua_recommend.xg_recommend import XiguaRecommend


def xigua_recommend_main(log_type, crawler, env):
    Common.logger(log_type, crawler).info(f'开始抓取:西瓜推荐\n')
    Common.logging(log_type, crawler, env, "开始抓取:西瓜推荐\n")
    XiguaRecommend.get_videoList(log_type=log_type,
                                 crawler=crawler,
                                 rule_dict={"play_cnt": {"min": 10000, "max": 0},
                                            "duration": {"min": 60, "max": 1800},
                                            "period": {"min": 90, "max": 90}},
                                 our_uid=6267140,
                                 env=env)
    Common.logger(log_type, crawler).info("抓取一轮结束\n")
    Common.logging(log_type, crawler, env, "抓取一轮结束\n")


if __name__ == "__main__":
    xigua_recommend_main("recommend", "xigua", "dev")
