diff --git a/app/src/main/java/com/github/catvod/bean/alist/Item.java b/app/src/main/java/com/github/catvod/bean/alist/Item.java index 1e542e5e..9eba79e6 100644 --- a/app/src/main/java/com/github/catvod/bean/alist/Item.java +++ b/app/src/main/java/com/github/catvod/bean/alist/Item.java @@ -35,6 +35,14 @@ public class Item { 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 arrayFrom(String str) { Type listType = new TypeToken>() {}.getType(); return new Gson().fromJson(str, listType); 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 3898e923..af0eb413 100644 --- a/app/src/main/java/com/github/catvod/spider/AList.java +++ b/app/src/main/java/com/github/catvod/spider/AList.java @@ -98,6 +98,9 @@ public class AList extends Spider { Sorter.sort(type, order, folders); Sorter.sort(type, order, files); } + if (files.size() > 1) { + folders.add(0, Item.playList(files.get(0), vodPic)); + } for (Item item : folders) list.add(item.getVod(tid, vodPic)); for (Item item : files) list.add(item.getVod(tid, vodPic)); return Result.get().vod(list).page().string(); @@ -107,18 +110,22 @@ public class AList extends Spider { public String detailContent(List ids) throws Exception { fetchRule(); String id = ids.get(0); + boolean list = id.endsWith("播放列表"); String key = id.contains("/") ? id.substring(0, id.indexOf("/")) : id; String path = id.substring(0, id.lastIndexOf("/")); String name = path.substring(path.lastIndexOf("/") + 1); Drive drive = getDrive(key); + List playUrls = new ArrayList<>(); List parents = getList(path, false); Sorter.sort("name", "asc", parents); - List playUrls = new ArrayList<>(); - for (Item item : parents) { - if (item.isMedia(drive.isNew())) { - playUrls.add(item.getName() + "$" + item.getVodId(path) + findSubs(path, parents)); - } + + if (list) { + for (Item item : parents) if (item.isMedia(drive.isNew())) playUrls.add(item.getName() + "$" + item.getVodId(path) + findSubs(path, parents)); + } else { + Item item = getDetail(id); + playUrls.add(item.getName() + "$" + item.getVodId(path) + findSubs(path, parents)); } + Vod vod = new Vod(); vod.setVodId(id); vod.setVodName(name); diff --git a/jar/custom_spider.jar b/jar/custom_spider.jar index c64868de..a2369241 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 d0a7748d..0be4d426 100644 --- a/jar/custom_spider.jar.md5 +++ b/jar/custom_spider.jar.md5 @@ -1 +1 @@ -a954689c65dff0bf8728a895798bb68a +7871d4d3a51b5b0aa46b079b8104c2be