package com.hxh.spring.test;
|
|
import com.yeshi.buwan.domain.VideoDetailInfo;
|
import com.yeshi.buwan.domain.VideoInfo;
|
import com.yeshi.buwan.domain.VideoType;
|
import com.yeshi.buwan.domain.system.DetailSystem;
|
import com.yeshi.buwan.service.imp.BanQuanService;
|
import com.yeshi.buwan.service.imp.ClassService;
|
import com.yeshi.buwan.util.*;
|
import com.yeshi.buwan.util.JuHe.VideoResourceUtil;
|
import com.yeshi.buwan.util.video.VideoDetailUtil;
|
import org.json.JSONArray;
|
|
import java.io.File;
|
import java.util.List;
|
import java.util.regex.Pattern;
|
|
public class Test {
|
|
@org.junit.Test
|
public void test() {
|
VideoResourceUtil videoResouceUtil = com.yeshi.buwan.util.BeanUtil.getBean(VideoResourceUtil.class);
|
VideoDetailUtil videoDeailUtil = com.yeshi.buwan.util.BeanUtil.getBean(VideoDetailUtil.class);
|
ClassService classService = com.yeshi.buwan.util.BeanUtil.getBean(ClassService.class);
|
|
List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), Integer.parseInt(70 + ""), null);
|
|
VideoInfo info = (videoDeailUtil.getVideoInfo(null, 3400048 + "", 13 + "", resourceList,
|
CacheUtil.getMD5Long(resourceList)));
|
|
List<VideoType> typeList = classService.getVideoTypeList(info.getId());
|
if (typeList != null && typeList.size() > 0) {
|
VideoType type = typeList.get(0);
|
while (type.getParent() != null)
|
type = type.getParent();
|
info.setVideoType(type);
|
}
|
|
info.setPlayPicture(VideoPictureUtil.getShowPicture(info, "android", 70 + ""));
|
for (VideoDetailInfo vd : info.getVideoDetailList()) {
|
if (StringUtil.isNullOrEmpty(vd.getExtraId()))
|
vd.setExtraId(vd.getId() + "");
|
}
|
|
}
|
|
@org.junit.Test
|
public void test2() {
|
BanQuanService banQuanService = BeanUtil.getBean(BanQuanService.class);
|
List<String> keys = banQuanService.getBanQuanKeyListAll(43);
|
System.out.println(keys);
|
}
|
|
@org.junit.Test
|
public void test3() {
|
SolrUtil.dataimportVideo();
|
}
|
|
@org.junit.Test
|
public void test4() {
|
String regex = "^http://www\\.baidu\\.com";
|
System.out.print(Pattern.matches(regex, "http://www.baidu.com"));
|
}
|
|
|
@org.junit.Test
|
public void test40() {
|
File f=new File("E:\\工作\\文网文视频\\美女封面");
|
f.listFiles();
|
Runtime runtime = Runtime.getRuntime();
|
|
int count=0;
|
JSONArray array=new JSONArray();
|
for(File ff:f.listFiles()){
|
count++;
|
if(count<300) {
|
array.put(ff.getName());
|
// System.out.println(ff.getName());
|
}
|
// try {
|
// runtime.exec(String.format("ffmpeg -i \"E:\\工作\\文网文视频\\美女视频\\%s\" -vframes 1 -ss 00:00:01 -f mjpeg -s 720*1280 -an \"E:/工作/文网文视频/美女封面/%s\"",ff.getName(),ff.getName().replace(".mp4",".jpg")));
|
// } catch (IOException e) {
|
// e.printStackTrace();
|
// }
|
}
|
|
System.out.println(array.toString());
|
}
|
}
|