Compare commits

...

2 Commits

2 changed files with 22 additions and 17 deletions

View File

@ -56,6 +56,7 @@
}, },
"DB": { "DB": {
"ConnectionString": "AllowLoadLocalInfile=true;Server=192.168.2.9;User ID=root;Password=qwe123!@#;Port=3306;Database=learn.videoanalysis;CharSet=utf8mb4;pooling=true;SslMode=None", "ConnectionString": "AllowLoadLocalInfile=true;Server=192.168.2.9;User ID=root;Password=qwe123!@#;Port=3306;Database=learn.videoanalysis;CharSet=utf8mb4;pooling=true;SslMode=None",
//"ConnectionString": "AllowLoadLocalInfile=true;Server=rm-2vc20nd3d11g0oh6g2o.rwlb.cn-chengdu.rds.aliyuncs.com;User ID=marking;Password=poiuytPOIUYT098765)(*&^%;Port=3306;Database=learn.videoanalysis;CharSet=utf8mb4;pooling=true;SslMode=None",
"SqlType": "MySql", "SqlType": "MySql",
"UpdateTable": false "UpdateTable": false
}, },

View File

@ -392,24 +392,28 @@ namespace VideoAnalysisCore.Controllers
var task = await videoTaskDB.GetByIdAsync(videoTaskId); var task = await videoTaskDB.GetByIdAsync(videoTaskId);
if (task is null) if (task is null)
return BadRequest("参数无效"); return BadRequest("参数无效");
try if(!string.IsNullOrWhiteSpace(task.MediaUrl))
{ return Ok(task.MediaUrl);
var videoInfo = await vodClient.GetPlayInfoAsync(new GetPlayInfoRequest() else
{ return BadRequest("此视频未能获取到视频");
VideoId = task.TagId, //try
Formats = "mp4", //{
OutputType = "cdn", // var videoInfo = await vodClient.GetPlayInfoAsync(new GetPlayInfoRequest()
AuthTimeout = 3600 * 24 * 12, // {
}); // VideoId = task.TagId,
if (videoInfo is null || videoInfo.StatusCode != 200 && !videoInfo.Body.PlayInfoList.PlayInfo.Any()) // Formats = "mp4",
return BadRequest("获取存储的视频信息失败!"); // OutputType = "cdn",
return Ok(videoInfo.Body.PlayInfoList.PlayInfo.First().PlayURL); // 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) //catch (Exception ex)
{ //{
return BadRequest("获取存储的视频信息失败!" + ex.Message); // return BadRequest("获取存储的视频信息失败!" + ex.Message);
} //}
} }