zhangyong hai 7 meses
pai
achega
4a4be31218
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      video_cover_method/cover_method.py

+ 3 - 2
video_cover_method/cover_method.py

@@ -25,7 +25,7 @@ class CoverMethod:
 
 
             return highest_cover_url, highest_cover_sum
             return highest_cover_url, highest_cover_sum
         else:
         else:
-            return None, None
+            return None, 0
 
 
     @staticmethod
     @staticmethod
     def cover_method(video_id):
     def cover_method(video_id):
@@ -55,7 +55,8 @@ class CoverMethod:
             execution_time = end_time - start_time
             execution_time = end_time - start_time
             print(f"代码运行时间: {execution_time:.4f} 秒")
             print(f"代码运行时间: {execution_time:.4f} 秒")
             highest_cover_url, highest_cover_sum = CoverMethod.cover_data_dispose(cover_all_data)  # 获取分数最高的视频封面
             highest_cover_url, highest_cover_sum = CoverMethod.cover_data_dispose(cover_all_data)  # 获取分数最高的视频封面
-            if not highest_cover_url or not highest_cover_sum:
+            print(f"最高分封面{highest_cover_url},分数{highest_cover_sum}")
+            if not highest_cover_url or highest_cover_sum == 0:
                 AliyunLogger.logging( video_id, "视频封面分数都为0,不做封面更改", "2002", cover_all_data)
                 AliyunLogger.logging( video_id, "视频封面分数都为0,不做封面更改", "2002", cover_all_data)
                 text = (
                 text = (
                     f"**通知类型**: 视频封面分数都为0,不做封面更改\n"
                     f"**通知类型**: 视频封面分数都为0,不做封面更改\n"