Fix for openList
This commit is contained in:
parent
c5e03f6cbf
commit
6c4f7ca4a7
|
|
@ -111,6 +111,10 @@ public class Item {
|
|||
}
|
||||
|
||||
public String getVodId(String id) {
|
||||
return id + "/" + getName();
|
||||
}
|
||||
|
||||
public String getVodPath(String id) {
|
||||
return id + getPath() + "/" + getName();
|
||||
}
|
||||
|
||||
|
|
@ -127,6 +131,6 @@ public class Item {
|
|||
}
|
||||
|
||||
public Vod getVod(Drive drive) {
|
||||
return new Vod(getVodId(drive.getName()), getName(), getPic(), drive.getName(), isFolder());
|
||||
return new Vod(getVodPath(drive.getName()), getName(), getPic(), drive.getName(), isFolder());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,6 @@ import com.github.catvod.net.OkHttp;
|
|||
import com.github.catvod.utils.Util;
|
||||
|
||||
import org.json.JSONObject;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.nodes.Element;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
|
@ -270,29 +267,6 @@ public class AList extends Spider {
|
|||
|
||||
@Override
|
||||
public List<Vod> call() {
|
||||
List<Vod> alist = alist();
|
||||
return !alist.isEmpty() ? alist : xiaoya();
|
||||
}
|
||||
|
||||
private List<Vod> xiaoya() {
|
||||
List<Vod> list = new ArrayList<>();
|
||||
Document doc = Jsoup.parse(OkHttp.string(drive.searchApi(keyword)));
|
||||
for (Element a : doc.select("ul > a")) {
|
||||
String[] splits = a.text().split("#");
|
||||
if (!splits[0].contains("/")) continue;
|
||||
int index = splits[0].lastIndexOf("/");
|
||||
boolean file = Util.isMedia(splits[0]);
|
||||
Item item = new Item();
|
||||
item.setType(file ? 0 : 1);
|
||||
item.setThumb(splits.length > 3 ? splits[4] : "");
|
||||
item.setPath("/" + splits[0].substring(0, index));
|
||||
item.setName(splits[0].substring(index + 1));
|
||||
list.add(item.getVod(drive));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private List<Vod> alist() {
|
||||
try {
|
||||
List<Vod> list = new ArrayList<>();
|
||||
String response = post(drive, drive.searchApi(), drive.params(keyword));
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
9126aa90a41b25415d66a7fa572c92bc
|
||||
b9bdfaa2a27f0f64a0053f7f3d193c29
|
||||
|
|
|
|||
Loading…
Reference in New Issue