zhangyong hace 5 meses
padre
commit
68bd5c4025
Se han modificado 3 ficheros con 16 adiciones y 2 borrados
  1. 11 0
      common/sql_help.py
  2. 1 1
      job_ks_feed.py
  3. 4 1
      video_rewriting/video_processor.py

+ 11 - 0
common/sql_help.py

@@ -195,6 +195,17 @@ class sqlCollect():
         data = AigcMysqlHelper.get_values(sql, (channel,))
         return data
 
+    @classmethod
+    def update_feed_vid(cls, vid):
+        """
+        视频号单点修改状态为1
+        """
+        sql = f"""UPDATE automator_feed_video set has_used = 1 where video_id = '{vid}'"""
+        res = AigcMysqlHelper.update_values(
+            sql=sql
+        )
+        return res
+
     @classmethod
     def update_shp_dd_vid(cls, vid):
         """

+ 1 - 1
job_ks_feed.py

@@ -5,7 +5,7 @@ from common import Material
 from video_rewriting.video_processor import VideoProcessor
 def video_task_start():
     """处理视频任务,返回用户名并根据结果决定延迟时间"""
-    data = Material.feishu_list()[17]
+    data = Material.feishu_list()[18]
     while True:
         try:
             print("开始执行任务")

+ 4 - 1
video_rewriting/video_processor.py

@@ -259,7 +259,10 @@ class VideoProcessor:
                                     f"**原视频标题**: {video['old_title']}\n"
                                 )
                                 Feishu.finish_bot(text, "https://open.feishu.cn/open-apis/bot/v2/hook/d2f751a8-5b0a-49ca-a306-1fda142707a9", "【 有一条新的内容改造成功 】")
-
+                        if name == "快手推荐流" or name == "视频号推荐流":
+                            feed_status = sqlCollect.update_feed_vid(v_id)
+                            if feed_status == 1:
+                                Common.logger(mark).info(f"{name}的{task_mark}下的ID{url} 视频修改已使用,状态已修改")
                         if channel_id == "快手历史" or channel_id == "抖音历史" or channel_id == "视频号历史":
                             explain = "历史爆款"
                         else: