zhangyong 1 년 전
부모
커밋
8f6cbee90f
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  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: