From e3c97ef0b2d4dc0cc20a492954d4e6a2766a2ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=82=A5=E7=BE=8A?= <1048382248@qq.com> Date: Wed, 22 Apr 2026 16:38:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20=E7=8E=B0=E6=9C=89=E5=AA=92=E4=BD=93?= =?UTF-8?q?=E8=B5=84=E6=BA=90url=20=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=88=99=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/LJZK_Controller.cs | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/VideoAnalysisCore/Controllers/LJZK_Controller.cs b/VideoAnalysisCore/Controllers/LJZK_Controller.cs index d4974f5..0a6a329 100644 --- a/VideoAnalysisCore/Controllers/LJZK_Controller.cs +++ b/VideoAnalysisCore/Controllers/LJZK_Controller.cs @@ -394,24 +394,26 @@ namespace VideoAnalysisCore.Controllers return BadRequest("参数无效"); if(!string.IsNullOrWhiteSpace(task.MediaUrl)) return Ok(task.MediaUrl); - try - { - var videoInfo = await vodClient.GetPlayInfoAsync(new GetPlayInfoRequest() - { - VideoId = task.TagId, - Formats = "mp4", - OutputType = "cdn", - AuthTimeout = 3600 * 24 * 12, - }); - if (videoInfo is null || videoInfo.StatusCode != 200 && !videoInfo.Body.PlayInfoList.PlayInfo.Any()) - return BadRequest("获取存储的视频信息失败!"); - return Ok(videoInfo.Body.PlayInfoList.PlayInfo.First().PlayURL); + else + return BadRequest("此视频未能获取到视频"); + //try + //{ + // var videoInfo = await vodClient.GetPlayInfoAsync(new GetPlayInfoRequest() + // { + // VideoId = task.TagId, + // Formats = "mp4", + // OutputType = "cdn", + // AuthTimeout = 3600 * 24 * 12, + // }); + // if (videoInfo is null || videoInfo.StatusCode != 200 && !videoInfo.Body.PlayInfoList.PlayInfo.Any()) + // return BadRequest("获取存储的视频信息失败!"); + // return Ok(videoInfo.Body.PlayInfoList.PlayInfo.First().PlayURL); - } - catch (Exception ex) - { - return BadRequest("获取存储的视频信息失败!" + ex.Message); - } + //} + //catch (Exception ex) + //{ + // return BadRequest("获取存储的视频信息失败!" + ex.Message); + //} }