package com.yeshi.buwan.util.video;
|
|
import org.jsoup.Jsoup;
|
import org.jsoup.nodes.Document;
|
import org.jsoup.nodes.Element;
|
import org.jsoup.select.Elements;
|
|
public class FlvCdVideoParser {
|
public static String getRequestUrl(String url) {
|
return "http://www.flvcd.com/parse.php?format=&kw=" + url;
|
}
|
|
public static String parseResult(String data) {
|
Document doc = Jsoup.parse(data);
|
Elements els = doc.getElementsByTag("script");
|
for (int i = 0; i < els.size(); i++) {
|
Element el = els.get(i);
|
if (el.toString().contains("var clipurl")) {
|
String sts[] = el.toString()
|
.replace("<script type=\"text/javascript\">", "")
|
.replace("</script>", "").split(";");
|
for (String st : sts) {
|
if (st.contains("var clipurl")) {
|
return st.replace("var clipurl =", "").replace(";", "").replace("\"", "")
|
.trim();
|
|
}
|
}
|
}
|
}
|
|
return "";
|
}
|
|
}
|