This commit is contained in:
parent
f4a0dea73a
commit
dca75a316b
|
|
@ -13,6 +13,7 @@ import com.github.catvod.utils.gZip;
|
||||||
import com.github.catvod.utils.okhttp.OKCallBack;
|
import com.github.catvod.utils.okhttp.OKCallBack;
|
||||||
import com.github.catvod.utils.okhttp.OkHttpUtil;
|
import com.github.catvod.utils.okhttp.OkHttpUtil;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
@ -44,8 +45,8 @@ import okhttp3.Response;
|
||||||
public class Bdys01 extends Spider {
|
public class Bdys01 extends Spider {
|
||||||
private static final String siteUrl = "https://www.bdys01.com";
|
private static final String siteUrl = "https://www.bdys01.com";
|
||||||
private static final String siteHost = "www.bdys01.com";
|
private static final String siteHost = "www.bdys01.com";
|
||||||
private String cookie="";
|
private String cookie = "";
|
||||||
private String referer="";
|
private String referer = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 筛选配置
|
* 筛选配置
|
||||||
|
|
@ -69,15 +70,15 @@ public class Bdys01 extends Spider {
|
||||||
* @param url
|
* @param url
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected HashMap<String, String> getHeaders(String url,String ref) {
|
protected HashMap<String, String> getHeaders(String url, String ref) {
|
||||||
HashMap<String, String> headers = new HashMap<>();
|
HashMap<String, String> headers = new HashMap<>();
|
||||||
headers.put("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36");
|
headers.put("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36");
|
||||||
if(!ref.equals("google")){
|
if (!ref.equals("google")) {
|
||||||
headers.put("Authority", "www.bdys01.com");
|
headers.put("Authority", "www.bdys01.com");
|
||||||
if(ref.length()>0){
|
if (ref.length() > 0) {
|
||||||
headers.put("Referer", ref);
|
headers.put("Referer", ref);
|
||||||
}
|
}
|
||||||
if(cookie.length()>0){
|
if (cookie.length() > 0) {
|
||||||
headers.put("Cookie", cookie);
|
headers.put("Cookie", cookie);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -87,7 +88,7 @@ public class Bdys01 extends Spider {
|
||||||
|
|
||||||
protected HashMap<String, String> getHeaders2(String url) {
|
protected HashMap<String, String> getHeaders2(String url) {
|
||||||
HashMap<String, String> headers = new HashMap<>();
|
HashMap<String, String> headers = new HashMap<>();
|
||||||
String ss = url.replace("https://","").split("/")[0];
|
String ss = url.replace("https://", "").split("/")[0];
|
||||||
headers.put("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36");
|
headers.put("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36");
|
||||||
headers.put("Authority", ss);
|
headers.put("Authority", ss);
|
||||||
headers.put("Origin", "www.bdys01.com");
|
headers.put("Origin", "www.bdys01.com");
|
||||||
|
|
@ -96,12 +97,12 @@ public class Bdys01 extends Spider {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected String getCookie(){
|
protected String getCookie() {
|
||||||
cookie="";
|
cookie = "";
|
||||||
String cookieurl="https://www.bdys01.com/zzzzz";
|
String cookieurl = "https://www.bdys01.com/zzzzz";
|
||||||
Map<String, List<String>> respHeaders = new HashMap<>();
|
Map<String, List<String>> respHeaders = new HashMap<>();
|
||||||
OkHttpUtil.stringNoRedirect(cookieurl, getHeaders(cookieurl,referer), respHeaders);
|
OkHttpUtil.stringNoRedirect(cookieurl, getHeaders(cookieurl, referer), respHeaders);
|
||||||
if(respHeaders.containsKey("set-cookie")){
|
if (respHeaders.containsKey("set-cookie")) {
|
||||||
cookie = respHeaders.get("set-cookie").get(0).split(";")[0];
|
cookie = respHeaders.get("set-cookie").get(0).split(";")[0];
|
||||||
}
|
}
|
||||||
return cookie;
|
return cookie;
|
||||||
|
|
@ -116,17 +117,17 @@ public class Bdys01 extends Spider {
|
||||||
@Override
|
@Override
|
||||||
public String homeContent(boolean filter) {
|
public String homeContent(boolean filter) {
|
||||||
try {
|
try {
|
||||||
Document doc = Jsoup.parse(OkHttpUtil.string(siteUrl, getHeaders(siteUrl,referer)));
|
Document doc = Jsoup.parse(OkHttpUtil.string(siteUrl, getHeaders(siteUrl, referer)));
|
||||||
referer=siteUrl+"/";
|
referer = siteUrl + "/";
|
||||||
// 分类节点
|
// 分类节点
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
JSONArray classes = new JSONArray();
|
JSONArray classes = new JSONArray();
|
||||||
String catestr ="{\"全部\": \"a\",\"电视剧\": \"1\",\"电影\": \"0\"}";
|
String catestr = "{\"全部\": \"a\",\"电视剧\": \"1\",\"电影\": \"0\"}";
|
||||||
JSONObject catedef = new JSONObject(catestr);
|
JSONObject catedef = new JSONObject(catestr);
|
||||||
Iterator it = catedef.keys();
|
Iterator it = catedef.keys();
|
||||||
while(it.hasNext()){
|
while (it.hasNext()) {
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
String key =(String) it.next();
|
String key = (String) it.next();
|
||||||
jsonObject.put("type_name", key);
|
jsonObject.put("type_name", key);
|
||||||
jsonObject.put("type_id", catedef.getString(key));
|
jsonObject.put("type_id", catedef.getString(key));
|
||||||
classes.put(jsonObject);
|
classes.put(jsonObject);
|
||||||
|
|
@ -143,9 +144,9 @@ public class Bdys01 extends Spider {
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
Element vod = list.get(i);
|
Element vod = list.get(i);
|
||||||
String title = vod.selectFirst("h3.card-title").text();
|
String title = vod.selectFirst("h3.card-title").text();
|
||||||
String cover = vod.selectFirst("img.w-100" ).attr("data-src");
|
String cover = vod.selectFirst("img.w-100").attr("data-src");
|
||||||
String remark = vod.selectFirst("p.text-muted").text();
|
String remark = vod.selectFirst("p.text-muted").text();
|
||||||
String id =vod.selectFirst("a.d-block.cover").attr("href");
|
String id = vod.selectFirst("a.d-block.cover").attr("href");
|
||||||
JSONObject v = new JSONObject();
|
JSONObject v = new JSONObject();
|
||||||
v.put("vod_id", id);
|
v.put("vod_id", id);
|
||||||
v.put("vod_name", title);
|
v.put("vod_name", title);
|
||||||
|
|
@ -177,23 +178,23 @@ public class Bdys01 extends Spider {
|
||||||
@Override
|
@Override
|
||||||
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) {
|
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) {
|
||||||
try {
|
try {
|
||||||
SpiderDebug.log("Bdys01>>categoryContent"+ filter+"tid:"+tid+"extend:"+extend.toString());
|
SpiderDebug.log("Bdys01>>categoryContent" + filter + "tid:" + tid + "extend:" + extend.toString());
|
||||||
String url = siteUrl + "/s/" ;
|
String url = siteUrl + "/s/";
|
||||||
if (extend != null && extend.size() > 0 ) {
|
if (extend != null && extend.size() > 0) {
|
||||||
String urlformat= "";
|
String urlformat = "";
|
||||||
if(tid.equals("a")){
|
if (tid.equals("a")) {
|
||||||
urlformat= url +"{s}/"+ pg +"?&area={area}&year={year}&order={order}";
|
urlformat = url + "{s}/" + pg + "?&area={area}&year={year}&order={order}";
|
||||||
}else {
|
} else {
|
||||||
urlformat= url +"{s}/"+ pg +"?&type="+tid+"&area={area}&year={year}&order={order}";
|
urlformat = url + "{s}/" + pg + "?&type=" + tid + "&area={area}&year={year}&order={order}";
|
||||||
}
|
}
|
||||||
for (Iterator<String> it = extend.keySet().iterator(); it.hasNext(); ) {
|
for (Iterator<String> it = extend.keySet().iterator(); it.hasNext(); ) {
|
||||||
String key = it.next();
|
String key = it.next();
|
||||||
String value = extend.get(key);
|
String value = extend.get(key);
|
||||||
if (value.length() > 0) {
|
if (value.length() > 0) {
|
||||||
urlformat=urlformat.replace("{"+key+"}",URLEncoder.encode(value));
|
urlformat = urlformat.replace("{" + key + "}", URLEncoder.encode(value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i=0 ;i<4;i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
if (urlformat.contains("{s}")) {
|
if (urlformat.contains("{s}")) {
|
||||||
urlformat = urlformat.replace("{s}", "all");
|
urlformat = urlformat.replace("{s}", "all");
|
||||||
} else if (urlformat.contains("{area}")) {
|
} else if (urlformat.contains("{area}")) {
|
||||||
|
|
@ -205,16 +206,16 @@ public class Bdys01 extends Spider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
url = urlformat;
|
url = urlformat;
|
||||||
SpiderDebug.log("Bdys01>>categoryContent"+"url:"+url);
|
SpiderDebug.log("Bdys01>>categoryContent" + "url:" + url);
|
||||||
} else {
|
} else {
|
||||||
if(tid.equals("a")){
|
if (tid.equals("a")) {
|
||||||
url += "all/" + pg + "?&order=0";
|
url += "all/" + pg + "?&order=0";
|
||||||
}else {
|
} else {
|
||||||
url += "all/" + pg + "?&type=" + tid + "&order=0";
|
url += "all/" + pg + "?&type=" + tid + "&order=0";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
referer=siteUrl+"/";
|
referer = siteUrl + "/";
|
||||||
String html = OkHttpUtil.string(url, getHeaders(url,referer));
|
String html = OkHttpUtil.string(url, getHeaders(url, referer));
|
||||||
referer = url;
|
referer = url;
|
||||||
Document doc = Jsoup.parse(html);
|
Document doc = Jsoup.parse(html);
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
|
|
@ -229,16 +230,16 @@ public class Bdys01 extends Spider {
|
||||||
Element a = pageInfo.get(i);
|
Element a = pageInfo.get(i);
|
||||||
String name = a.text();
|
String name = a.text();
|
||||||
if (name.equals("尾页")) {
|
if (name.equals("尾页")) {
|
||||||
String gg =a.attr("href");
|
String gg = a.attr("href");
|
||||||
String hf ="";
|
String hf = "";
|
||||||
if(gg.contains("JSESSIONID")){
|
if (gg.contains("JSESSIONID")) {
|
||||||
int start = gg.lastIndexOf("/")+1;
|
int start = gg.lastIndexOf("/") + 1;
|
||||||
int end = gg.indexOf(";");
|
int end = gg.indexOf(";");
|
||||||
hf =gg.substring(start,end);
|
hf = gg.substring(start, end);
|
||||||
}else{
|
} else {
|
||||||
int start = gg.lastIndexOf("/")+1;
|
int start = gg.lastIndexOf("/") + 1;
|
||||||
int end = gg.indexOf("?");
|
int end = gg.indexOf("?");
|
||||||
hf =gg.substring(start,end);
|
hf = gg.substring(start, end);
|
||||||
}
|
}
|
||||||
if (!hf.isEmpty()) {
|
if (!hf.isEmpty()) {
|
||||||
pageCount = Integer.parseInt(hf);
|
pageCount = Integer.parseInt(hf);
|
||||||
|
|
@ -257,14 +258,21 @@ public class Bdys01 extends Spider {
|
||||||
Element vod = list.get(i);
|
Element vod = list.get(i);
|
||||||
String title = vod.selectFirst("h3.mb-0").text();
|
String title = vod.selectFirst("h3.mb-0").text();
|
||||||
String cover = vod.selectFirst("img.w-100").attr("src");
|
String cover = vod.selectFirst("img.w-100").attr("src");
|
||||||
String remark = vod.selectFirst("p.mb-0").text();
|
String score = vod.selectFirst("div.ribbon") == null ? "" : vod.selectFirst("div.ribbon").text();
|
||||||
|
String remark;
|
||||||
|
if (!StringUtils.isBlank(score)) {
|
||||||
|
remark = score + (vod.selectFirst("span.badge") == null ? "" : vod.selectFirst("span.badge").text());
|
||||||
|
} else {
|
||||||
|
remark = vod.selectFirst("span.badge") == null ? "" : vod.selectFirst("span.badge").text();
|
||||||
|
}
|
||||||
|
|
||||||
String idtt = vod.selectFirst("a.d-block").attr("href");
|
String idtt = vod.selectFirst("a.d-block").attr("href");
|
||||||
String id ="";
|
String id = "";
|
||||||
if(idtt.contains("JSESSIONID")) {
|
if (idtt.contains("JSESSIONID")) {
|
||||||
int end = idtt.indexOf(";");
|
int end = idtt.indexOf(";");
|
||||||
id = idtt.substring(0,end);
|
id = idtt.substring(0, end);
|
||||||
}else{
|
} else {
|
||||||
id =idtt;
|
id = idtt;
|
||||||
}
|
}
|
||||||
JSONObject v = new JSONObject();
|
JSONObject v = new JSONObject();
|
||||||
v.put("vod_id", id);
|
v.put("vod_id", id);
|
||||||
|
|
@ -296,14 +304,14 @@ public class Bdys01 extends Spider {
|
||||||
public String detailContent(List<String> ids) {
|
public String detailContent(List<String> ids) {
|
||||||
try {
|
try {
|
||||||
String url = siteUrl + ids.get(0);
|
String url = siteUrl + ids.get(0);
|
||||||
Document doc = Jsoup.parse(OkHttpUtil.string(url, getHeaders(url,referer)));
|
Document doc = Jsoup.parse(OkHttpUtil.string(url, getHeaders(url, referer)));
|
||||||
referer=url;
|
referer = url;
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
JSONObject vodList = new JSONObject();
|
JSONObject vodList = new JSONObject();
|
||||||
String cover = doc.selectFirst("div.col-md-auto img").attr("src");
|
String cover = doc.selectFirst("div.col-md-auto img").attr("src");
|
||||||
String title = doc.selectFirst("h1.d-none.d-md-block").text();
|
String title = doc.selectFirst("h1.d-none.d-md-block").text();
|
||||||
String desc = doc.select("div.card.collapse > div.card-body").text();
|
String desc = doc.select("div.card.collapse > div.card-body").text();
|
||||||
String year = doc.select("span.badge.bg-purple-lt").text().replace("更新时间:","").split("-")[0];
|
String year = doc.select("span.badge.bg-purple-lt").text().replace("更新时间:", "").split("-")[0];
|
||||||
String category = "", area = "", remark = "", director = "", actor = "";
|
String category = "", area = "", remark = "", director = "", actor = "";
|
||||||
Element details = doc.select("div.col.mb-2").get(0);
|
Element details = doc.select("div.col.mb-2").get(0);
|
||||||
Elements allp = details.select("p");
|
Elements allp = details.select("p");
|
||||||
|
|
@ -316,13 +324,13 @@ public class Bdys01 extends Spider {
|
||||||
for (int j = 0; j < aa.size(); j++) {
|
for (int j = 0; j < aa.size(); j++) {
|
||||||
categorys.add(aa.get(j).text());
|
categorys.add(aa.get(j).text());
|
||||||
}
|
}
|
||||||
category ="类型:"+TextUtils.join(",", categorys);
|
category = "类型:" + TextUtils.join(",", categorys);
|
||||||
} else if (info.contains("地区")) {
|
} else if (info.contains("地区")) {
|
||||||
int start= text.text().indexOf("[")+1;
|
int start = text.text().indexOf("[") + 1;
|
||||||
int end = text.text().indexOf("]");
|
int end = text.text().indexOf("]");
|
||||||
area = text.text().substring(start,end);
|
area = text.text().substring(start, end);
|
||||||
} else if (info.contains("豆瓣")) {
|
} else if (info.contains("豆瓣")) {
|
||||||
remark = "豆瓣:"+text.text();
|
remark = "豆瓣:" + text.text();
|
||||||
} else if (info.contains("导演:")) {
|
} else if (info.contains("导演:")) {
|
||||||
director = text.selectFirst("a").text();
|
director = text.selectFirst("a").text();
|
||||||
} else if (info.contains("主演:")) {
|
} else if (info.contains("主演:")) {
|
||||||
|
|
@ -331,7 +339,7 @@ public class Bdys01 extends Spider {
|
||||||
for (int j = 0; j < aa.size(); j++) {
|
for (int j = 0; j < aa.size(); j++) {
|
||||||
actors.add(aa.get(j).text());
|
actors.add(aa.get(j).text());
|
||||||
}
|
}
|
||||||
actor =TextUtils.join(",", actors);
|
actor = TextUtils.join(",", actors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String vid = ids.get(0);
|
String vid = ids.get(0);
|
||||||
|
|
@ -354,12 +362,12 @@ public class Bdys01 extends Spider {
|
||||||
for (int j = 0; j < playListA.size(); j++) {
|
for (int j = 0; j < playListA.size(); j++) {
|
||||||
Element vod = playListA.get(j);
|
Element vod = playListA.get(j);
|
||||||
String idtt = vod.attr("href");
|
String idtt = vod.attr("href");
|
||||||
String playURL ="";
|
String playURL = "";
|
||||||
if(idtt.contains("JSESSIONID")) {
|
if (idtt.contains("JSESSIONID")) {
|
||||||
int end = idtt.indexOf(";");
|
int end = idtt.indexOf(";");
|
||||||
playURL = idtt.substring(0,end);
|
playURL = idtt.substring(0, end);
|
||||||
}else{
|
} else {
|
||||||
playURL =idtt;
|
playURL = idtt;
|
||||||
}
|
}
|
||||||
vodItems.add(vod.text() + "$" + playURL);
|
vodItems.add(vod.text() + "$" + playURL);
|
||||||
}
|
}
|
||||||
|
|
@ -394,50 +402,50 @@ public class Bdys01 extends Spider {
|
||||||
@Override
|
@Override
|
||||||
public String playerContent(String flag, String id, List<String> vipFlags) {
|
public String playerContent(String flag, String id, List<String> vipFlags) {
|
||||||
try {
|
try {
|
||||||
String url = siteUrl + id ;
|
String url = siteUrl + id;
|
||||||
String htmlplay = OkHttpUtil.string(url, getHeaders(url,referer));
|
String htmlplay = OkHttpUtil.string(url, getHeaders(url, referer));
|
||||||
Document doc = Jsoup.parse(htmlplay);
|
Document doc = Jsoup.parse(htmlplay);
|
||||||
Elements allScript = doc.select("script");
|
Elements allScript = doc.select("script");
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
String pid="";
|
String pid = "";
|
||||||
for (int i = 0; i < allScript.size(); i++) {
|
for (int i = 0; i < allScript.size(); i++) {
|
||||||
String scContent = allScript.get(i).toString();
|
String scContent = allScript.get(i).toString();
|
||||||
if (scContent.contains("var pid =")) {
|
if (scContent.contains("var pid =")) {
|
||||||
int start = scContent.indexOf("var pid =");
|
int start = scContent.indexOf("var pid =");
|
||||||
int end = scContent.lastIndexOf("var time") + 1;
|
int end = scContent.lastIndexOf("var time") + 1;
|
||||||
String pidtmp = scContent.substring(start, end);
|
String pidtmp = scContent.substring(start, end);
|
||||||
start = pidtmp.indexOf("=")+2;
|
start = pidtmp.indexOf("=") + 2;
|
||||||
end = pidtmp.lastIndexOf(";") ;
|
end = pidtmp.lastIndexOf(";");
|
||||||
pid = pidtmp.substring(start, end);
|
pid = pidtmp.substring(start, end);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
long t = System.currentTimeMillis();
|
long t = System.currentTimeMillis();
|
||||||
String key = Misc.NewMD5(pid+"-"+t, StandardCharsets.UTF_8).substring(0,16);
|
String key = Misc.NewMD5(pid + "-" + t, StandardCharsets.UTF_8).substring(0, 16);
|
||||||
String sg = encrypt(pid+"-"+t,key);
|
String sg = encrypt(pid + "-" + t, key);
|
||||||
String geturl = siteUrl+"/lines?t="+t+"&sg="+sg+"&pid="+pid;
|
String geturl = siteUrl + "/lines?t=" + t + "&sg=" + sg + "&pid=" + pid;
|
||||||
String urlsrc = OkHttpUtil.string(geturl, getHeaders(geturl,""));
|
String urlsrc = OkHttpUtil.string(geturl, getHeaders(geturl, ""));
|
||||||
JSONObject urlsrcobj = new JSONObject(urlsrc);
|
JSONObject urlsrcobj = new JSONObject(urlsrc);
|
||||||
JSONObject urldb = urlsrcobj.getJSONObject("data");
|
JSONObject urldb = urlsrcobj.getJSONObject("data");
|
||||||
List <String> urldblist = new ArrayList<>();
|
List<String> urldblist = new ArrayList<>();
|
||||||
if(!urldb.isNull("url3")){
|
if (!urldb.isNull("url3")) {
|
||||||
String url3 = urldb.optString("url3");
|
String url3 = urldb.optString("url3");
|
||||||
urldblist.add(url3);
|
urldblist.add(url3);
|
||||||
}
|
}
|
||||||
if(!urldb.isNull("m3u8")){
|
if (!urldb.isNull("m3u8")) {
|
||||||
String m3u8 = urldb.optString("m3u8").replace("www.bde4.cc","www.bdys01.com");
|
String m3u8 = urldb.optString("m3u8").replace("www.bde4.cc", "www.bdys01.com");
|
||||||
urldblist.add(m3u8);
|
urldblist.add(m3u8);
|
||||||
}
|
}
|
||||||
if(!urldb.isNull("m3u8_2")){
|
if (!urldb.isNull("m3u8_2")) {
|
||||||
String m3u8_2 =urldb.optString("m3u8_2");
|
String m3u8_2 = urldb.optString("m3u8_2");
|
||||||
String[] m2=m3u8_2.split(",");
|
String[] m2 = m3u8_2.split(",");
|
||||||
for(int i=0; i< m2.length ;i++){
|
for (int i = 0; i < m2.length; i++) {
|
||||||
urldblist.add(m2[i].replace("www.bde4.cc","www.bdys01.com"));
|
urldblist.add(m2[i].replace("www.bde4.cc", "www.bdys01.com"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int index =new Random().nextInt(urldblist.size());
|
int index = new Random().nextInt(urldblist.size());
|
||||||
String videourl = urldblist.get(index);
|
String videourl = urldblist.get(index);
|
||||||
if(videourl.contains("mp4")){
|
if (videourl.contains("mp4")) {
|
||||||
result.put("parse", 0);
|
result.put("parse", 0);
|
||||||
result.put("playUrl", "");
|
result.put("playUrl", "");
|
||||||
result.put("url", videourl);
|
result.put("url", videourl);
|
||||||
|
|
@ -445,13 +453,14 @@ public class Bdys01 extends Spider {
|
||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
Map<String, List<String>> respHeaders = new HashMap<>();
|
Map<String, List<String>> respHeaders = new HashMap<>();
|
||||||
OkHttpUtil.stringNoRedirect(videourl, getHeaders(videourl,""), respHeaders);
|
OkHttpUtil.stringNoRedirect(videourl, getHeaders(videourl, ""), respHeaders);
|
||||||
String redirect = OkHttpUtil.getRedirectLocation(respHeaders);
|
String redirect = OkHttpUtil.getRedirectLocation(respHeaders);
|
||||||
String realm3u8="";
|
String realm3u8 = "";
|
||||||
OKCallBack.OKCallBackDefault callBack = new OKCallBack.OKCallBackDefault() {
|
OKCallBack.OKCallBackDefault callBack = new OKCallBack.OKCallBackDefault() {
|
||||||
@Override
|
@Override
|
||||||
protected void onFailure(Call call, Exception e) {
|
protected void onFailure(Call call, Exception e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResponse(Response response) {
|
protected void onResponse(Response response) {
|
||||||
}
|
}
|
||||||
|
|
@ -468,20 +477,20 @@ public class Bdys01 extends Spider {
|
||||||
buffer.flush();
|
buffer.flush();
|
||||||
byte[] targetArray = buffer.toByteArray();
|
byte[] targetArray = buffer.toByteArray();
|
||||||
picsrc.close();
|
picsrc.close();
|
||||||
byte[] dep = Arrays.copyOfRange(targetArray,3354,targetArray.length);
|
byte[] dep = Arrays.copyOfRange(targetArray, 3354, targetArray.length);
|
||||||
String pp = gZip.KS(dep);
|
String pp = gZip.KS(dep);
|
||||||
String[] m3u8ori = pp.split("\n");
|
String[] m3u8ori = pp.split("\n");
|
||||||
for(int i=0;i<m3u8ori.length;i++){
|
for (int i = 0; i < m3u8ori.length; i++) {
|
||||||
String mt= m3u8ori[i];
|
String mt = m3u8ori[i];
|
||||||
if(mt.contains(".ts")){
|
if (mt.contains(".ts")) {
|
||||||
mt="https://vod.bdys.me/"+mt;
|
mt = "https://vod.bdys.me/" + mt;
|
||||||
m3u8ori[i]=mt;
|
m3u8ori[i] = mt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
realm3u8= TextUtils.join("\n",m3u8ori);
|
realm3u8 = TextUtils.join("\n", m3u8ori);
|
||||||
}
|
}
|
||||||
String realm3u8b64=Base64.encodeToString(realm3u8.getBytes(), 2);
|
String realm3u8b64 = Base64.encodeToString(realm3u8.getBytes(), 2);
|
||||||
result.put("url", "data:application/vnd.apple.mpegurl;base64,"+realm3u8b64);
|
result.put("url", "data:application/vnd.apple.mpegurl;base64," + realm3u8b64);
|
||||||
result.put("parse", 0);
|
result.put("parse", 0);
|
||||||
result.put("playUrl", "");
|
result.put("playUrl", "");
|
||||||
result.put("header", new JSONObject(getHeaders2("https://vod.bdys.me/")).toString());
|
result.put("header", new JSONObject(getHeaders2("https://vod.bdys.me/")).toString());
|
||||||
|
|
@ -495,27 +504,27 @@ public class Bdys01 extends Spider {
|
||||||
@Override
|
@Override
|
||||||
public String searchContent(String key, boolean quick) {
|
public String searchContent(String key, boolean quick) {
|
||||||
try {
|
try {
|
||||||
SpiderDebug.log("Bdys01>>searchContent"+"key:"+key);
|
SpiderDebug.log("Bdys01>>searchContent" + "key:" + key);
|
||||||
String url = "https://www.google.com/search?q=site%3A" + siteHost + "+" + URLEncoder.encode(key);
|
String url = "https://www.google.com/search?q=site%3A" + siteHost + "+" + URLEncoder.encode(key);
|
||||||
Document doc = Jsoup.parse(OkHttpUtil.string(url,getHeaders(url,"google")));
|
Document doc = Jsoup.parse(OkHttpUtil.string(url, getHeaders(url, "google")));
|
||||||
SpiderDebug.log("Bdys01>>searchContent"+"url:"+url);
|
SpiderDebug.log("Bdys01>>searchContent" + "url:" + url);
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
JSONArray videos = new JSONArray();
|
JSONArray videos = new JSONArray();
|
||||||
Elements sourceList = doc.select("div.yuRUbf a");
|
Elements sourceList = doc.select("div.yuRUbf a");
|
||||||
if(sourceList.size()>0){
|
if (sourceList.size() > 0) {
|
||||||
for (int i = 0; i < 1; i++) {
|
for (int i = 0; i < 1; i++) {
|
||||||
Element sourcess = sourceList.get(i);
|
Element sourcess = sourceList.get(i);
|
||||||
String sourceName = sourcess.select("h3.LC20lb.MBeuO.DKV0Md").text();
|
String sourceName = sourcess.select("h3.LC20lb.MBeuO.DKV0Md").text();
|
||||||
String list1 = sourcess.attr("href");
|
String list1 = sourcess.attr("href");
|
||||||
if(list1.contains("/s/")||list1.contains("play")||list1.contains("performer")||list1.contains("search")||list1.contains("jsessionid")){
|
if (list1.contains("/s/") || list1.contains("play") || list1.contains("performer") || list1.contains("search") || list1.contains("jsessionid")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (sourceName.contains(key)) {
|
if (sourceName.contains(key)) {
|
||||||
Document ddrklink = Jsoup.parse(OkHttpUtil.string(list1, getHeaders(list1,referer)));
|
Document ddrklink = Jsoup.parse(OkHttpUtil.string(list1, getHeaders(list1, referer)));
|
||||||
JSONObject v = new JSONObject();
|
JSONObject v = new JSONObject();
|
||||||
String cover = ddrklink.selectFirst("div.col-md-auto img").attr("src");
|
String cover = ddrklink.selectFirst("div.col-md-auto img").attr("src");
|
||||||
String title = ddrklink.selectFirst("h2.d-sm-block.d-md-none").text();
|
String title = ddrklink.selectFirst("h2.d-sm-block.d-md-none").text();
|
||||||
String id =list1.replace("https://www.bdys01.com","");
|
String id = list1.replace("https://www.bdys01.com", "");
|
||||||
v.put("vod_name", title);
|
v.put("vod_name", title);
|
||||||
v.put("vod_remarks", "");
|
v.put("vod_remarks", "");
|
||||||
v.put("vod_id", id);
|
v.put("vod_id", id);
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
5e220cf193c6aba87a838f1113035a91
|
20bc02ea99492835f495a8482c57b9a3
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "./custom_spider.jar;md5;638431aca0811c206acecc9a383dbc7c",
|
"spider": "./custom_spider.jar;md5;2fd40534e2fc612371265778d3e1195b",
|
||||||
"wallpaper": "http://www.kf666888.cn/api/tvbox/img",
|
"wallpaper": "http://www.kf666888.cn/api/tvbox/img",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
638431aca0811c206acecc9a383dbc7c
|
fd809b4f30918ec33ce29260642d4f42
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue