Update ali search
This commit is contained in:
parent
df055f8ae2
commit
c821ac5618
|
|
@ -31,10 +31,10 @@ public class Item {
|
||||||
@SerializedName("list")
|
@SerializedName("list")
|
||||||
private List<ListDTO> list;
|
private List<ListDTO> list;
|
||||||
|
|
||||||
public List<Vod> getList() {
|
public List<Vod> getList(String key) {
|
||||||
List<Vod> items = new ArrayList<>();
|
List<Vod> items = new ArrayList<>();
|
||||||
list = list == null ? Collections.emptyList() : list;
|
list = list == null ? Collections.emptyList() : list;
|
||||||
for (ListDTO item : list) items.add(item.getVod());
|
for (ListDTO item : list) if (item.getName().contains(key)) items.add(item.getVod());
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,9 +59,13 @@ public class Item {
|
||||||
return fileInfos;
|
return fileInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return getFileInfos().get(0).getFileName();
|
||||||
|
}
|
||||||
|
|
||||||
public Vod getVod() {
|
public Vod getVod() {
|
||||||
String id = getUrl();
|
String id = getUrl();
|
||||||
String name = getFileInfos().get(0).getFileName();
|
String name = getName();
|
||||||
String remark = getGmtCreate();
|
String remark = getGmtCreate();
|
||||||
String pic = "https://inews.gtimg.com/newsapp_bt/0/13263837859/1000";
|
String pic = "https://inews.gtimg.com/newsapp_bt/0/13263837859/1000";
|
||||||
return new Vod(id, name, pic, remark);
|
return new Vod(id, name, pic, remark);
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ public class UpYun extends Spider {
|
||||||
String url = apiUrl + "search?keyword=" + URLEncoder.encode(key) + "&page=1&s_type=2";
|
String url = apiUrl + "search?keyword=" + URLEncoder.encode(key) + "&page=1&s_type=2";
|
||||||
String res = new String(Base64.decode(OkHttp.string(url, getHeaders()), Base64.DEFAULT));
|
String res = new String(Base64.decode(OkHttp.string(url, getHeaders()), Base64.DEFAULT));
|
||||||
List<Vod> list = new ArrayList<>();
|
List<Vod> list = new ArrayList<>();
|
||||||
for (Item item : Data.objectFrom(res).getResult().getItems()) if (item.isAli()) list.add(item.getVod());
|
for (Item item : Data.objectFrom(res).getResult().getItems()) if (item.isAli() && item.getTitle().contains(key)) list.add(item.getVod());
|
||||||
return Result.string(list);
|
return Result.string(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public class YiSo extends Spider {
|
||||||
Misc.loadWebView(url, getWebViewClient(result));
|
Misc.loadWebView(url, getWebViewClient(result));
|
||||||
while (!result.containsKey("json")) SystemClock.sleep(50);
|
while (!result.containsKey("json")) SystemClock.sleep(50);
|
||||||
String json = JsonParser.parseString(Objects.requireNonNull(result.get("json"))).getAsJsonPrimitive().getAsString();
|
String json = JsonParser.parseString(Objects.requireNonNull(result.get("json"))).getAsJsonPrimitive().getAsString();
|
||||||
return Result.string(Item.objectFrom(json).getData().getList());
|
return Result.string(Item.objectFrom(json).getData().getList(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
private WebViewClient getWebViewClient(Map<String, String> result) {
|
private WebViewClient getWebViewClient(Map<String, String> result) {
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@ public class Zhaozy extends Spider {
|
||||||
Matcher matcher = regexVid.matcher(href);
|
Matcher matcher = regexVid.matcher(href);
|
||||||
if (!matcher.find()) continue;
|
if (!matcher.find()) continue;
|
||||||
String name = element.select("div.news_text a h3").text();
|
String name = element.select("div.news_text a h3").text();
|
||||||
|
if (!name.contains(key)) continue;
|
||||||
String remark = element.select("div.news_text a p").text().split("\\|")[1].split(":")[1];
|
String remark = element.select("div.news_text a p").text().split("\\|")[1].split(":")[1];
|
||||||
Vod vod = new Vod();
|
Vod vod = new Vod();
|
||||||
vod.setVodPic("https://inews.gtimg.com/newsapp_bt/0/13263837859/1000");
|
vod.setVodPic("https://inews.gtimg.com/newsapp_bt/0/13263837859/1000");
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
945b391d7430796229f6d5309037abeb
|
0c652bdac4683c84e151f867dd3abe54
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue