/**
* 根据百度url,获取原本url
* @throws IOException
* @throws HttpException
* */
public static String getRealUrlFromBaiduUrl(String url) {
Connection.Response res = null;
int itimeout = 60000;
try {
res = Jsoup.connect(url).timeout(itimeout).method(Connection.Method.GET).followRedirects(false).execute();
return res.header("Location");
} catch (IOException e) {
e.printStackTrace();
}
return "";
}
* 根据百度url,获取原本url
* @throws IOException
* @throws HttpException
* */
public static String getRealUrlFromBaiduUrl(String url) {
Connection.Response res = null;
int itimeout = 60000;
try {
res = Jsoup.connect(url).timeout(itimeout).method(Connection.Method.GET).followRedirects(false).execute();
return res.header("Location");
} catch (IOException e) {
e.printStackTrace();
}
return "";
}