sph_sy_main.py 518 B

12345678910111213141516171819202122
  1. import schedule
  2. import time
  3. from xssy_channel.sph_jr_nrxs import SphNrxs
  4. def video_start_sph():
  5. print("视频号任务开始...")
  6. try:
  7. SphNrxs.sph_nrxs_data()
  8. print("视频号任务成功完成")
  9. except Exception as e:
  10. print(f"视频号任务执行过程中发生错误: {e}")
  11. print("视频号任务结束")
  12. # 每天早上 10:30 执行
  13. schedule.every().day.at("10:30").do(video_start_sph)
  14. # SphNrxs.sph_nrxs_data()
  15. while True:
  16. schedule.run_pending()
  17. time.sleep(1)