|
@@ -3,6 +3,7 @@ import time
|
|
|
|
|
|
import requests
|
|
|
import json
|
|
|
+from loguru import logger
|
|
|
|
|
|
from common.aliyun_log import AliyunLogger
|
|
|
from common.redis import get_video_data
|
|
@@ -68,14 +69,14 @@ class VideoProcessing:
|
|
|
cleaned_string = result.replace( "```json", '' ).replace( "```", '' ).strip()
|
|
|
return cleaned_string, str(mark)
|
|
|
except Exception as e:
|
|
|
- print(f"视频请求异常:{e}")
|
|
|
+ logger.error(f"视频请求异常:{e}")
|
|
|
return None
|
|
|
|
|
|
|
|
|
def get_video(self, redis_task):
|
|
|
video_data = get_video_data(redis_task)
|
|
|
if not video_data:
|
|
|
- print("没有获取到视频内容")
|
|
|
+ logger.info("没有获取到视频内容")
|
|
|
time.sleep(5)
|
|
|
return
|
|
|
# 解码为字符串
|
|
@@ -88,10 +89,10 @@ class VideoProcessing:
|
|
|
video_path = data_json['video_path']
|
|
|
type = data_json['type']
|
|
|
partition = data_json['partition']
|
|
|
- print(video_path)
|
|
|
+ logger.info(video_path)
|
|
|
data, mark = self.get_ai_data(video_path)
|
|
|
AliyunLogger.logging(str(video_id), title, video_path, mark, type, partition, data)
|
|
|
- print("写入日志成功")
|
|
|
+ logger.success("写入日志成功")
|
|
|
|
|
|
|
|
|
|