add - douban 格式12
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
package com.github.catvod.spider;
|
package com.github.catvod.spider;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import com.github.catvod.crawler.Spider;
|
|
||||||
import com.github.catvod.utils.okhttp.OkHttpUtil;
|
import com.github.catvod.utils.okhttp.OkHttpUtil;
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@@ -13,42 +11,18 @@ import org.jsoup.select.Elements;
|
|||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
|
||||||
public class AliPS extends Spider {
|
public class AliPS extends PushAgent {
|
||||||
private PushAgent pushAgent;
|
|
||||||
private static String b = "https://www.alipansou.com";
|
private static String b = "https://www.alipansou.com";
|
||||||
private static Pattern a = Pattern.compile("(https:\\/\\/www.aliyundrive.com\\/s\\/[^\\\"]+)");
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void init(Context context, String extend) {
|
|
||||||
super.init(context, extend);
|
|
||||||
pushAgent = new PushAgent();
|
|
||||||
pushAgent.init(context, extend);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String detailContent(List<String> list) {
|
|
||||||
try {
|
|
||||||
return pushAgent.detailContent(list);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String playerContent(String str, String str2, List<String> list) {
|
|
||||||
return pushAgent.playerContent(str, str2, list);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static HashMap<String, String> sHeaders() {
|
protected static HashMap<String, String> sHeaders() {
|
||||||
HashMap<String, String> headers = new HashMap<>();
|
HashMap<String, String> headers = new HashMap<>();
|
||||||
headers.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.62 Safari/537.36");
|
headers.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.62 Safari/537.36");
|
||||||
|
headers.put("Referer", b);
|
||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +34,7 @@ public class AliPS extends Spider {
|
|||||||
hashMap.put("1", "视频");
|
hashMap.put("1", "视频");
|
||||||
JSONArray jSONArray = new JSONArray();
|
JSONArray jSONArray = new JSONArray();
|
||||||
Iterator entries = hashMap.entrySet().iterator();
|
Iterator entries = hashMap.entrySet().iterator();
|
||||||
String dx = null, pic = "https://inews.gtimg.com/newsapp_bt/0/13263837859/1000", title = "";
|
String dx = null, pic = "https://inews.gtimg.com/newsapp_bt/0/13263837859/1000";
|
||||||
while (entries.hasNext()) {
|
while (entries.hasNext()) {
|
||||||
Map.Entry entry = (Map.Entry) entries.next();
|
Map.Entry entry = (Map.Entry) entries.next();
|
||||||
String sb2 = b + "/search?k=" + URLEncoder.encode(key) + "&t=" + (String) entry.getKey();
|
String sb2 = b + "/search?k=" + URLEncoder.encode(key) + "&t=" + (String) entry.getKey();
|
||||||
@@ -78,7 +52,8 @@ public class AliPS extends Spider {
|
|||||||
if (filename.contains(key)) {
|
if (filename.contains(key)) {
|
||||||
JSONObject v = new JSONObject();
|
JSONObject v = new JSONObject();
|
||||||
String id = b + next.attr("href");
|
String id = b + next.attr("href");
|
||||||
//[视频]第十九集 琉璃世界白雪红梅.mp4 时间: 2021-12-07 格式: mp4 大小: 6.2G
|
filename = filename.trim().replace("\uD83D\uDD25","");
|
||||||
|
String title = filename;
|
||||||
title = filename.replaceAll(" 时间: .*", "");
|
title = filename.replaceAll(" 时间: .*", "");
|
||||||
if (filename.contains("大小")) {
|
if (filename.contains("大小")) {
|
||||||
dx = filename.replaceAll(".*大小: (.*)", "$1");
|
dx = filename.replaceAll(".*大小: (.*)", "$1");
|
||||||
@@ -86,7 +61,7 @@ public class AliPS extends Spider {
|
|||||||
}
|
}
|
||||||
v.put("vod_id", id + "$$$" + pic + "$$$" + title);
|
v.put("vod_id", id + "$$$" + pic + "$$$" + title);
|
||||||
v.put("vod_name", title);
|
v.put("vod_name", title);
|
||||||
v.put("remark", remark);
|
v.put("vod_remark", remark);
|
||||||
v.put("vod_pic", pic);
|
v.put("vod_pic", pic);
|
||||||
jSONArray.put(v);
|
jSONArray.put(v);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,31 +17,18 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
|
||||||
public class Zhaozy extends Spider {
|
public class Zhaozy extends PushAgent {
|
||||||
private PushAgent pushAgent;
|
|
||||||
private static String b = "https://zhaoziyuan.me/";
|
private static String b = "https://zhaoziyuan.me/";
|
||||||
@Override
|
|
||||||
public void init(Context context, String str) {
|
|
||||||
super.init(context, str);
|
|
||||||
pushAgent = new PushAgent();
|
|
||||||
pushAgent.init(context, str);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String detailContent(List<String> list) {
|
|
||||||
try {
|
|
||||||
return pushAgent.detailContent(list);
|
|
||||||
} catch (Exception e) {
|
|
||||||
SpiderDebug.log(e);
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String playerContent(String str, String str2, List<String> list) {
|
|
||||||
return pushAgent.playerContent(str, str2, list);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Pattern regexVid = Pattern.compile("(\\S+)");
|
private Pattern regexVid = Pattern.compile("(\\S+)");
|
||||||
|
|
||||||
|
protected static HashMap<String, String> sHeaders() {
|
||||||
|
HashMap<String, String> headers = new HashMap<>();
|
||||||
|
headers.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.62 Safari/537.36");
|
||||||
|
headers.put("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9");
|
||||||
|
headers.put("Accept-encoding", "gzip, deflate, br");
|
||||||
|
headers.put("Accept-language", "zh-SG,zh;q=0.9,en-GB;q=0.8,en;q=0.7,zh-CN;q=0.6");
|
||||||
|
return headers;
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public String searchContent(String key, boolean quick) {
|
public String searchContent(String key, boolean quick) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user