Fix alist

This commit is contained in:
FongMi 2022-11-30 23:15:24 +08:00
parent c132521e09
commit fbce8f209a
5 changed files with 10 additions and 6 deletions

View File

@ -47,12 +47,16 @@ public class AList extends Spider {
drives = Drive.objectFrom(ext).getDrives();
}
private Drive getDrive(String name) {
Drive drive = drives.get(drives.indexOf(new Drive(name)));
private Drive checkVersion(Drive drive) {
if (drive.getVersion() == 0) drive.setVersion(OkHttpUtil.string(drive.settingsApi()).contains("v3.") ? 3 : 2);
return drive;
}
private Drive getDrive(String name) {
Drive drive = drives.get(drives.indexOf(new Drive(name)));
return checkVersion(drive);
}
@Override
public void init(Context context, String extend) {
try {
@ -121,7 +125,7 @@ public class AList extends Spider {
fetchRule();
List<Vod> 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, checkVersion(drive), keyword)).start();
cd.await();
return Result.string(list);
}

Binary file not shown.

View File

@ -1 +1 @@
aa1aaf2c71abcb2b2da5db8301c1e3da
4c2c569b1472f4e040ebc6a2de961864

View File

@ -1,5 +1,5 @@
{
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;aa1aaf2c71abcb2b2da5db8301c1e3da",
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;4c2c569b1472f4e040ebc6a2de961864",
"wallpaper": "https://gao.chuqiuyu.tk",
"lives": [
{

View File

@ -1,5 +1,5 @@
{
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;aa1aaf2c71abcb2b2da5db8301c1e3da",
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;4c2c569b1472f4e040ebc6a2de961864",
"wallpaper": "http://www.kf666888.cn/api/tvbox/img",
"lives": [
{