feat: 新增平台
This commit is contained in:
@@ -40,6 +40,9 @@ def parse_video():
|
||||
except ValueError as e:
|
||||
return jsonify({'success': False, 'message': str(e)}), 400
|
||||
|
||||
# 展开短链接
|
||||
video_url = ParserFactory.expand_short_url(video_url)
|
||||
|
||||
# 生成任务ID
|
||||
task_id = str(uuid.uuid4())
|
||||
|
||||
@@ -116,6 +119,10 @@ def _process_task(task_id, video_url, platform, user_id, ip_address):
|
||||
# 执行解析
|
||||
result = parser.parse(video_url)
|
||||
|
||||
# 验证解析结果,video_url 不能为空
|
||||
if not result.get('video_url'):
|
||||
raise Exception('未能获取到视频链接')
|
||||
|
||||
# 计算响应时间
|
||||
response_time = int((time.time() - start_time) * 1000)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user