zhangyong 7 months ago
parent
commit
d026b85e9f
1 changed files with 17 additions and 16 deletions
  1. 17 16
      video_rewriting/video_processor.py

+ 17 - 16
video_rewriting/video_processor.py

@@ -15,6 +15,7 @@ from common.gpt4o_help import GPT4o
 from data_channel.douyin import DY
 from data_channel.dy_keyword import DyKeyword
 from data_channel.dy_ls import DYLS
+from data_channel.ks_keyword import KsKeyword
 from data_channel.ks_ls import KSLS
 from data_channel.kuaishou import KS
 from data_channel.kuaishouchuangzuozhe import KsFeedVideo
@@ -211,20 +212,7 @@ class VideoProcessor:
                                 f"**原视频标题**: {video['old_title']}\n"
                             )
                             Feishu.finish_bot(text, "https://open.feishu.cn/open-apis/bot/v2/hook/493b3d4c-5fae-4a9d-980b-1dd86636524e", "【 有一条新的内容改造成功 】")
-                    text = (
-                        f"**通知类型**: 视频改造成功\n"
-                        f"**站内视频链接**: {pq_url}\n"
-                        f"**负责人**: {name}\n"
-                        f"**渠道**: {channel_id}\n"
-                        f"**视频主页ID**: {url}\n"
-                        f"**视频Video_id**: {v_id}\n"
-                        f"**使用音频音色**: {voice}\n"
-                    )
 
-
-                    Feishu.finish_bot(text,
-                                      "https://open.feishu.cn/open-apis/bot/v2/hook/e7697dc6-5254-4411-8b59-3cd0742bf703",
-                                      "【 机器改造通知 】")
                     if channel_id == "快手历史" or channel_id == "抖音历史" or channel_id == "视频号历史":
                         explain = "历史爆款"
                     else:
@@ -236,7 +224,6 @@ class VideoProcessor:
                         secondary_category = task["secondary_category"]
                         keyword_principal = task["keyword_name"]
                         log_data = f"user:{url},,video_id:{v_id},,video_url:{video_url},,ai_title:{new_title},,voice:{voice},,first_category:{first_category},,secondary_category:{secondary_category},,keyword_principal:{keyword_principal}"
-                        AliyunLogger.logging(channel_id, name, url, v_id, "视频改造成功", "1000", log_data, str(code))
                         values = [
                             [
                                 name,
@@ -261,8 +248,6 @@ class VideoProcessor:
                         ]
                     else:
                         log_data = f"user:{url},,video_id:{v_id},,video_url:{video_url},,ai_title:{new_title},,voice:{voice}"
-                        AliyunLogger.logging(channel_id, name, url, v_id, "视频改造成功", "1000", log_data, str(code))
-
                         values = [
                             [
                                 name,
@@ -281,6 +266,19 @@ class VideoProcessor:
                                 voice
                             ]
                         ]
+                    AliyunLogger.logging(channel_id, name, url, v_id, "视频改造成功", "1000", log_data, str(code))
+                    text = (
+                        f"**通知类型**: 视频改造成功\n"
+                        f"**站内视频链接**: {pq_url}\n"
+                        f"**负责人**: {name}\n"
+                        f"**渠道**: {channel_id}\n"
+                        f"**视频主页ID**: {url}\n"
+                        f"**视频Video_id**: {v_id}\n"
+                        f"**使用音频音色**: {voice}\n"
+                    )
+                    Feishu.finish_bot(text,
+                                      "https://open.feishu.cn/open-apis/bot/v2/hook/e7697dc6-5254-4411-8b59-3cd0742bf703",
+                                      "【 机器改造通知 】")
                     if values:
                         if name == "王雪珂":
                             sheet = "vfhHwj"
@@ -344,6 +342,9 @@ class VideoProcessor:
             return SPHLS.get_sphls_data(task_mark, url, number, mark, channel_id, name)
         elif channel_id == '抖音搜索':
             return DyKeyword.get_key_word(url, task_mark, mark, channel_id, name, task)
+        elif channel_id == '快手搜索':
+            return KsKeyword.get_key_word(url, task_mark, mark, channel_id, name, task)
+
 
     @classmethod
     def generate_title(cls, video, title):