add - Upyso888888
This commit is contained in:
@@ -51,7 +51,7 @@ public class JsonBasic {
|
|||||||
int start = url.indexOf("cat_ext=");
|
int start = url.indexOf("cat_ext=");
|
||||||
int end = url.indexOf("&", start);
|
int end = url.indexOf("&", start);
|
||||||
String ext = url.substring(start + 8, end);
|
String ext = url.substring(start + 8, end);
|
||||||
ext = getBase64(ext);
|
ext = Base64.decode(ext, Base64.DEFAULT | Base64.URL_SAFE | Base64.NO_WRAP);
|
||||||
String newUrl = url.substring(0, start) + url.substring(end + 1);
|
String newUrl = url.substring(0, start) + url.substring(end + 1);
|
||||||
JSONObject jsonObject = new JSONObject(ext);
|
JSONObject jsonObject = new JSONObject(ext);
|
||||||
if (jsonObject.has("header")) {
|
if (jsonObject.has("header")) {
|
||||||
@@ -70,11 +70,18 @@ public class JsonBasic {
|
|||||||
return reqHeaders;
|
return reqHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getBase64(String json){
|
public static String getBase64(String decodeStr){
|
||||||
json = new String(Base64.decode(json, Base64.DEFAULT | Base64.URL_SAFE | Base64.NO_WRAP));
|
if (decodeStr == null) return null;
|
||||||
return json;
|
try {
|
||||||
|
byte[] b = Base64.decode(decodeStr,Base64.DEFAULT);
|
||||||
|
return new String(b);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return decodeStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static HashMap<String, String> parse(String url) {
|
public static HashMap<String, String> parse(String url) {
|
||||||
String json = OkHttpUtil.string(url, Misc.Headers(1));
|
String json = OkHttpUtil.string(url, Misc.Headers(1));
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ public class Upyunso extends Spider {
|
|||||||
public String searchContent(String key, boolean z) {
|
public String searchContent(String key, boolean z) {
|
||||||
try {
|
try {
|
||||||
JSONArray jSONArray = new JSONArray();
|
JSONArray jSONArray = new JSONArray();
|
||||||
|
key = URLEncoder.encode(key);
|
||||||
JSONArray arr = Base64Utils.getJSONByUrl("https://api.upyunso.com/search?keyword=" + key);
|
JSONArray arr = Base64Utils.getJSONByUrl("https://api.upyunso.com/search?keyword=" + key);
|
||||||
if (arr.length() > 0) {
|
if (arr.length() > 0) {
|
||||||
String pic = "http://image.xinjun58.com/image/tv/ups.jpg";
|
String pic = "http://image.xinjun58.com/image/tv/ups.jpg";
|
||||||
|
|||||||
Reference in New Issue
Block a user