add - Upyso88888

This commit is contained in:
yangqiang3504
2022-09-05 16:24:32 +08:00
parent da0e522d10
commit d13a6aaa7c
2 changed files with 16 additions and 14 deletions
@@ -16,7 +16,7 @@ import org.json.JSONObject;
public class Base64Utils { public class Base64Utils {
public static JSONArray getJSONByUrl(String url){ public static JSONArray getJSONByUrl(String url){
JSONArray a2 = null; JSONArray a2 = new JSONArray();
try { try {
String json = OkHttpUtil.string(url, Misc.Headers(1,url)); String json = OkHttpUtil.string(url, Misc.Headers(1,url));
String s = getBase64(json),title="",uri="",atime="",zt=""; String s = getBase64(json),title="",uri="",atime="",zt="";
@@ -45,6 +45,7 @@ public class Upyunso extends Spider {
try { try {
JSONArray jSONArray = new JSONArray(); JSONArray jSONArray = new JSONArray();
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) {
String pic = "http://image.xinjun58.com/image/tv/ups.jpg"; String pic = "http://image.xinjun58.com/image/tv/ups.jpg";
for (int i = 0; i < arr.length(); i++) { for (int i = 0; i < arr.length(); i++) {
JSONObject v = arr.getJSONObject(i); JSONObject v = arr.getJSONObject(i);
@@ -59,6 +60,7 @@ public class Upyunso extends Spider {
JSONObject jSONObject2 = new JSONObject(); JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("list", jSONArray); jSONObject2.put("list", jSONArray);
return jSONObject2.toString(); return jSONObject2.toString();
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }