run_xg_search_dev.py 1.3 KB

12345678910111213141516171819202122232425
  1. # -*- coding: utf-8 -*-
  2. # @Author: wangkun
  3. # @Time: 2023/6/13
  4. import os
  5. import sys
  6. sys.path.append(os.getcwd())
  7. from common.common import Common
  8. from xigua.xigua_search.xigua_search_scheduling import XiguasearchScheduling
  9. def xigua_search_main(log_type, crawler, env):
  10. Common.logger(log_type, crawler).info("开始抓取西瓜搜索\n")
  11. Common.logging(log_type, crawler, env, "开始抓取西瓜搜索\n")
  12. XiguasearchScheduling.get_search_videos(log_type=log_type,
  13. crawler=crawler,
  14. rule_dict={"play_cnt":{"min":8000,"max":0},"duration":{"min":60,"max":600},"period":{"min":365,"max":365},"videos_cnt":{"min":30,"max":0}},
  15. user_list=[{"uid": 6267140, "source": "xigua", "link": "退休补贴", "nick_name": "西瓜搜索测试账号", "avatar_url": "http://rescdn.yishihui.com/user/default/avatar/live/1616555578819_u=1922778943,2660693611&fm=26&gp=0.jpg", "mode": "search"}],
  16. env=env)
  17. Common.del_logs(log_type, crawler)
  18. Common.logger(log_type, crawler).info("抓取一轮结束\n")
  19. Common.logging(log_type, crawler, env, "抓取一轮结束\n")
  20. if __name__ == "__main__":
  21. xigua_search_main("search", "xigua", "dev")