。。。

This commit is contained in:
wangliwen 2022-06-24 17:02:46 +08:00
parent 6e4c75927e
commit d95fd0496a
1 changed files with 6 additions and 2 deletions

View File

@ -33,10 +33,14 @@ public class BaoTouVideoPreviewService extends AbstractVideoPreviewService {
@Override
public String getHls(String key) {
String hls = null;
Request request = new Request.Builder().url(String.format(baoTouProperties.getHlsurl(), key)).build();
String url = String.format(baoTouProperties.getHlsurl(), key);
logger.info("包头预览:" + url);
Request request = new Request.Builder().url(url).build();
try (Response response = client.newCall(request).execute()) {
if (response.isSuccessful()) {
JSONObject jsonObject = JSON.parseObject(response.body().string());
String body = response.body().string();
logger.error("包头预览返回:" + body);
JSONObject jsonObject = JSON.parseObject(body);
if (jsonObject.containsKey("data")) {
hls = jsonObject.getString("data");
}