run_xigua_follow.py 711 B

1234567891011121314151617181920212223242526272829303132333435
  1. # -*- coding: utf-8 -*-
  2. # @Author: wangkun
  3. # @Time: 2022/8/25
  4. import os
  5. import sys
  6. import time
  7. sys.path.append(os.getcwd())
  8. from main.common import Common
  9. from main.xigua_follow import Follow
  10. from main.get_signature import GetSignature
  11. class Main:
  12. # 主函数
  13. @classmethod
  14. def main(cls, env):
  15. while True:
  16. # 获取视频列表
  17. Follow.get_all_person_videos('follow', env)
  18. # 清除日志
  19. Common.del_logs('follow')
  20. # 翻页初始化
  21. Follow.offset = 0
  22. # 随机休眠
  23. Common.logger('follow').info('休眠1小时')
  24. time.sleep(3600)
  25. if __name__ == '__main__':
  26. Main.main('prod')