xng_zh_job.py 497 B

123456789101112131415161718192021222324
  1. import schedule
  2. import time
  3. from spider.crawler_offline.xng_zhanghao import XNGZH
  4. def bot_xng_count_recommend():
  5. try:
  6. xng = XNGZH()
  7. xng.get_video_info_2()
  8. except Exception as e:
  9. print(f"异常了{e}")
  10. def schedule_tasks():
  11. schedule.every().day.at("00:50").do(bot_xng_count_recommend)
  12. if __name__ == '__main__':
  13. schedule_tasks() # 调用任务调度函数
  14. while True:
  15. schedule.run_pending()
  16. time.sleep(1) # 每秒钟检查一次