|
@@ -18,6 +18,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import it.sauronsoftware.jave.Encoder;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.io.File;
|
|
@@ -49,6 +50,12 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
private IVideoWatermarkTemplateService videoWatermarkTemplateService;
|
|
|
@Autowired
|
|
|
private IVideoWatermarkTaskService videoWatermarkTaskService;
|
|
|
+ @Value("${oss.replace.replace-value}")
|
|
|
+ private String replaceValue;
|
|
|
+ @Value("${oss.replace.replace-old-value}")
|
|
|
+ private String replaceOldValue;
|
|
|
+ @Value("${oss.replace.download}")
|
|
|
+ private String downloadUrl;
|
|
|
|
|
|
@Override
|
|
|
public void watermarkVideo(String materialId, Integer videoWatermarkTemplateId, String userId) {
|
|
@@ -336,9 +343,10 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
try {
|
|
|
log.info("获取素材基本信息,code:{}", materialInfo.getCode());
|
|
|
if (!Check.isNull(materialInfo)) {
|
|
|
- String url = materialInfo.getUrl();
|
|
|
long l = System.currentTimeMillis();
|
|
|
- String localUrl = LoadFileUtil.downLoadFromUrl(url, PropertiesUtils.getValue("kuaishou_config", "video_sava_path"));
|
|
|
+ String url = materialInfo.getUrl().replace(replaceOldValue, replaceValue);
|
|
|
+ log.info("replaceUrl:{}", url);
|
|
|
+ String localUrl = LoadFileUtil.downLoadFromUrl(url, downloadUrl);
|
|
|
File file = new File(localUrl);
|
|
|
it.sauronsoftware.jave.Encoder encoder = new Encoder();
|
|
|
try {
|