|
@@ -56,16 +56,16 @@ class CoverMethod:
|
|
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) # 获取分数最高的视频封面
|
|
print(f"最高分封面{highest_cover_url},分数{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)
|
|
|
|
- text = (
|
|
|
|
- f"**通知类型**: 视频封面分数都为0,不做封面更改\n"
|
|
|
|
- f"**站内视频ID链接**: https://admin.piaoquantv.com/cms/post-detail/{video_id}/detail\n"
|
|
|
|
- )
|
|
|
|
- Feishu.finish_bot( text,
|
|
|
|
- "https://open.feishu.cn/open-apis/bot/v2/hook/63745308-c53e-4030-90b9-77383b057252",
|
|
|
|
- "【 封面修改通知 】" )
|
|
|
|
- return
|
|
|
|
|
|
+ # if not highest_cover_url or highest_cover_sum == 0:
|
|
|
|
+ # AliyunLogger.logging( video_id, "视频封面分数都为0,不做封面更改", "2002", cover_all_data)
|
|
|
|
+ # text = (
|
|
|
|
+ # f"**通知类型**: 视频封面分数都为0,不做封面更改\n"
|
|
|
|
+ # f"**站内视频ID链接**: https://admin.piaoquantv.com/cms/post-detail/{video_id}/detail\n"
|
|
|
|
+ # )
|
|
|
|
+ # Feishu.finish_bot( text,
|
|
|
|
+ # "https://open.feishu.cn/open-apis/bot/v2/hook/63745308-c53e-4030-90b9-77383b057252",
|
|
|
|
+ # "【 封面修改通知 】" )
|
|
|
|
+ # return
|
|
cover_id, old_cover_url = PQ.get_pq_cover_id(video_id) # 获取原封面 和 封面ID
|
|
cover_id, old_cover_url = PQ.get_pq_cover_id(video_id) # 获取原封面 和 封面ID
|
|
if not cover_id:
|
|
if not cover_id:
|
|
AliyunLogger.logging( video_id, "获取视频原封面和封面ID失败", "3002", cover_all_data, old_cover_url, highest_cover_url)
|
|
AliyunLogger.logging( video_id, "获取视频原封面和封面ID失败", "3002", cover_all_data, old_cover_url, highest_cover_url)
|
|
@@ -78,6 +78,11 @@ class CoverMethod:
|
|
old_cover_sum = 0
|
|
old_cover_sum = 0
|
|
else:
|
|
else:
|
|
old_cover_url1, old_cover_sum = CoverMethod.cover_data_dispose( old_cover_data )
|
|
old_cover_url1, old_cover_sum = CoverMethod.cover_data_dispose( old_cover_data )
|
|
|
|
+ if int(old_cover_sum) == 0 and int(highest_cover_sum) == 0:
|
|
|
|
+ selected_record = random.choice( cover_all_data )
|
|
|
|
+ highest_cover_url = selected_record['cover_url']
|
|
|
|
+ highest_cover_sum = selected_record['cover_sum']
|
|
|
|
+
|
|
if highest_cover_url == old_cover_url:
|
|
if highest_cover_url == old_cover_url:
|
|
AliyunLogger.logging( video_id, "原封面与新封面一致,不做封面修改", "2003", cover_all_data, old_cover_url,
|
|
AliyunLogger.logging( video_id, "原封面与新封面一致,不做封面修改", "2003", cover_all_data, old_cover_url,
|
|
highest_cover_url )
|
|
highest_cover_url )
|
|
@@ -93,9 +98,9 @@ class CoverMethod:
|
|
"https://open.feishu.cn/open-apis/bot/v2/hook/63745308-c53e-4030-90b9-77383b057252",
|
|
"https://open.feishu.cn/open-apis/bot/v2/hook/63745308-c53e-4030-90b9-77383b057252",
|
|
"【 封面修改通知 】" )
|
|
"【 封面修改通知 】" )
|
|
return
|
|
return
|
|
- if int(highest_cover_sum) < int(old_cover_sum):
|
|
|
|
|
|
+ if int(old_cover_sum) != 0 and int(highest_cover_sum) <= int(old_cover_sum):
|
|
text = (
|
|
text = (
|
|
- f"**通知类型**: 原封面分数比新封面分数高,不做封面修改\n"
|
|
|
|
|
|
+ f"**通知类型**: 原封面分数比新封面分数高/分数相同,不做封面修改\n"
|
|
f"**站内视频ID链接**: https://admin.piaoquantv.com/cms/post-detail/{video_id}/detail\n"
|
|
f"**站内视频ID链接**: https://admin.piaoquantv.com/cms/post-detail/{video_id}/detail\n"
|
|
f"**原视频封面链接**: {old_cover_url}\n"
|
|
f"**原视频封面链接**: {old_cover_url}\n"
|
|
f"**原视频封面分数**: {old_cover_sum}\n"
|
|
f"**原视频封面分数**: {old_cover_sum}\n"
|