run_xg_author_dev.py 2.0 KB

1234567891011121314151617181920212223242526272829303132
  1. # -*- coding: utf-8 -*-
  2. # @Author: wangkun
  3. # @Time: 2023/6/28
  4. import os
  5. import sys
  6. sys.path.append(os.getcwd())
  7. from common.common import Common
  8. from xigua.xigua_author.xigua_author_scheduling import XiguaauthorScheduling
  9. def xigua_author_main(log_type, crawler, env):
  10. Common.logger(log_type, crawler).info("开始抓取:西瓜账号\n")
  11. Common.logging(log_type, crawler, env, "开始抓取:西瓜账号\n")
  12. XiguaauthorScheduling.get_author_videos(log_type=log_type,
  13. crawler=crawler,
  14. rule_dict={"play_cnt":{"min":1000,"max":0},"duration":{"min":60,"max":0},"period":{"min":2,"max":2},"video_width":{"min":720,"max":0},"video_height":{"min":720,"max":0}},
  15. user_list=[{"uid": 6267140, "source": "xigua", "link": "https://www.ixigua.com/home/2273435016499629",
  16. "nick_name": "买两个橘子",
  17. "avatar_url": "http://rescdn.yishihui.com/user/default/avatar/live/1616555578819_u=1922778943,2660693611&fm=26&gp=0.jpg",
  18. "mode": "author"},
  19. {"uid": 6267141, "source": "xigua", "link": "https://www.ixigua.com/home/694546480506782",
  20. "nick_name": "西二旗刘德华",
  21. "avatar_url": "http://rescdn.yishihui.com/user/default/avatar/live/1616555578819_u=1922778943,2660693611&fm=26&gp=0.jpg",
  22. "mode": "author"}],
  23. env=env)
  24. Common.del_logs(log_type, crawler)
  25. Common.logger(log_type, crawler).info("抓取一轮结束\n")
  26. Common.logging(log_type, crawler, env, "抓取一轮结束\n")
  27. if __name__ == "__main__":
  28. xigua_author_main("author", "xigua", "dev")