package com.yeshi.buwan.util.video;
|
|
import net.sf.json.JSONObject;
|
|
public class Ku6VideoParser {
|
public static String getVideoIdFromUrl(String url) {
|
if (url.contains("?")) {
|
url = url.split("\\?")[0];
|
}
|
String[] sts = url.split("/");
|
return sts[sts.length - 1].replace(".html", "");
|
}
|
|
public static String getRequestUrl(String url) {
|
String videoid = getVideoIdFromUrl(url);
|
return "http://v.ku6.com/fetch.htm?t=getVideo4Player&vid=" + videoid;
|
}
|
|
public static String parseResponse(String data) {
|
JSONObject object = JSONObject.fromObject(data);
|
String f = object.optJSONObject("data").optString("f");
|
return f;
|
}
|
|
}
|