* @param url
* @return
* @throws Exception
*/
public static Video getVideoInfo(String url) throws Exception {
Video video = null;
if (url.indexOf(VideoConstants.VIDEO_DOMAIN_YOUKU) != -1) {
try {
video = getYouKuVideo(url);
} catch (Exception e) {
e.printStackTrace();
video = null;
}
}
else if(url.indexOf(VideoConstants.VIDEO_DOMAIN_TUDOU_PLAYLIST)!=-1){
try {
video = getTudouPlayListVideo(url);
} catch (Exception e) {
video = null;
}
}else if (url.indexOf(VideoConstants.VIDEO_DOMAIN_TUDOU) != -1) {
try {
video = getTudouVideo(url);
} catch (Exception e) {
video = null;
}
} else if (url.indexOf(VideoConstants.VIDEO_DOMAIN_KU6) != -1) {
try {
video = getKu6Video(url);
} catch (Exception e) {
video = null;
}
} else if (url.indexOf(VideoConstants.VIDEO_DOMAIN_CN6) != -1) {
try {
video = get6Video(url);
} catch (Exception e) {
video = null;
}
} else if (url.indexOf(VideoConstants.VIDEO_DOMAIN_WOLE) != -1) {
try {
video = get56Video(url);
} catch (Exception e) {
video = null;
}
} else if (url.indexOf(VideoConstants.VIDEO_DOMAIN_SINA) != -1) {
try {
video = getSinaVideo(url);
} catch (Exception e) {
video = null;
}
} else if (url.indexOf(VideoConstants.VIDEO_DOMAIN_SOHU) != -1) {
try {
video = getSohuVideo(url);
} catch (Exception e) {
video = null;
}
} else if (url.indexOf(VideoConstants.VIDEO_DOMAIN_IFENG) != -1) {
try {
video = getIfengVideo(url);
} catch (Exception e) {
video = null;
}
} else if (url.indexOf(VideoConstants.VIDEO_DOMAIN_YINYUETAI) != -1) {
try {
video = getYinYueTaiVideo(url);
} catch (Exception e) {
video = null;
}
} else {
// 链接地址不在支持的列表中时返回原链接地址以及链接的页面标题
Document doc = getURLContent(url);
video = new Video();
video.setTitle(doc.title());
video.setPageUrl(url);
}
return video;
}