Kaynağa Gözat

相似溯源抖音

zhangyong 9 ay önce
ebeveyn
işleme
1b719ea254
8 değiştirilmiş dosya ile 170 ekleme ve 159 silme
  1. 0 0
      common/redis.py
  2. 36 0
      dk_sy_main.py
  3. 0 0
      job_czz_ks.py
  4. 0 69
      job_dypl.py
  5. 69 0
      job_pl_dy.py
  6. 65 0
      job_pl_dy_1.py
  7. 0 65
      job_wxk1.py
  8. 0 25
      ks_qpl_main.py

+ 0 - 0
common/redis.py


+ 36 - 0
dk_sy_main.py

@@ -0,0 +1,36 @@
+import schedule
+import time
+
+from data_channel.cljx_nrxs import CLJX
+# from data_channel.qpl_ks import QplKs
+from data_channel.dy_nrxs import DYNrxs
+
+
+def video_start_ks():
+    print("快手任务开始...")
+
+    try:
+        CLJX.get_nrxs()
+        print("快手任务成功完成")
+    except Exception as e:
+        print(f"快手任务执行过程中发生错误: {e}")
+    print("快手任务结束")
+
+def video_start_dy():
+    print("抖音任务开始...")
+
+    try:
+        DYNrxs.get_dy_nrxs()
+        print("抖音任务成功完成")
+    except Exception as e:
+        print(f"抖音任务执行过程中发生错误: {e}")
+
+    print("抖音任务结束")
+
+# 每天早上 6 点执行
+schedule.every().day.at("06:00").do(video_start_ks)
+schedule.every().day.at("06:00").do(video_start_dy)
+
+while True:
+    schedule.run_pending()
+    time.sleep(1)

+ 0 - 0
job_ksczz.py → job_czz_ks.py


+ 0 - 69
job_dypl.py

@@ -1,69 +0,0 @@
-import os
-import concurrent.futures
-import schedule
-import time
-import threading
-from common import Material
-from video_rewriting.video_processor import VideoProcessor
-
-MAX_BPS = 120 * 1024 * 1024  # 120MB/s
-MAX_WORKERS = os.cpu_count() * 2  # 线程池最大工作线程数量
-READ_WRITE_CHUNK_SIZE = 1024 * 1024  # 每次读写的块大小 (1MB)
-SLEEP_INTERVAL = READ_WRITE_CHUNK_SIZE / MAX_BPS  # 控制每次读写的延迟时间
-# 全局锁,用于同步读写操作
-lock = threading.Lock()
-
-
-def video_task_start(data):
-    mark = VideoProcessor.main(data)
-    print(f"返回用户名{mark}")
-
-
-# data = Material.feishu_list()
-# video_task_start(data[9])
-
-
-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()
-    data = data[10]
-    with concurrent.futures.ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
-        futures = {executor.submit(controlled_io_operation, 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("执行生成视频脚本结束.")
-
-video_start()
-
-
-schedule.every(6).hours.do(video_start)
-# schedule.every(20).minutes.do(video_start)
-
-
-
-
-while True:
-    schedule.run_pending()
-    time.sleep(1)
-
-

+ 69 - 0
job_pl_dy.py

@@ -0,0 +1,69 @@
+import os
+import concurrent.futures
+import schedule
+import time
+import threading
+from common import Material
+from video_rewriting.video_processor import VideoProcessor
+
+MAX_BPS = 120 * 1024 * 1024  # 120MB/s
+MAX_WORKERS = os.cpu_count() * 2  # 线程池最大工作线程数量
+READ_WRITE_CHUNK_SIZE = 1024 * 1024  # 每次读写的块大小 (1MB)
+SLEEP_INTERVAL = READ_WRITE_CHUNK_SIZE / MAX_BPS  # 控制每次读写的延迟时间
+# 全局锁,用于同步读写操作
+lock = threading.Lock()
+
+
+def video_task_start(data):
+    mark = VideoProcessor.main(data)
+    print(f"返回用户名{mark}")
+
+
+data = Material.feishu_list()
+video_task_start(data[10])
+
+
+# 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()
+#     data = data[10]
+#     with concurrent.futures.ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
+#         futures = {executor.submit(controlled_io_operation, 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("执行生成视频脚本结束.")
+#
+# video_start()
+#
+#
+# schedule.every(6).hours.do(video_start)
+# # schedule.every(20).minutes.do(video_start)
+#
+#
+#
+#
+# while True:
+#     schedule.run_pending()
+#     time.sleep(1)
+
+

+ 65 - 0
job_pl_dy_1.py

@@ -0,0 +1,65 @@
+import os
+import concurrent.futures
+
+import schedule
+import time
+import threading
+from common import Material
+from video_rewriting.video_processor import VideoProcessor
+
+MAX_BPS = 120 * 1024 * 1024  # 120MB/s
+MAX_WORKERS = os.cpu_count() * 2  # 线程池最大工作线程数量
+READ_WRITE_CHUNK_SIZE = 1024 * 1024  # 每次读写的块大小 (1MB)
+SLEEP_INTERVAL = READ_WRITE_CHUNK_SIZE / MAX_BPS  # 控制每次读写的延迟时间
+# 全局锁,用于同步读写操作
+lock = threading.Lock()
+
+
+
+def video_task_start(data):
+    mark = VideoProcessor.main(data)
+    print(f"返回用户名{mark}")
+
+
+data = Material.feishu_list()
+video_task_start(data[5])
+
+
+# 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()
+#     data = data[5]
+#     with concurrent.futures.ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
+#         futures = {executor.submit(controlled_io_operation, 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("执行生成视频脚本结束.")
+#
+#
+# video_start()
+# schedule.every(6).hours.do(video_start)
+# while True:
+#     schedule.run_pending()
+#     time.sleep(1)
+
+

+ 0 - 65
job_wxk1.py

@@ -1,65 +0,0 @@
-import os
-import concurrent.futures
-
-import schedule
-import time
-import threading
-from common import Material
-from video_rewriting.video_processor import VideoProcessor
-
-MAX_BPS = 120 * 1024 * 1024  # 120MB/s
-MAX_WORKERS = os.cpu_count() * 2  # 线程池最大工作线程数量
-READ_WRITE_CHUNK_SIZE = 1024 * 1024  # 每次读写的块大小 (1MB)
-SLEEP_INTERVAL = READ_WRITE_CHUNK_SIZE / MAX_BPS  # 控制每次读写的延迟时间
-# 全局锁,用于同步读写操作
-lock = threading.Lock()
-
-
-
-def video_task_start(data):
-    mark = VideoProcessor.main(data)
-    print(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()
-    data = data[5]
-    with concurrent.futures.ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
-        futures = {executor.submit(controlled_io_operation, 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("执行生成视频脚本结束.")
-
-
-video_start()
-schedule.every(6).hours.do(video_start)
-while True:
-    schedule.run_pending()
-    time.sleep(1)
-
-

+ 0 - 25
ks_qpl_main.py

@@ -1,25 +0,0 @@
-import schedule
-import time
-
-from data_channel.cljx_nrxs import CLJX
-# from data_channel.qpl_ks import QplKs
-
-
-def video_start():
-    print("任务开始...")
-
-    try:
-        CLJX.get_nrxs()
-        print("任务成功完成")
-    except Exception as e:
-        print(f"任务执行过程中发生错误: {e}")
-
-    print("任务结束")
-
-
-# 每天早上 6 点执行
-schedule.every().day.at("06:00").do(video_start)
-
-while True:
-    schedule.run_pending()
-    time.sleep(1)