Search page demo
This commit is contained in:
parent
a50d74129f
commit
b0c599b5bd
|
|
@ -49,25 +49,22 @@ public class PanSou extends Ali {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String searchContent(String key, boolean quick) {
|
public String searchContent(String key, boolean quick) throws Exception {
|
||||||
Map<String, String> types = new HashMap<>();
|
return searchContent(key, "1");
|
||||||
types.put("7", "資料夾");
|
}
|
||||||
types.put("1", "影片");
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick, String pg) throws Exception {
|
||||||
|
return searchContent(key, pg);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String searchContent(String key, String pg) {
|
||||||
|
String url = siteUrl + "/search?k=" + URLEncoder.encode(key) + "&page=" + pg + "&s=0&t=-1";
|
||||||
|
Elements items = Jsoup.parse(OkHttp.string(url)).select("van-row > a");
|
||||||
List<Vod> list = new ArrayList<>();
|
List<Vod> list = new ArrayList<>();
|
||||||
for (Map.Entry<String, String> entry : types.entrySet()) {
|
for (Element item : items) {
|
||||||
String typeId = entry.getKey();
|
String title = item.selectFirst("template").text().trim();
|
||||||
String typeName = entry.getValue();
|
if (title.contains(key)) list.add(new Vod(item.attr("href"), title, "https://inews.gtimg.com/newsapp_bt/0/13263837859/1000"));
|
||||||
String url = siteUrl + "/search?k=" + URLEncoder.encode(key) + "&t=" + typeId;
|
|
||||||
Elements items = Jsoup.parse(OkHttp.string(url)).select("van-row > a");
|
|
||||||
for (Element item : items) {
|
|
||||||
String title = item.selectFirst("template").text().trim();
|
|
||||||
if (!title.contains(key)) continue;
|
|
||||||
Vod vod = new Vod();
|
|
||||||
vod.setVodId(item.attr("href"));
|
|
||||||
vod.setVodName("[" + typeName + "] " + title);
|
|
||||||
vod.setVodPic("https://inews.gtimg.com/newsapp_bt/0/13263837859/1000");
|
|
||||||
list.add(vod);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return Result.string(list);
|
return Result.string(list);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
c180867252ce20f2d59e5a7e6d4fd92a
|
20778c40c4dcb8675aa6a67e3faca620
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue