main.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import os
  2. import sys
  3. # import threading
  4. # import schedule
  5. # import time
  6. sys.path.append(os.getcwd())
  7. # from common.db import MysqlHelper
  8. # from video_capture.douyin.douyin_author.douyin_author import douyinAuthor
  9. from video_stitching.video_stitching import VideoStitching
  10. # from datetime import datetime, timedelta
  11. VideoStitching.video_stitching()
  12. #
  13. # def get_count():
  14. # current_time = datetime.now()
  15. # previous_time = current_time - timedelta(minutes=10)
  16. # previous_time_str = previous_time.strftime("%Y-%m-%d %H:%M")
  17. # select_user_sql = f"""select video_id from video_url where time >="{previous_time_str}";"""
  18. # count = MysqlHelper.get_values(select_user_sql, "prod")
  19. # if count:
  20. # return True
  21. # else:
  22. # return False
  23. #
  24. # def check_token():
  25. # while True:
  26. # count = get_count()
  27. # if count:
  28. # time.sleep(1200) # 每20分钟检查一次
  29. # else:
  30. # douyinAuthor.get_token()
  31. #
  32. # # 创建并启动线程
  33. # token_thread = threading.Thread(target=check_token)
  34. # token_thread.start()
  35. #
  36. # # 每天下午4点定时启动 video_stitching 方法
  37. # schedule.every().day.at("16:00").do(VideoStitching.video_stitching())
  38. #
  39. # while True:
  40. # schedule.run_pending()
  41. # time.sleep(1)