zhangyong 10 ay önce
ebeveyn
işleme
9b1ce5b709
2 değiştirilmiş dosya ile 53 ekleme ve 53 silme
  1. 52 52
      video_job.py
  2. 1 1
      video_rewriting/video_prep.py

+ 52 - 52
video_job.py

@@ -33,57 +33,57 @@ def video_task_start(data):
         today.append(mark)
         Common.logger("log").info(f"返回用户名{mark}")
 
-data = Material.feishu_list()
-video_task_start(data[0])
-
-
-# def controlled_io_operation(data):
-#     with lock:
-#         start_time = time.time()
-#         time.sleep(SLEEP_INTERVAL)
-#         end_time = time.time()
-#         elapsed_time = end_time - start_time
-#         if elapsed_time < SLEEP_INTERVAL:
-#             time.sleep(SLEEP_INTERVAL - elapsed_time)
-#     video_task_start(data)
-#
-#
-#
-#
-# def video_start():
-#     print("开始执行生成视频脚本.")
-#
-#     data = Material.feishu_list()
-#     with concurrent.futures.ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
-#         futures = {executor.submit(controlled_io_operation, user_data): user_data for user_data in data}
-#         for future in concurrent.futures.as_completed(futures):
-#             try:
-#                 future.result()
-#                 print("处理结果: 成功")
-#             except concurrent.futures.TimeoutError:
-#                 print("任务超时,已取消.")
-#             except Exception as e:
-#                 print("处理任务时出现异常:", e)
-#     print("执行生成视频脚本结束.")
-#
-# def usernames_today():
-#     today.clear()
-#     print("today 已清空")
-#
-#
-# video_start()
-#
-#
-# # 定时任务设置
-# schedule.every().day.at("01:00").do(usernames_today)
-#
-#
-# schedule.every(12).hours.do(video_start)
-#
-#
-#
-# while True:
-#     schedule.run_pending()
-#     time.sleep(1)
+# data = Material.feishu_list()
+# video_task_start(data[0])
+
+
+def controlled_io_operation(data):
+    with lock:
+        start_time = time.time()
+        time.sleep(SLEEP_INTERVAL)
+        end_time = time.time()
+        elapsed_time = end_time - start_time
+        if elapsed_time < SLEEP_INTERVAL:
+            time.sleep(SLEEP_INTERVAL - elapsed_time)
+    video_task_start(data)
+
+
+
+
+def video_start():
+    print("开始执行生成视频脚本.")
+
+    data = Material.feishu_list()
+    with concurrent.futures.ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
+        futures = {executor.submit(controlled_io_operation, user_data): user_data for user_data in data}
+        for future in concurrent.futures.as_completed(futures):
+            try:
+                future.result()
+                print("处理结果: 成功")
+            except concurrent.futures.TimeoutError:
+                print("任务超时,已取消.")
+            except Exception as e:
+                print("处理任务时出现异常:", e)
+    print("执行生成视频脚本结束.")
+
+def usernames_today():
+    today.clear()
+    print("today 已清空")
+
+
+video_start()
+
+
+# 定时任务设置
+schedule.every().day.at("01:00").do(usernames_today)
+
+
+schedule.every(12).hours.do(video_start)
+
+
+
+while True:
+    schedule.run_pending()
+    time.sleep(1)
 
 

+ 1 - 1
video_rewriting/video_prep.py

@@ -199,7 +199,7 @@ class getVideo:
                                 # 使用锁保护表格插入操作
                                 with lock:
                                     if name == "王雪珂":
-                                        sheet = "a74fc4"
+                                        sheet = "vfhHwj"
                                     elif name == "王雪珂-1":
                                         sheet = "61kvW7"
                                     elif name == "鲁涛":