Update Push
This commit is contained in:
parent
95201ca99e
commit
df304a4814
|
|
@ -23,18 +23,17 @@ public class Push extends Spider {
|
|||
String url = ids.get(0).trim();
|
||||
if (url.contains("aliyundrive")) return ali.detailContent(ids);
|
||||
if (Misc.isVip(url)) return Result.string(vod(url, "官源"));
|
||||
else if (Misc.isVideoFormat(url)) return Result.string(vod(url, "直連"));
|
||||
else if (url.startsWith("magnet")) return Result.string(vod(url, "磁力"));
|
||||
else if (url.startsWith("http")) return Result.string(vod(url, "網頁"));
|
||||
else return "";
|
||||
if (url.startsWith("magnet")) return Result.string(vod(url, "磁力"));
|
||||
if (url.startsWith("http") && url.endsWith("html")) return Result.string(vod(url, "網頁"));
|
||||
return Result.string(vod(url, "直連"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String playerContent(String flag, String id, List<String> vipFlags) {
|
||||
if (flag.contains("畫")) return ali.playerContent(flag, id);
|
||||
if (flag.equals("官源")) return Result.get().parse().jx().url(id).string();
|
||||
if (flag.equals("直連")) return Result.get().url(id).string();
|
||||
return Result.get().parse().url(id).string();
|
||||
if (flag.equals("網頁")) return Result.get().parse().url(id).string();
|
||||
return Result.get().url(id).string();
|
||||
}
|
||||
|
||||
private Vod vod(String url, String type) {
|
||||
|
|
|
|||
|
|
@ -19,12 +19,10 @@ import java.security.NoSuchAlgorithmException;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class Misc {
|
||||
|
||||
public static final String CHROME = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36";
|
||||
private static final Pattern SNIFFER = Pattern.compile("http((?!http).){20,}?\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg)\\?.*|http((?!http).){20,}\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg)|http((?!http).){20,}?\\/m3u8\\?pt=m3u8.*|http((?!http).)*?default\\.ixigua\\.com\\/.*|http((?!http).)*?cdn-tos[^\\?]*|http((?!http).)*?\\/obj\\/tos[^\\?]*|http.*?\\/player\\/m3u8play\\.php\\?url=.*|http.*?\\/player\\/.*?[pP]lay\\.php\\?url=.*|http.*?\\/playlist\\/m3u8\\/\\?vid=.*|http.*?\\.php\\?type=m3u8&.*|http.*?\\/download.aspx\\?.*|http.*?\\/api\\/up_api.php\\?.*|https.*?\\.66yk\\.cn.*|http((?!http).)*?netease\\.com\\/file\\/.*");
|
||||
|
||||
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");
|
||||
|
|
@ -33,8 +31,8 @@ public class Misc {
|
|||
}
|
||||
|
||||
public static boolean isVideoFormat(String url) {
|
||||
if (url.contains("=http") || url.contains("=https") || url.contains("=https%3a%2f") || url.contains("=http%3a%2f") || url.contains(".js") || url.contains(".css")) return false;
|
||||
return SNIFFER.matcher(url).find();
|
||||
if (url.contains(".js") || url.contains(".css")) return false;
|
||||
return Sniffer.RULE.matcher(url).find();
|
||||
}
|
||||
|
||||
public static boolean isSub(String ext) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
package com.github.catvod.utils;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class Sniffer {
|
||||
|
||||
public static final Pattern RULE = Pattern.compile(
|
||||
"http((?!http).){12,}?\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a)\\?.*|" +
|
||||
"http((?!http).){12,}\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a)|" +
|
||||
"http((?!http).)*?xg.php\\?id=|" +
|
||||
"http((?!http).)*?video/tos*"
|
||||
);
|
||||
}
|
||||
Loading…
Reference in New Issue