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,20 +45,22 @@ 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);
String pic = "http://image.xinjun58.com/image/tv/ups.jpg"; if (arr.length() > 0) {
for (int i = 0; i < arr.length(); i++) { String pic = "http://image.xinjun58.com/image/tv/ups.jpg";
JSONObject v = arr.getJSONObject(i); for (int i = 0; i < arr.length(); i++) {
String id = v.getString("url"); JSONObject v = arr.getJSONObject(i);
String title = v.getString("title"); String id = v.getString("url");
v.put("vod_id", id + "$$$" + pic + "$$$" + title); String title = v.getString("title");
v.put("vod_name", title); v.put("vod_id", id + "$$$" + pic + "$$$" + title);
v.put("remark", ""); v.put("vod_name", title);
v.put("vod_pic", pic); v.put("remark", "");
jSONArray.put(v); v.put("vod_pic", pic);
jSONArray.put(v);
}
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("list", jSONArray);
return jSONObject2.toString();
} }
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("list", jSONArray);
return jSONObject2.toString();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }