فهرست منبع

增加日志调试

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

+ 5 - 0
video_agc/agc_video.py

@@ -143,6 +143,8 @@ class AGC():
             total_video_duration = sum(cls.get_video_duration(video_file) for video_file in videos)
         else:
             total_video_duration = sum(cls.get_video_duration(video_file[3]) for video_file in videos)
+        Common.logger("video").info(f"{mark}的{platform}渠道总时长{total_video_duration}")
+
         if platform == "爆款" or platform == "跟随":
             # 视频时长大于音频时长
             if total_video_duration > audio_duration:
@@ -424,6 +426,7 @@ class AGC():
                             videos = [str(videos)]
                     video_id = random.choice(videos)
                     video_url = PQ.get_audio_url(video_id)
+                    Common.logger("video").info(f"{mark}的{platform}渠道获取视频链接成功")
                     download_video = Oss.download_url(video_url, video_path_url, str(video_id))
                     if download_video:
                         video_files = cls.zn_concatenate_videos(download_video, audio_duration, audio_video, platform,
@@ -442,8 +445,10 @@ class AGC():
                     url_list, user = sqlHelp.get_url_list(user_id, mark, "50")
                     videos = [list(item) for item in url_list]
                     videos = Oss.get_oss_url(videos, video_path_url)
+                    Common.logger("video").info(f"{mark}的{platform}渠道获取视频链接成功")
                     video_files = cls.zw_concatenate_videos(videos, audio_duration, audio_video, platform, s_path, v_path,
                                                          mark, v_oss_path)
+
                     if video_files == "":
                         pj_count += 1
                         Common.logger("video").info(f"{mark}的{platform}渠道使用拼接视频为空")