Fix alist

This commit is contained in:
FongMi 2025-03-28 18:40:27 +08:00
parent f9e9b80ba2
commit 286a400573
4 changed files with 16 additions and 6 deletions

View File

@ -129,11 +129,21 @@ public class AList extends Spider {
vod.setVodPic(vodPic); vod.setVodPic(vodPic);
List<String> playUrls = new ArrayList<>(); List<String> playUrls = new ArrayList<>();
List<Item> parents = getList(path, false); List<Item> parents = getList(path, false);
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() + "$" + encodeVodId(item.getVodId(path) + findSubs(path, parents)));
vod.setVodPlayUrl(TextUtils.join("#", playUrls)); vod.setVodPlayUrl(TextUtils.join("#", playUrls));
return Result.string(vod); return Result.string(vod);
} }
private String encodeVodId(String vodId) {
if (vodId.contains("#")) return vodId.replace("#", "***");
return vodId;
}
private String decodeVodId(String vodId) {
if (vodId.contains("***")) return vodId.replace("***", "#");
return vodId;
}
@Override @Override
public String searchContent(String keyword, boolean quick) throws Exception { public String searchContent(String keyword, boolean quick) throws Exception {
fetchRule(); fetchRule();
@ -147,7 +157,7 @@ public class AList extends Spider {
@Override @Override
public String playerContent(String flag, String id, List<String> vipFlags) { public String playerContent(String flag, String id, List<String> vipFlags) {
String[] ids = id.split("~~~"); String[] ids = decodeVodId(id).split("~~~");
String url = getDetail(ids[0]).getUrl(); String url = getDetail(ids[0]).getUrl();
return Result.get().url(url).header(getPlayHeader(url)).subs(getSubs(ids)).string(); return Result.get().url(url).header(getPlayHeader(url)).subs(getSubs(ids)).string();
} }
@ -156,8 +166,8 @@ public class AList extends Spider {
try { try {
Uri uri = Uri.parse(url); Uri uri = Uri.parse(url);
Map<String, String> header = new HashMap<>(); Map<String, String> header = new HashMap<>();
if (uri.getHost().contains("115.com")) header.put("User-Agent", Util.CHROME); if (uri.getHost().contains("115")) header.put("User-Agent", Util.CHROME);
else if (uri.getHost().contains("baidupcs.com")) header.put("User-Agent", "pan.baidu.com"); if (uri.getHost().contains("baidupcs.com")) header.put("User-Agent", "pan.baidu.com");
return header; return header;
} catch (Exception e) { } catch (Exception e) {
return new HashMap<>(); return new HashMap<>();

View File

@ -22,7 +22,7 @@ public class Util {
public static final Pattern RULE = Pattern.compile("http((?!http).){12,}?\\.(m3u8|mp4|mkv|flv|mp3|m4a|aac)\\?.*|http((?!http).){12,}\\.(m3u8|mp4|mkv|flv|mp3|m4a|aac)|http((?!http).)*?video/tos*"); public static final Pattern RULE = Pattern.compile("http((?!http).){12,}?\\.(m3u8|mp4|mkv|flv|mp3|m4a|aac)\\?.*|http((?!http).){12,}\\.(m3u8|mp4|mkv|flv|mp3|m4a|aac)|http((?!http).)*?video/tos*");
public static final Pattern THUNDER = Pattern.compile("(magnet|thunder|ed2k):.*"); public static final Pattern THUNDER = Pattern.compile("(magnet|thunder|ed2k):.*");
public static final String CHROME = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"; public static final String CHROME = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36";
public static final List<String> MEDIA = Arrays.asList("mp4", "mkv", "wmv", "flv", "avi", "iso", "mpg", "ts", "mp3", "aac", "flac", "m4a", "ape", "ogg"); public static final List<String> MEDIA = Arrays.asList("mp4", "mkv", "wmv", "flv", "avi", "iso", "mpg", "ts", "mp3", "aac", "flac", "m4a", "ape", "ogg");
public static final List<String> SUB = Arrays.asList("srt", "ass", "ssa", "vtt"); public static final List<String> SUB = Arrays.asList("srt", "ass", "ssa", "vtt");

Binary file not shown.

View File

@ -1 +1 @@
2f4edf2bed2c6bfc906049428f875e5b 9b46b06c77887786037d2ab277b4b607