supjav 修改
This commit is contained in:
parent
bba4ccf0bc
commit
e9516f5311
|
|
@ -16,7 +16,9 @@ import org.jsoup.nodes.Element;
|
||||||
import org.jsoup.select.Elements;
|
import org.jsoup.select.Elements;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.*;
|
import java.net.*;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class Supjav extends Spider {
|
public class Supjav extends Spider {
|
||||||
|
|
@ -30,10 +32,9 @@ public class Supjav extends Spider {
|
||||||
|
|
||||||
private HashMap<String, String> getHeaders(String referer) {
|
private HashMap<String, String> getHeaders(String referer) {
|
||||||
HashMap<String, String> headers = new HashMap<>();
|
HashMap<String, String> headers = new HashMap<>();
|
||||||
headers.put("Referer", referer);
|
headers.put("Referer", "https://supjav.com/");
|
||||||
headers.put("User-Agent", "PostmanRuntime/7.36.3");
|
|
||||||
headers.put("Host", "supjav.com");
|
headers.put("Host", "supjav.com");
|
||||||
headers.put("Postman-Token", "33290483-3c8d-413f-a160-0d3aea9e6f95");
|
headers.put("User-Agent", Util.CHROME);
|
||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -115,7 +116,7 @@ public class Supjav extends Spider {
|
||||||
String sourceUrl = source.attr("data-link");
|
String sourceUrl = source.attr("data-link");
|
||||||
sites.put(sourceName, "播放" + "$" + sourceUrl);
|
sites.put(sourceName, "播放" + "$" + sourceUrl);
|
||||||
}
|
}
|
||||||
if (sites.size() > 0) {
|
if (!sites.isEmpty()) {
|
||||||
vod.setVodPlayFrom(StringUtils.join(sites.keySet(), "$$$"));
|
vod.setVodPlayFrom(StringUtils.join(sites.keySet(), "$$$"));
|
||||||
vod.setVodPlayUrl(StringUtils.join(sites.values(), "$$$"));
|
vod.setVodPlayUrl(StringUtils.join(sites.values(), "$$$"));
|
||||||
}
|
}
|
||||||
|
|
@ -123,9 +124,9 @@ public class Supjav extends Spider {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String searchContent(String key, boolean quick) {
|
public String searchContent(String key, boolean quick) throws UnsupportedEncodingException {
|
||||||
List<Vod> list = new ArrayList<>();
|
List<Vod> list = new ArrayList<>();
|
||||||
Document doc = Jsoup.parse(OkHttp.string(siteUrl.concat("?s=").concat(URLEncoder.encode(key)), getHeaders()));
|
Document doc = Jsoup.parse(OkHttp.string(siteUrl.concat("?s=").concat(URLEncoder.encode(key, "UTF-8")), getHeaders()));
|
||||||
for (Element element : doc.select("div.post")) {
|
for (Element element : doc.select("div.post")) {
|
||||||
String pic = element.select("img").attr("data-original");
|
String pic = element.select("img").attr("data-original");
|
||||||
String url = element.select("a").attr("href");
|
String url = element.select("a").attr("href");
|
||||||
|
|
@ -138,7 +139,7 @@ public class Supjav extends Spider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String playerContent(String flag, String id, List<String> vipFlags) throws URISyntaxException, IOException {
|
public String playerContent(String flag, String id, List<String> vipFlags) throws URISyntaxException, IOException {
|
||||||
String redirect = OkHttp.getLocation(playUrl + "supjav.php?c=" + new StringBuilder(id).reverse(), getTVVideoHeaders(playUrl + "supjav.php?l=" + new StringBuilder(id) + "&bg=undefined"));
|
String redirect = OkHttp.getLocation(playUrl + "supjav.php?c=" + new StringBuilder(id).reverse(), getTVVideoHeaders(playUrl + "supjav.php?l=" + id + "&bg=undefined"));
|
||||||
switch (flag) {
|
switch (flag) {
|
||||||
case "TV":
|
case "TV":
|
||||||
return parseTV(redirect);
|
return parseTV(redirect);
|
||||||
|
|
@ -155,6 +156,8 @@ public class Supjav extends Spider {
|
||||||
|
|
||||||
private String parseVOE(String redirect) {
|
private String parseVOE(String redirect) {
|
||||||
String data = OkHttp.string(redirect, getTVVideoHeaders(playUrl));
|
String data = OkHttp.string(redirect, getTVVideoHeaders(playUrl));
|
||||||
|
redirect = Util.findByRegex("window.location.href = '(.*?)';", data, 1);
|
||||||
|
data = OkHttp.string(redirect, getTVVideoHeaders(playUrl));
|
||||||
return Result.get().url(Util.findByRegex("prompt\\(\"Node\",(.*?)\\);", data, 1).trim().replace("\"", "")).header(getHeaders(redirect)).string();
|
return Result.get().url(Util.findByRegex("prompt\\(\"Node\",(.*?)\\);", data, 1).trim().replace("\"", "")).header(getHeaders(redirect)).string();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ public class SupjavTest {
|
||||||
|
|
||||||
@org.junit.Test
|
@org.junit.Test
|
||||||
public void searchContent() throws Exception {
|
public void searchContent() throws Exception {
|
||||||
String content = spider.searchContent("红海", false);
|
String content = spider.searchContent("fc", false);
|
||||||
JsonObject map = Json.safeObject(content);
|
JsonObject map = Json.safeObject(content);
|
||||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||||
System.out.println("searchContent--" + gson.toJson(map));
|
System.out.println("searchContent--" + gson.toJson(map));
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
41b2741c6a0b6f61507e3e82dd50f545
|
7131034d727440171f5070e0e32b2464
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "../jar/custom_spider.jar;md5;41b2741c6a0b6f61507e3e82dd50f545",
|
"spider": "../jar/custom_spider.jar;md5;7131034d727440171f5070e0e32b2464",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "直播ipv6",
|
"name": "直播ipv6",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "../jar/custom_spider.jar;md5;41b2741c6a0b6f61507e3e82dd50f545",
|
"spider": "../jar/custom_spider.jar;md5;7131034d727440171f5070e0e32b2464",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "直播ipv6",
|
"name": "直播ipv6",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue