Merge branch 'main' of https://github.com/FongMi/CatVodSpider
This commit is contained in:
commit
4b594f4cbc
|
|
@ -18,7 +18,6 @@ import com.github.catvod.utils.Utils;
|
|||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
|
@ -26,11 +25,8 @@ import java.util.HashMap;
|
|||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
import okhttp3.Response;
|
||||
|
||||
public class AList extends Spider {
|
||||
|
||||
private List<Drive> drives;
|
||||
|
|
@ -260,20 +256,9 @@ public class AList extends Spider {
|
|||
String[] split = text.split("@@@");
|
||||
String name = split[0];
|
||||
String ext = split[1];
|
||||
String url = Proxy.getUrl() + "?do=alist&url=" + getDetail(split[2]).getUrl();
|
||||
String url = getDetail(split[2]).getUrl();
|
||||
sub.add(Sub.create().name(name).ext(ext).url(url));
|
||||
}
|
||||
return sub;
|
||||
}
|
||||
|
||||
public static Object[] proxy(Map<String, String> params) throws Exception {
|
||||
String url = params.get("url");
|
||||
Response res = OkHttp.newCall(url);
|
||||
byte[] body = Utils.toUtf8(res.body().bytes());
|
||||
Object[] result = new Object[3];
|
||||
result[0] = 200;
|
||||
result[1] = "application/octet-stream";
|
||||
result[2] = new ByteArrayInputStream(body);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -20,8 +20,6 @@ public class Proxy extends Spider {
|
|||
return Ali.proxy(params);
|
||||
case "webdav":
|
||||
return WebDAV.vod(params);
|
||||
case "alist":
|
||||
return AList.proxy(params);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,11 +51,15 @@ public class Utils {
|
|||
return hasCamera && hasPhone && hasBT;
|
||||
}
|
||||
|
||||
public static byte[] toUtf8(byte[] bytes) throws Exception {
|
||||
UniversalDetector detector = new UniversalDetector(null);
|
||||
detector.handleData(bytes, 0, bytes.length);
|
||||
detector.dataEnd();
|
||||
return new String(bytes, detector.getDetectedCharset()).getBytes("UTF-8");
|
||||
public static byte[] toUtf8(byte[] bytes) {
|
||||
try {
|
||||
UniversalDetector detector = new UniversalDetector(null);
|
||||
detector.handleData(bytes, 0, bytes.length);
|
||||
detector.dataEnd();
|
||||
return new String(bytes, detector.getDetectedCharset()).getBytes("UTF-8");
|
||||
} catch (Exception e) {
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isSub(String ext) {
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
bdaba6bfae7ce2c142343af8e9731c4d
|
||||
a28d41c9e6a71040d06dc948cb62a64a
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;bdaba6bfae7ce2c142343af8e9731c4d",
|
||||
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;a28d41c9e6a71040d06dc948cb62a64a",
|
||||
"wallpaper": "https://gao.chuqiuyu.tk",
|
||||
"sites": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;bdaba6bfae7ce2c142343af8e9731c4d",
|
||||
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;a28d41c9e6a71040d06dc948cb62a64a",
|
||||
"wallpaper": "http://饭太硬.top/深色壁纸/api.php",
|
||||
"sites": [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue