zhangyong 10 months ago
parent
commit
5b09550b5c
1 changed files with 3 additions and 3 deletions
  1. 3 3
      video_agc/agc_video.py

+ 3 - 3
video_agc/agc_video.py

@@ -51,7 +51,7 @@ class AGC():
             return ""
         print(f"{mark}的{platform}:开始拼接视频喽~~~")
         Common.logger("video").info(f"{mark}的{platform}:开始拼接视频喽~~~")
-        if os.path.exists(s_path) and os.path.getsize(s_path) != 0:
+        if os.path.exists(s_path):
             # subtitle_cmd = f"subtitles={s_path}:force_style='Fontsize=11,Fontname=Hiragino Sans GB,Outline=0,PrimaryColour=&H000000,SecondaryColour=&H000000'"
             subtitle_cmd = f"subtitles={s_path}:force_style='Fontsize=12,Fontname=wqy-zenhei,Bold=1,Outline=0,PrimaryColour=&H000000,SecondaryColour=&H000000'"
         else:
@@ -200,7 +200,7 @@ class AGC():
             return ""
         print(f"{mark}的{platform}:开始拼接视频喽~~~")
         Common.logger("video").info(f"{mark}的{platform}:开始拼接视频喽~~~")
-        if os.path.exists(s_path) and os.path.getsize(s_path) != 0:
+        if os.path.exists(s_path):
             # subtitle_cmd = f"subtitles={s_path}:force_style='Fontsize=11,Fontname=Hiragino Sans GB,Outline=0,PrimaryColour=&H000000,SecondaryColour=&H000000'"
             subtitle_cmd = f"subtitles={s_path}:force_style='Fontsize=12,Fontname=wqy-zenhei,Bold=1,Outline=0,PrimaryColour=&H000000,SecondaryColour=&H000000'"
         else:
@@ -378,7 +378,7 @@ class AGC():
                 srt = d_list['text']  # srt
                 cover = d_list['cover']
                 audio_title = d_list['title']
-                if srt:
+                if srt and len(srt.strip()) >= 3:
                     # 创建临时字幕文件
                     cls.create_subtitle_file(srt, s_path)
                     Common.logger("bk_video").info(f"S{mark} 文件目录创建成功")