Fix Kanqiu
This commit is contained in:
parent
15f94bc061
commit
4b7b789023
|
|
@ -14,7 +14,6 @@ import com.github.catvod.utils.Util;
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import org.jsoup.Jsoup;
|
import org.jsoup.Jsoup;
|
||||||
import org.jsoup.nodes.Document;
|
|
||||||
import org.jsoup.nodes.Element;
|
import org.jsoup.nodes.Element;
|
||||||
import org.jsoup.select.Elements;
|
import org.jsoup.select.Elements;
|
||||||
|
|
||||||
|
|
@ -29,7 +28,7 @@ import java.util.Map;
|
||||||
*/
|
*/
|
||||||
public class Kanqiu extends Spider {
|
public class Kanqiu extends Spider {
|
||||||
|
|
||||||
private static String siteUrl = "http://www.88kanqiu.one";
|
private static String siteUrl = "http://www.88kanqiu.tw";
|
||||||
|
|
||||||
private Map<String, String> getHeader() {
|
private Map<String, String> getHeader() {
|
||||||
Map<String, String> header = new HashMap<>();
|
Map<String, String> header = new HashMap<>();
|
||||||
|
|
@ -74,10 +73,10 @@ public class Kanqiu extends Spider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String detailContent(List<String> ids) throws Exception {
|
public String detailContent(List<String> ids) throws Exception {
|
||||||
if (ids.get(0).equals(siteUrl)) return Result.error("比賽尚未開始");
|
if (ids.get(0).equals(siteUrl)) return Result.error("比赛尚未开始");
|
||||||
Document doc = Jsoup.parse(OkHttp.string(ids.get(0), getHeader()));
|
String content = OkHttp.string(ids.get(0) + "-url", getHeader());
|
||||||
String t = doc.select("#t").attr("value");
|
String result = new JSONObject(content).optString("data");
|
||||||
String result = t.substring(6);
|
result = result.substring(6);
|
||||||
result = result.substring(0, result.length() - 2);
|
result = result.substring(0, result.length() - 2);
|
||||||
String json = new String(Base64.decode(result, Base64.DEFAULT));
|
String json = new String(Base64.decode(result, Base64.DEFAULT));
|
||||||
JSONArray linksArray = new JSONObject(json).getJSONArray("links");
|
JSONArray linksArray = new JSONObject(json).getJSONArray("links");
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
981f96ca587242d475007855c5b33f56
|
8327a95a4336dac3f0177f08056d3165
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue