Bladeren bron

代码调整

zhangyong 1 jaar geleden
bovenliggende
commit
5ef434ae61
1 gewijzigde bestanden met toevoegingen van 8 en 9 verwijderingen
  1. 8 9
      video_stitching/video_stitching.py

+ 8 - 9
video_stitching/video_stitching.py

@@ -329,6 +329,14 @@ class VideoStitching():
         cookie = Material.get_houtai_cookie()
         cookie = Material.get_houtai_cookie()
         # 获取音频类型+字幕
         # 获取音频类型+字幕
         audio_id, srt, title_list = Material.get_audio_type(video_type, count, channel_type)
         audio_id, srt, title_list = Material.get_audio_type(video_type, count, channel_type)
+        # 获取音频url
+        if audio_id == None:
+            return
+        audio = cls.get_audio_url(audio_id, cookie)
+        if audio == "":
+            Common.logger().info(f"获取音频地址为空")
+            return
+        Common.logger().info(f"获取音频地址:{audio},获取用户id:{audio_id}")
         if video_type == "口播--美文类":
         if video_type == "口播--美文类":
             # 获取已入库的口播视频
             # 获取已入库的口播视频
             audio_list = cls.get_audio_list()
             audio_list = cls.get_audio_list()
@@ -348,15 +356,6 @@ class VideoStitching():
             # 获取 未使用的视频链接
             # 获取 未使用的视频链接
             url_list = cls.get_url_list(audio_id, account)
             url_list = cls.get_url_list(audio_id, account)
             videos = [list(item) for item in url_list]
             videos = [list(item) for item in url_list]
-        # 获取音频url
-        if audio_id == None:
-            return
-        audio = cls.get_audio_url(audio_id, cookie)
-        if audio == "":
-            Common.logger().info(f"获取音频地址为空")
-            return
-        Common.logger().info(f"获取音频地址:{audio},获取用户id:{audio_id}")
-
         # videos = Oss.get_oss_url(videos)
         # videos = Oss.get_oss_url(videos)
         # 视频截取
         # 视频截取
         try:
         try: