# -*- coding: utf-8 -*-
# @Author: wangkun
# @Time: 2023/6/9
import os
import sys
sys.path.append(os.getcwd())
from common.common import Common
from kuaishou.kuaishou_author.kuaishou_author_scheduling_new import KuaishouauthorScheduling


def kuaishou_recommend_main(log_type, crawler, env):
    Common.logger(log_type, crawler).info("开始抓取:快手账号\n")
    Common.logging(log_type, crawler, env, "开始抓取:快手账号\n")
    KuaishouauthorScheduling.get_author_videos(log_type=log_type,
                                               crawler=crawler,
                                               rule_dict={"videos_cnt": {"min": 5, "max": 0},
                                                          "like_cnt": {"min": 100, "max": 0},
                                                          "duration": {"min": 30, "max": 0},
                                                          "period": {"min": 365, "max": 365}},
                                               user_list=[{"uid": 6267140, "source": "kuaishou", "link": "3xratgemedr8ctq",
                                                           "nick_name": "买两个橘子",
                                                           "avatar_url": "http://rescdn.yishihui.com/user/default/avatar/live/1616555578819_u=1922778943,2660693611&fm=26&gp=0.jpg",
                                                           "mode": "author"},
                                                          {"uid": 6267141, "source": "kuaishou", "link": "3x3afdt7epzegau",
                                                           "nick_name": "西二旗刘德华",
                                                           "avatar_url": "http://rescdn.yishihui.com/user/default/avatar/live/1616555578819_u=1922778943,2660693611&fm=26&gp=0.jpg",
                                                           "mode": "author"}],
                                               env=env)
    Common.del_logs(log_type, crawler)
    Common.logger(log_type, crawler).info("抓取一轮结束\n")
    Common.logging(log_type, crawler, env, "抓取一轮结束\n")


if __name__ == "__main__":
    kuaishou_recommend_main("author", "kuaishou", "prod")
