Update jar
This commit is contained in:
parent
da7300b1c4
commit
055f3e7148
|
|
@ -40,7 +40,7 @@ import java.util.regex.Pattern;
|
||||||
*/
|
*/
|
||||||
public class Ali {
|
public class Ali {
|
||||||
|
|
||||||
private final Pattern pattern = Pattern.compile("www.aliyundrive.com/s/([^/]+)(/folder/([^/]+))?");
|
public static final Pattern pattern = Pattern.compile("www.aliyundrive.com/s/([^/]+)(/folder/([^/]+))?");
|
||||||
private ScheduledExecutorService service;
|
private ScheduledExecutorService service;
|
||||||
private final Auth auth;
|
private final Auth auth;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ public class PanSou extends Spider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String detailContent(List<String> ids) throws Exception {
|
public String detailContent(List<String> ids) throws Exception {
|
||||||
|
if (Ali.pattern.matcher(ids.get(0)).find()) return Ali.get().detailContent(ids);
|
||||||
String url = siteUrl + ids.get(0).replace("/s/", "/cv/");
|
String url = siteUrl + ids.get(0).replace("/s/", "/cv/");
|
||||||
Map<String, List<String>> respHeaders = new HashMap<>();
|
Map<String, List<String>> respHeaders = new HashMap<>();
|
||||||
OkHttp.stringNoRedirect(url, getHeaders(ids.get(0)), respHeaders);
|
OkHttp.stringNoRedirect(url, getHeaders(ids.get(0)), respHeaders);
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,13 @@ import com.github.catvod.crawler.Spider;
|
||||||
import com.github.catvod.net.OkHttp;
|
import com.github.catvod.net.OkHttp;
|
||||||
import com.github.catvod.utils.Misc;
|
import com.github.catvod.utils.Misc;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
|
||||||
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.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -55,30 +54,20 @@ public class Zhaozy extends Spider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Context context, String extend) {
|
public void init(Context context, String extend) {
|
||||||
String strs[] = extend.split("\\$\\$\\$");
|
String[] split = extend.split("\\$\\$\\$");
|
||||||
String url = strs[0];
|
Ali.get().init(split[0]);
|
||||||
if (strs.length > 2) {
|
if (split.length > 2) {
|
||||||
username = strs[1];
|
username = split[1];
|
||||||
password = strs[2];
|
password = split[2];
|
||||||
}
|
}
|
||||||
Ali.get().init(url);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String detailContent(List<String> ids) throws Exception {
|
public String detailContent(List<String> ids) throws Exception {
|
||||||
|
if (Ali.pattern.matcher(ids.get(0)).find()) return Ali.get().detailContent(ids);
|
||||||
Matcher matcher = regexAli.matcher(OkHttp.string(siteUrl + ids.get(0), getHeader()));
|
Matcher matcher = regexAli.matcher(OkHttp.string(siteUrl + ids.get(0), getHeader()));
|
||||||
if (!matcher.find()) return "";
|
if (matcher.find()) return Ali.get().detailContent(Arrays.asList(matcher.group(1)));
|
||||||
String videoId = ids.get(0);
|
return "";
|
||||||
ids.set(0, matcher.group(1));
|
|
||||||
String json = Ali.get().detailContent(ids);
|
|
||||||
if ("".equals(json)){
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
JSONObject result = new JSONObject(json);
|
|
||||||
JSONArray jsonList = result.getJSONArray("list");
|
|
||||||
JSONObject jsonObject = jsonList.getJSONObject(0);
|
|
||||||
jsonObject.put("vod_id",videoId);
|
|
||||||
return result.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
a84fef826cb82da525469e8acf1e7d9a
|
d5d77424e72a6ade93621611b1114875
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue