diff --git a/app/src/main/java/com/github/catvod/bean/alist/Drive.java b/app/src/main/java/com/github/catvod/bean/alist/Drive.java index f75f1b93..e9ce5009 100644 --- a/app/src/main/java/com/github/catvod/bean/alist/Drive.java +++ b/app/src/main/java/com/github/catvod/bean/alist/Drive.java @@ -48,7 +48,6 @@ public class Drive { } public int getVersion() { - checkVersion(); return version; } @@ -84,8 +83,9 @@ public class Drive { return getServer() + "/search?box=" + param + "&url="; } - private void checkVersion() { - if (version == 0) setVersion(OkHttpUtil.string(settingsApi()).contains("v3.") ? 3 : 2); + public Drive check() { + if (getVersion() == 0) setVersion(OkHttpUtil.string(settingsApi()).contains("v3.") ? 3 : 2); + return this; } @Override diff --git a/app/src/main/java/com/github/catvod/spider/AList.java b/app/src/main/java/com/github/catvod/spider/AList.java index f48bfedb..c3046189 100644 --- a/app/src/main/java/com/github/catvod/spider/AList.java +++ b/app/src/main/java/com/github/catvod/spider/AList.java @@ -48,7 +48,7 @@ public class AList extends Spider { } private Drive getDrive(String name) { - return drives.get(drives.indexOf(new Drive(name))); + return drives.get(drives.indexOf(new Drive(name))).check(); } @Override @@ -119,7 +119,7 @@ public class AList extends Spider { fetchRule(); List list = new ArrayList<>(); CountDownLatch cd = new CountDownLatch(drives.size()); - for (Drive drive : drives) new Thread(() -> search(cd, list, drive, keyword)).start(); + for (Drive drive : drives) new Thread(() -> search(cd, list, drive.check(), keyword)).start(); cd.await(); return Result.string(list); } diff --git a/jar/custom_spider.jar b/jar/custom_spider.jar index 35584670..22d96f57 100644 Binary files a/jar/custom_spider.jar and b/jar/custom_spider.jar differ diff --git a/jar/custom_spider.jar.md5 b/jar/custom_spider.jar.md5 index 179978f8..745615da 100644 --- a/jar/custom_spider.jar.md5 +++ b/jar/custom_spider.jar.md5 @@ -1 +1 @@ -4c2c569b1472f4e040ebc6a2de961864 +5013870b5cce8147c2a877f4da966cf0 diff --git a/json/adult.json b/json/adult.json index 9f908c9f..85fdddf7 100644 --- a/json/adult.json +++ b/json/adult.json @@ -1,5 +1,5 @@ { - "spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;4c2c569b1472f4e040ebc6a2de961864", + "spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;5013870b5cce8147c2a877f4da966cf0", "wallpaper": "https://gao.chuqiuyu.tk", "lives": [ { diff --git a/json/config.json b/json/config.json index ea7fd0f0..c84722dd 100644 --- a/json/config.json +++ b/json/config.json @@ -1,5 +1,5 @@ { - "spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;4c2c569b1472f4e040ebc6a2de961864", + "spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;5013870b5cce8147c2a877f4da966cf0", "wallpaper": "http://www.kf666888.cn/api/tvbox/img", "lives": [ {