|
@@ -1,8 +1,9 @@
|
|
package cn.com.ctop.crawler.modules.oceanengine.service.impl;
|
|
package cn.com.ctop.crawler.modules.oceanengine.service.impl;
|
|
|
|
|
|
import cn.com.ctop.common.module.utils.Base64Utils;
|
|
import cn.com.ctop.common.module.utils.Base64Utils;
|
|
|
|
+import cn.com.ctop.common.module.utils.CosUtils;
|
|
import cn.com.ctop.common.module.utils.HttpUtils2;
|
|
import cn.com.ctop.common.module.utils.HttpUtils2;
|
|
-import cn.com.ctop.common.module.utils.OSSUtils;
|
|
|
|
|
|
+import cn.com.ctop.common.module.vo.ResFileDTO;
|
|
import cn.com.ctop.crawler.modules.core.util.FateadmHttpUtil;
|
|
import cn.com.ctop.crawler.modules.core.util.FateadmHttpUtil;
|
|
import cn.com.ctop.crawler.modules.core.util.FateadmUtil;
|
|
import cn.com.ctop.crawler.modules.core.util.FateadmUtil;
|
|
import cn.com.ctop.crawler.modules.core.util.FfmpegUtils;
|
|
import cn.com.ctop.crawler.modules.core.util.FfmpegUtils;
|
|
@@ -30,7 +31,6 @@ import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.io.FileInputStream;
|
|
import java.io.FileInputStream;
|
|
-import java.io.InputStream;
|
|
|
|
import java.net.HttpURLConnection;
|
|
import java.net.HttpURLConnection;
|
|
import java.net.URL;
|
|
import java.net.URL;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -90,8 +90,9 @@ public class OceanEngineServiceImpl implements IOceanEngineService {
|
|
base64Code = FfmpegUtils.getVideoFirstImage(material.getVideoUrl(),20);
|
|
base64Code = FfmpegUtils.getVideoFirstImage(material.getVideoUrl(),20);
|
|
}
|
|
}
|
|
EffectCase.base64ToFile("/mnt/crawler/hotmat/",base64Code,material.getVid()+".jpg");
|
|
EffectCase.base64ToFile("/mnt/crawler/hotmat/",base64Code,material.getVid()+".jpg");
|
|
- String coverUrl = OSSUtils.uploadFile2OSS(new FileInputStream("/mnt/crawler/hotmat/"+material.getVid()+".jpg"),"ocean-engine/hot-material/",material.getVid()+".jpg");
|
|
|
|
- material.setCoverUrl(coverUrl);
|
|
|
|
|
|
+ String fileSavePath = "/mnt/crawler/hotmat/"+material.getVid()+".jpg";
|
|
|
|
+ ResFileDTO dto = CosUtils.uploadDetailInputStream(new FileInputStream(fileSavePath),material.getVid()+".jpg","jpg",1000L,"ocean-engine/hot-material/");
|
|
|
|
+ material.setCoverUrl(dto.getFileUrl());
|
|
hotMaterialService.saveOrUpdate(material);
|
|
hotMaterialService.saveOrUpdate(material);
|
|
}
|
|
}
|
|
hotMaterialHandler(page+1,appCode,appName);
|
|
hotMaterialHandler(page+1,appCode,appName);
|
|
@@ -160,8 +161,9 @@ public class OceanEngineServiceImpl implements IOceanEngineService {
|
|
base64Code = FfmpegUtils.getVideoFirstImage(effectCase.getVideoUrl(),20);
|
|
base64Code = FfmpegUtils.getVideoFirstImage(effectCase.getVideoUrl(),20);
|
|
}
|
|
}
|
|
EffectCase.base64ToFile("/mnt/crawler/effectcase/",base64Code,effectCase.getVid()+".jpg");
|
|
EffectCase.base64ToFile("/mnt/crawler/effectcase/",base64Code,effectCase.getVid()+".jpg");
|
|
- String coverUrl = OSSUtils.uploadFile2OSS(new FileInputStream("/mnt/crawler/effectcase/"+effectCase.getVid()+".jpg"),"ocean-engine/effect-case/",effectCase.getVid()+".jpg");
|
|
|
|
- effectCase.setCoverUrl(coverUrl);
|
|
|
|
|
|
+ String fileSavePath = "/mnt/crawler/effectcase/"+effectCase.getVid()+".jpg";
|
|
|
|
+ ResFileDTO dto = CosUtils.uploadDetailInputStream(new FileInputStream(fileSavePath),effectCase.getVid()+".jpg","jpg",1000L,"ocean-engine/effect-case/");
|
|
|
|
+ effectCase.setCoverUrl(dto.getFileUrl());
|
|
effectCase.setCreativeLabel(getCase.getString("creative_label"));
|
|
effectCase.setCreativeLabel(getCase.getString("creative_label"));
|
|
}
|
|
}
|
|
effectCaseService.saveOrUpdate(effectCase);
|
|
effectCaseService.saveOrUpdate(effectCase);
|
|
@@ -200,8 +202,9 @@ public class OceanEngineServiceImpl implements IOceanEngineService {
|
|
base64Code = FfmpegUtils.getVideoFirstImage(douyinHot.getUrl(),20);
|
|
base64Code = FfmpegUtils.getVideoFirstImage(douyinHot.getUrl(),20);
|
|
}
|
|
}
|
|
EffectCase.base64ToFile("/mnt/crawler/douyinhot/",base64Code,douyinHot.getMid()+".jpg");
|
|
EffectCase.base64ToFile("/mnt/crawler/douyinhot/",base64Code,douyinHot.getMid()+".jpg");
|
|
- String coverUrl = OSSUtils.uploadFile2OSS(new FileInputStream("/mnt/crawler/douyinhot/"+douyinHot.getMid()+".jpg"),"ocean-engine/doyin-hot/",douyinHot.getMid()+".jpg");
|
|
|
|
- douyinHot.setCoverUrl(coverUrl);
|
|
|
|
|
|
+ String fileSavePath = "/mnt/crawler/douyinhot/"+douyinHot.getMid()+".jpg";
|
|
|
|
+ ResFileDTO dto = CosUtils.uploadDetailInputStream(new FileInputStream(fileSavePath),douyinHot.getMid()+".jpg","jpg",1000L,"ocean-engine/doyin-hot/");
|
|
|
|
+ douyinHot.setCoverUrl(dto.getFileUrl());
|
|
douyinHotService.saveOrUpdate(douyinHot);
|
|
douyinHotService.saveOrUpdate(douyinHot);
|
|
}
|
|
}
|
|
douyinHotHandler(page+1,listType);
|
|
douyinHotHandler(page+1,listType);
|