zhangyong 6 ay önce
ebeveyn
işleme
42099cfe7c
1 değiştirilmiş dosya ile 13 ekleme ve 12 silme
  1. 13 12
      video_rewriting/video_processor.py

+ 13 - 12
video_rewriting/video_processor.py

@@ -117,6 +117,18 @@ class VideoProcessor:
             new_count if new_count is not None else number,
             mark, feishu_id, cookie_sheet, name, task
         )
+        if not data_list:
+            AliyunLogger.logging(channel_id, name, url, "", "无改造视频", "4000")
+            Common.logger(mark).info(f"{name}的{task_mark}下{channel_id}的视频ID{url} 无改造视频")
+            text = (
+                f"**通知类型**: 没有改造的视频\n"
+                f"**负责人**: {name}\n"
+                f"**渠道**: {channel_id}\n"
+                f"**视频主页ID**: {url}\n"
+            )
+            Feishu.finish_bot(text, "https://open.feishu.cn/open-apis/bot/v2/hook/e7697dc6-5254-4411-8b59-3cd0742bf703",
+                              "【 机器改造通知 】")
+            return
         if new_count:
             sqlCollect.insert_spider_supply_targetcnt(channel_id, name, url, number, new_count, str(len(data_list)))
             current_time = datetime.now()
@@ -136,18 +148,7 @@ class VideoProcessor:
             time.sleep(0.5)
             Feishu.update_values("Z5xLsdyyxh3abntTTvUc9zw8nYd", "099da8", "A2:Z2", values)
 
-        if not data_list:
-            AliyunLogger.logging(channel_id, name, url, "", "无改造视频", "4000")
-            Common.logger(mark).info(f"{name}的{task_mark}下{channel_id}的视频ID{url} 无改造视频")
-            text = (
-                f"**通知类型**: 没有改造的视频\n"
-                f"**负责人**: {name}\n"
-                f"**渠道**: {channel_id}\n"
-                f"**视频主页ID**: {url}\n"
-            )
-            Feishu.finish_bot(text, "https://open.feishu.cn/open-apis/bot/v2/hook/e7697dc6-5254-4411-8b59-3cd0742bf703",
-                              "【 机器改造通知 】")
-            return
+
         Common.logger(mark).info(f"{name}的{task_mark}下的ID{url} 获取视频完成,共{len(data_list)}条")
         for video in data_list:
             try: