run_ks_author_dev.py 2.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # -*- coding: utf-8 -*-
  2. # @Author: wangkun
  3. # @Time: 2023/6/9
  4. import os
  5. import sys
  6. sys.path.append(os.getcwd())
  7. from common.common import Common
  8. from kuaishou.kuaishou_author.kuaishou_author_scheduling_new import KuaishouauthorScheduling
  9. def kuaishou_recommend_main(log_type, crawler, env):
  10. Common.logger(log_type, crawler).info("开始抓取:快手账号\n")
  11. # Common.logging(log_type, crawler, env, "开始抓取:快手账号\n")
  12. KuaishouauthorScheduling.get_author_videos(log_type=log_type,
  13. crawler=crawler,
  14. rule_dict={"videos_cnt": {"min": 5, "max": 0},
  15. "like_cnt": {"min": 100, "max": 0},
  16. "duration": {"min": 30, "max": 0},
  17. "period": {"min": 365, "max": 365}},
  18. user_list=[{"uid": 6267140, "source": "kuaishou", "link": "V3_https://www.kuaishou.com/profile/3x5is4uxbwyvc7m",
  19. "nick_name": "买两个橘子",
  20. "avatar_url": "http://rescdn.yishihui.com/user/default/avatar/live/1616555578819_u=1922778943,2660693611&fm=26&gp=0.jpg",
  21. "mode": "author"},
  22. {"uid": 6267141, "source": "kuaishou", "link": "3x3afdt7epzegau",
  23. "nick_name": "西二旗刘德华",
  24. "avatar_url": "http://rescdn.yishihui.com/user/default/avatar/live/1616555578819_u=1922778943,2660693611&fm=26&gp=0.jpg",
  25. "mode": "author"}],
  26. env=env)
  27. Common.del_logs(log_type, crawler)
  28. Common.logger(log_type, crawler).info("抓取一轮结束\n")
  29. # Common.logging(log_type, crawler, env, "抓取一轮结束\n")
  30. if __name__ == "__main__":
  31. kuaishou_recommend_main("author", "kuaishou", "prod")