revert
This commit is contained in:
parent
614a69d169
commit
37736ff555
|
|
@ -9,17 +9,15 @@ import com.github.catvod.bean.Vod;
|
||||||
import com.github.catvod.crawler.Spider;
|
import com.github.catvod.crawler.Spider;
|
||||||
import com.github.catvod.net.OkHttp;
|
import com.github.catvod.net.OkHttp;
|
||||||
|
|
||||||
import com.github.catvod.utils.Utils;
|
|
||||||
import com.whl.quickjs.android.QuickJSLoader;
|
|
||||||
import com.whl.quickjs.wrapper.QuickJSContext;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
import org.jsoup.Jsoup;
|
import org.jsoup.Jsoup;
|
||||||
import org.jsoup.nodes.Document;
|
import org.jsoup.nodes.Document;
|
||||||
import org.jsoup.nodes.Element;
|
import org.jsoup.nodes.Element;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
import java.util.regex.Matcher;
|
import java.util.Arrays;
|
||||||
import java.util.regex.Pattern;
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class Miss extends Spider {
|
public class Miss extends Spider {
|
||||||
|
|
||||||
|
|
@ -96,29 +94,7 @@ public class Miss extends Spider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
|
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
|
||||||
QuickJSLoader.init();
|
return Result.get().parse().url(url + id).string();
|
||||||
QuickJSContext ctx = QuickJSContext.create();
|
|
||||||
String content = OkHttp.string(url + id);
|
|
||||||
Pattern pattern = Pattern.compile("(eval\\(.*?\\))\\n", Pattern.DOTALL);
|
|
||||||
Matcher matcher = pattern.matcher(content);
|
|
||||||
JSONObject js;
|
|
||||||
if (matcher.find()) {
|
|
||||||
String evalBlock = matcher.group(1);
|
|
||||||
ctx.evaluate(evalBlock);
|
|
||||||
js = new JSONObject(ctx.getGlobalObject().stringify());
|
|
||||||
} else {
|
|
||||||
return Result.get().parse().url(url + id).string();
|
|
||||||
}
|
|
||||||
List<String> playUrl = new ArrayList<>();
|
|
||||||
for (Iterator<String> it = js.keys(); it.hasNext();) {
|
|
||||||
String key = it.next();
|
|
||||||
playUrl.add(key);
|
|
||||||
playUrl.add(js.getString(key));
|
|
||||||
}
|
|
||||||
Map<String, String> headers = new HashMap<>();
|
|
||||||
headers.put("User-Agent", Utils.CHROME);
|
|
||||||
headers.put("Referer", url + id);
|
|
||||||
return Result.get().url(playUrl).header(headers).string();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String searchContent(String key, String pg) {
|
private String searchContent(String key, String pg) {
|
||||||
|
|
@ -135,4 +111,4 @@ public class Miss extends Spider {
|
||||||
}
|
}
|
||||||
return Result.string(list);
|
return Result.string(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
4f90ef7818edacb249076f30238d4305
|
f5c681312ac1e3ccac064a72d92544e2
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue