修复Alist小雅搜索不能播放问题
This commit is contained in:
parent
bc3c6ed2ce
commit
05147ad369
|
|
@ -262,16 +262,15 @@ public class AList extends Spider {
|
||||||
List<Vod> list = new ArrayList<>();
|
List<Vod> list = new ArrayList<>();
|
||||||
Document doc = Jsoup.parse(OkHttp.string(drive.searchApi(keyword)));
|
Document doc = Jsoup.parse(OkHttp.string(drive.searchApi(keyword)));
|
||||||
for (Element a : doc.select("ul > a")) {
|
for (Element a : doc.select("ul > a")) {
|
||||||
String[] splits = a.text().split("#");
|
String text = a.text();
|
||||||
if (!splits[0].contains("/")) continue;
|
String regex = ".*\\.(dff|dsf|mp3|aac|wav|wma|cda|flac|m4a|mid|mka|mp2|mpa|mpc|ape|ofr|ogg|ra|wv|tta|ac3|dts|tak|webm|wmv|mpeg|mov|ram|swf|mp4|avi|rm|rmvb|flv|mpg|mkv|m3u8|ts|3gp|asf)$";
|
||||||
int index = splits[0].lastIndexOf("/");
|
boolean file = text.matches(regex);
|
||||||
boolean folder = splits.length > 1;
|
|
||||||
Item item = new Item();
|
Item item = new Item();
|
||||||
item.setType(folder ? 1 : 0);
|
int index = text.lastIndexOf("/");
|
||||||
item.setThumb(splits.length > 3 ? splits[4] : "");
|
if (index == -1) continue;
|
||||||
item.setPath("/" + splits[0].substring(0, index));
|
item.setName(text);
|
||||||
item.setName(splits[0].substring(index + 1));
|
item.setType(file ? 0 : 1);
|
||||||
list.add(item.getVod(drive, vodPic));
|
list.add(item.getVod(drive,drive.getVodPic()));
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue