main.py 893 B

1234567891011121314151617181920212223242526272829303132
  1. import os
  2. import sys
  3. import datetime
  4. sys.path.append(os.getcwd())
  5. from datetime import datetime
  6. from common import MysqlHelper
  7. from video_stitching.video_stitching import VideoStitching
  8. def get_account_id():
  9. current_time = datetime.now()
  10. formatted_time = current_time.strftime("%Y-%m-%d")
  11. count = f"""SELECT COUNT(*) AS total_count
  12. FROM (
  13. SELECT audio, account_id
  14. FROM video_audio
  15. WHERE time = "{formatted_time}"
  16. GROUP BY audio, account_id
  17. ) AS subquery;"""
  18. count = MysqlHelper.get_values(count, "prod")
  19. return count
  20. if __name__ == '__main__':
  21. count = get_account_id()
  22. count = str(count).replace('(', '').replace(')', '').replace(',', '')
  23. if int(count) < 20:
  24. VideoStitching.video_stitching()