Fix alist
This commit is contained in:
parent
0eda1e7779
commit
d3b79121bc
|
|
@ -265,9 +265,9 @@ public class AList extends Spider {
|
|||
String[] splits = a.text().split("#");
|
||||
if (!splits[0].contains("/")) continue;
|
||||
int index = splits[0].lastIndexOf("/");
|
||||
boolean folder = splits.length > 1;
|
||||
boolean file = Utils.isMedia(splits[0]);
|
||||
Item item = new Item();
|
||||
item.setType(folder ? 1 : 0);
|
||||
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));
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.github.catvod.spider;
|
|||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Base64;
|
||||
|
||||
import com.github.catvod.bean.Class;
|
||||
import com.github.catvod.bean.Result;
|
||||
import com.github.catvod.bean.Vod;
|
||||
|
|
@ -75,8 +76,8 @@ public class Doll extends Spider {
|
|||
|
||||
@Override
|
||||
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
|
||||
String voteTag = "";
|
||||
String key = "";
|
||||
String voteTag = "";
|
||||
StringBuilder code = new StringBuilder();
|
||||
String html = OkHttp.string(id);
|
||||
Document doc = Jsoup.parse(html);
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public class Local extends Spider {
|
|||
for (File file : files) {
|
||||
if (file.getName().startsWith(".")) continue;
|
||||
if (file.isDirectory()) folders.add(create(file));
|
||||
else if (Utils.MEDIA.contains(Utils.getExt(file.getName()))) media.add(create(file));
|
||||
else if (Utils.isMedia(file.getName())) media.add(create(file));
|
||||
}
|
||||
items.addAll(folders);
|
||||
items.addAll(media);
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ public class WebDAV extends Spider {
|
|||
Sorter.sort("name", "asc", parents);
|
||||
List<String> playUrls = new ArrayList<>();
|
||||
for (DavResource item : parents) {
|
||||
if (Utils.MEDIA.contains(getExt(item))) {
|
||||
if (Utils.isMedia(item.getName())) {
|
||||
playUrls.add(item.getName() + "$" + drive.getName() + item.getPath() + findSubs(drive, item, subs));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,10 +25,11 @@ import java.util.regex.Pattern;
|
|||
|
||||
public class Utils {
|
||||
|
||||
public static final Pattern RULE = Pattern.compile("http((?!http).){12,}?\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a|mp3)\\?.*|http((?!http).){12,}\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a|mp3)|http((?!http).)*?video/tos*");
|
||||
public static final String CHROME = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36";
|
||||
public static final String ACCEPT = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7";
|
||||
public static final List<String> MEDIA = Arrays.asList("mp4", "mkv", "wmv", "flv", "avi", "mp3", "aac", "flac", "m4a", "ape", "ogg");
|
||||
public static final Pattern RULE = Pattern.compile("http((?!http).){12,}?\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a|mp3)\\?.*|" + "http((?!http).){12,}\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a|mp3)|" + "http((?!http).)*?video/tos*");
|
||||
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 boolean isVip(String url) {
|
||||
List<String> hosts = Arrays.asList("iqiyi.com", "v.qq.com", "youku.com", "le.com", "tudou.com", "mgtv.com", "sohu.com", "acfun.cn", "bilibili.com", "baofeng.com", "pptv.com");
|
||||
|
|
@ -59,11 +60,15 @@ public class Utils {
|
|||
}
|
||||
|
||||
public static boolean isSub(String ext) {
|
||||
return ext.equals("srt") || ext.equals("ass") || ext.equals("ssa") || ext.equals("vtt");
|
||||
return SUB.contains(ext);
|
||||
}
|
||||
|
||||
public static boolean isMedia(String text) {
|
||||
return MEDIA.contains(getExt(text));
|
||||
}
|
||||
|
||||
public static String getExt(String name) {
|
||||
return name.substring(name.lastIndexOf(".") + 1);
|
||||
return name.contains(".") ? name.substring(name.lastIndexOf(".") + 1) : name;
|
||||
}
|
||||
|
||||
public static String getSize(double size) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue