Remove play list for ali

This commit is contained in:
FongMi 2023-07-15 09:52:39 +08:00
parent 5d81bb5377
commit 47872fdaf0
4 changed files with 7 additions and 32 deletions

View File

@ -35,14 +35,6 @@ public class Item {
return new Gson().fromJson(str, Item.class); return new Gson().fromJson(str, Item.class);
} }
public static Item playList(Item copy, String vodPic) {
Item item = new Item();
item.name = "播放列表";
item.path = copy.path;
item.thumb = vodPic;
return item;
}
public static List<Item> arrayFrom(String str) { public static List<Item> arrayFrom(String str) {
Type listType = new TypeToken<List<Item>>() {}.getType(); Type listType = new TypeToken<List<Item>>() {}.getType();
return new Gson().fromJson(str, listType); return new Gson().fromJson(str, listType);

View File

@ -87,7 +87,6 @@ public class AList extends Spider {
fetchRule(); fetchRule();
String type = extend.containsKey("type") ? extend.get("type") : ""; String type = extend.containsKey("type") ? extend.get("type") : "";
String order = extend.containsKey("order") ? extend.get("order") : ""; String order = extend.containsKey("order") ? extend.get("order") : "";
String key = tid.contains("/") ? tid.substring(0, tid.indexOf("/")) : tid;
List<Item> folders = new ArrayList<>(); List<Item> folders = new ArrayList<>();
List<Item> files = new ArrayList<>(); List<Item> files = new ArrayList<>();
List<Vod> list = new ArrayList<>(); List<Vod> list = new ArrayList<>();
@ -101,11 +100,6 @@ public class AList extends Spider {
Sorter.sort(type, order, files); Sorter.sort(type, order, files);
} }
int count = 0;
Drive drive = getDrive(key);
for (Item item : files) if (item.isMedia(drive.isNew())) count++;
if (count > 1) folders.add(0, Item.playList(files.get(0), vodPic));
for (Item item : folders) list.add(item.getVod(tid, vodPic)); for (Item item : folders) list.add(item.getVod(tid, vodPic));
for (Item item : files) list.add(item.getVod(tid, vodPic)); for (Item item : files) list.add(item.getVod(tid, vodPic));
return Result.get().vod(list).page().string(); return Result.get().vod(list).page().string();
@ -115,7 +109,6 @@ public class AList extends Spider {
public String detailContent(List<String> ids) throws Exception { public String detailContent(List<String> ids) throws Exception {
fetchRule(); fetchRule();
String id = ids.get(0); String id = ids.get(0);
boolean list = id.endsWith("播放列表");
String key = id.contains("/") ? id.substring(0, id.indexOf("/")) : id; String key = id.contains("/") ? id.substring(0, id.indexOf("/")) : id;
String path = id.substring(0, id.lastIndexOf("/")); String path = id.substring(0, id.lastIndexOf("/"));
String name = path.substring(path.lastIndexOf("/") + 1); String name = path.substring(path.lastIndexOf("/") + 1);
@ -124,22 +117,12 @@ public class AList extends Spider {
Sorter.sort("name", "asc", parents); Sorter.sort("name", "asc", parents);
Vod vod = new Vod(); Vod vod = new Vod();
vod.setVodPlayFrom(key); vod.setVodPlayFrom(key);
if (list) {
vod.setVodId(id); vod.setVodId(id);
vod.setVodName(name); vod.setVodName(name);
vod.setVodPic(vodPic); vod.setVodPic(vodPic);
List<String> playUrls = new ArrayList<>(); List<String> playUrls = new ArrayList<>();
for (Item item : parents) if (item.isMedia(drive.isNew())) playUrls.add(item.getName() + "$" + item.getVodId(path) + findSubs(path, parents)); for (Item item : parents) if (item.isMedia(drive.isNew())) playUrls.add(item.getName() + "$" + item.getVodId(path) + findSubs(path, parents));
vod.setVodPlayUrl(TextUtils.join("#", playUrls)); vod.setVodPlayUrl(TextUtils.join("#", playUrls));
} else {
Item item = getDetail(id);
vod.setVodId(item.getVodId(id));
vod.setVodName(item.getName());
vod.setVodPic(item.getPic(vodPic));
vod.setVodPlayUrl(item.getName() + "$" + item.getVodId(path) + findSubs(path, parents));
}
return Result.string(vod); return Result.string(vod);
} }

Binary file not shown.

View File

@ -1 +1 @@
ae1463f4584754ef50ab902920ccb7da 942e99b122cf9eb8d0859bbab9994f12