zhangyong 11 månader sedan
förälder
incheckning
8f6cbee90f
1 ändrade filer med 5 tillägg och 2 borttagningar
  1. 5 2
      video_rewriting/video_prep.py

+ 5 - 2
video_rewriting/video_prep.py

@@ -178,8 +178,11 @@ class getVideo:
                                 pw_srt_text = GPT4o.get_ai_pw(new_title)
                                 if pw_srt_text:
                                     pw_url = TTS.get_pw_zm(pw_srt_text)
-                                    pw_url_sec = FFmpeg.get_videos_duration(pw_url)  # 获取片尾秒数
-                                    pw_srt = TTS.get_srt_format(pw_srt_text, pw_url_sec)
+                                    if pw_url:
+                                        pw_url_sec = FFmpeg.get_videos_duration(pw_url)  # 获取片尾秒数
+                                        pw_srt = TTS.get_srt_format(pw_srt_text, pw_url_sec)
+                                    else:
+                                        continue
                                 else:
                                     continue
                             else: