修复看球
This commit is contained in:
parent
49841f2935
commit
e9d07b2e68
|
|
@ -16,6 +16,7 @@ import org.json.JSONObject;
|
|||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.nodes.Element;
|
||||
import org.jsoup.select.Elements;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
|
@ -44,7 +45,7 @@ public class Kanqiu extends Spider {
|
|||
@Override
|
||||
public String homeContent(boolean filter) throws Exception {
|
||||
List<Class> classes = new ArrayList<>();
|
||||
List<String> typeIds = Arrays.asList("", "1", "8", "29");
|
||||
List<String> typeIds = Arrays.asList("", "1", "8", "21");
|
||||
List<String> typeNames = Arrays.asList("全部直播", "篮球直播", "足球直播", "其他直播");
|
||||
for (int i = 0; i < typeIds.size(); i++) classes.add(new Class(typeIds.get(i), typeNames.get(i)));
|
||||
String f = "{\"1\": [{\"key\": \"cateId\", \"name\": \"类型\", \"value\": [{\"n\": \"NBA\", \"v\": \"1\"}, {\"n\": \"CBA\", \"v\": \"2\"}, {\"n\": \"篮球综合\", \"v\": \"4\"}, {\"n\": \"纬来体育\", \"v\": \"21\"}]}],\"8\": [{\"key\": \"cateId\", \"name\": \"类型\", \"value\": [{\"n\": \"英超\", \"v\": \"8\"}, {\"n\": \"西甲\", \"v\": \"9\"}, {\"n\": \"意甲\", \"v\": \"10\"}, {\"n\": \"欧冠\", \"v\": \"12\"}, {\"n\": \"欧联\", \"v\": \"13\"}, {\"n\": \"德甲\", \"v\": \"14\"}, {\"n\": \"法甲\", \"v\": \"15\"}, {\"n\": \"欧国联\", \"v\": \"16\"}, {\"n\": \"足总杯\", \"v\": \"27\"}, {\"n\": \"国王杯\", \"v\": \"33\"}, {\"n\": \"中超\", \"v\": \"7\"}, {\"n\": \"亚冠\", \"v\": \"11\"}, {\"n\": \"足球综合\", \"v\": \"23\"}, {\"n\": \"欧协联\", \"v\": \"28\"}, {\"n\": \"美职联\", \"v\": \"26\"}]}], \"29\": [{\"key\": \"cateId\", \"name\": \"类型\", \"value\": [{\"n\": \"网球\", \"v\": \"29\"}, {\"n\": \"斯洛克\", \"v\": \"30\"}, {\"n\": \"MLB\", \"v\": \"38\"}, {\"n\": \"UFC\", \"v\": \"32\"}, {\"n\": \"NFL\", \"v\": \"25\"}, {\"n\": \"CCTV5\", \"v\": \"18\"}]}]}";
|
||||
|
|
@ -54,24 +55,21 @@ public class Kanqiu extends Spider {
|
|||
|
||||
@Override
|
||||
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
|
||||
String cateId = extend.containsKey("cateId") ? extend.get("cateId") : tid;
|
||||
String cateUrl = siteUrl + String.format("/match/%s/live", cateId);
|
||||
Document doc = Jsoup.parse(OkHttp.string(cateUrl, getHeader()));
|
||||
String cateId = extend.get("cateId") == null ? tid : extend.get("cateId");
|
||||
String cateUrl = siteUrl + (cateId.isEmpty() ? String.format("%s", cateId) : String.format("/match/%s/live", cateId));
|
||||
Elements lis = Jsoup.parse(OkHttp.string(cateUrl, getHeader())).select(".list-group-item");
|
||||
List<Vod> list = new ArrayList<>();
|
||||
int size = 0;
|
||||
for (Element li : doc.select(".list-group-item")) {
|
||||
size = doc.select(".list-group-item").size();
|
||||
for (Element li : lis) {
|
||||
String vid = siteUrl + li.select(".btn.btn-primary").attr("href");
|
||||
String name = li.select(".row.d-none").text();
|
||||
if (name.isEmpty()) name = li.text();
|
||||
String pic = li.select(".col-xs-1").eq(0).select("img").attr("src");
|
||||
if (pic.isEmpty()) pic = "https://qlql.link/b/日期.jpg";
|
||||
if (pic.isEmpty()) pic = "https://pic.imgdb.cn/item/657673d6c458853aeff94ab9.jpg";
|
||||
if (!pic.startsWith("http")) pic = siteUrl + pic;
|
||||
String remark = li.select(".btn.btn-primary").text();
|
||||
list.add(new Vod(vid, name, pic, remark));
|
||||
}
|
||||
Result result = Result.get().page(1, 1, 0, size).vod(list);
|
||||
return result.string();
|
||||
return Result.get().page(1, 1, 0, lis.size()).vod(list).string();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -79,8 +77,8 @@ public class Kanqiu extends Spider {
|
|||
if (ids.get(0).equals(siteUrl)) return Result.error("比賽尚未開始");
|
||||
Document doc = Jsoup.parse(OkHttp.string(ids.get(0), getHeader()));
|
||||
String t = doc.select("#t").attr("value");
|
||||
String result = t.substring(2);
|
||||
result = result.substring(0, result.length() - 3);
|
||||
String result = t.substring(6);
|
||||
result = result.substring(0, result.length() - 2);
|
||||
String json = new String(Base64.decode(result, Base64.DEFAULT));
|
||||
JSONArray linksArray = new JSONObject(json).getJSONArray("links");
|
||||
List<String> vodItems = new ArrayList<>();
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
145b12c8a9a89fcc35c0494c905f2f96
|
||||
bc 37 a9 26 8b 9f 51 bf e5 e3 52 46 2f dd ea 73
|
||||
|
|
|
|||
Loading…
Reference in New Issue