zhangyong 10 ماه پیش
والد
کامیت
342fab2921
1فایلهای تغییر یافته به همراه20 افزوده شده و 20 حذف شده
  1. 20 20
      video_agc/agc_video.py

+ 20 - 20
video_agc/agc_video.py

@@ -375,29 +375,29 @@ class AGC():
             try:
                 d_list = list_data[count]
                 uid = d_list['uid']  # 音频id
-                srt = str(d_list['text'])  # srt
+                srt = d_list['text']  # srt
                 cover = d_list['cover']
                 audio_title = d_list['title']
-                if srt and len(srt.strip()) >= 3:
-                    # 创建临时字幕文件
-                    cls.create_subtitle_file(srt, s_path)
-                    Common.logger("bk_video").info(f"S{mark} 文件目录创建成功")
-                else:
-                    srt_new = SRT.getSrt(int(uid))
-                    Common.logger("video").info(f"S{mark}的{platform}渠道音频ID")
+                # if srt and len(srt.strip()) >= 3:
+                #     # 创建临时字幕文件
+                #     cls.create_subtitle_file(srt, s_path)
+                #     Common.logger("bk_video").info(f"S{mark} 文件目录创建成功")
+                # else:
+                srt_new = SRT.getSrt(int(uid))
+                Common.logger("video").info(f"S{mark}的{platform}渠道音频ID")
 
-                    if srt_new:
-                        current_time = datetime.now()
-                        formatted_time = current_time.strftime("%Y-%m-%d %H:%M:%S")
-                        values = [[mark, str(uid), srt_new, formatted_time]]
-                        random_wait_time = random.uniform(0.5, 2.5)
-                        time.sleep(random_wait_time)
-                        Feishu.insert_columns("IbVVsKCpbhxhSJtwYOUc8S1jnWb", "jd9qD9", "ROWS", 1, 2)
-                        time.sleep(random_wait_time)
-                        Feishu.update_values("IbVVsKCpbhxhSJtwYOUc8S1jnWb", "jd9qD9", "A2:Z2", values)
-                        # 创建临时字幕文件
-                        cls.create_subtitle_file(srt_new, s_path)
-                        Common.logger("video").info(f"S{mark}的{platform}渠道SRT 文件目录创建成功")
+                if srt_new:
+                    current_time = datetime.now()
+                    formatted_time = current_time.strftime("%Y-%m-%d %H:%M:%S")
+                    values = [[mark, str(uid), srt_new, formatted_time]]
+                    random_wait_time = random.uniform(0.5, 2.5)
+                    time.sleep(random_wait_time)
+                    Feishu.insert_columns("IbVVsKCpbhxhSJtwYOUc8S1jnWb", "jd9qD9", "ROWS", 1, 2)
+                    time.sleep(random_wait_time)
+                    Feishu.update_values("IbVVsKCpbhxhSJtwYOUc8S1jnWb", "jd9qD9", "A2:Z2", values)
+                    # 创建临时字幕文件
+                    cls.create_subtitle_file(srt_new, s_path)
+                    Common.logger("video").info(f"S{mark}的{platform}渠道SRT 文件目录创建成功")
                 # 获取音频
                 audio_video = PQ.get_audio_url(uid)
                 Common.logger("video").info(f"{mark}的{platform}渠道获音频成功")