# -*- coding: utf-8 -*- # @Author: wangkun # @Time: 2022/7/11 import datetime import os import random import sys import time sys.path.append(os.getcwd()) from main.common import Common from main.follow_list import Follow class Main: @classmethod def main(cls, env): while True: if datetime.datetime.now().hour >= 1: # Common.logger("follow").info("同步关注人列表\n") # Follow.del_follow_user_from_feishu('follow') # Follow.get_follow_users_to_feishu('follow') Common.logger("follow").info("获取关注人列表\n") Follow.get_follow_users('follow') Common.logger("follow").info("开始抓取个人主页视频\n") Follow.get_videos_from_follow("follow", env) # 清除日志 Common.del_logs("follow") Common.logger("follow").info("休眠{}小时\n", 24-datetime.datetime.now().hour) Follow.follow_pcursor = "" Follow.person_pcursor = "" Follow.send_time = 0 time.sleep(60*(24-datetime.datetime.now().hour)) else: pass if __name__ == "__main__": Main.main('prod')