diff --git a/app/src/main/java/com/github/catvod/spider/Push.java b/app/src/main/java/com/github/catvod/spider/Push.java index 0c3d7677..dcfd9348 100644 --- a/app/src/main/java/com/github/catvod/spider/Push.java +++ b/app/src/main/java/com/github/catvod/spider/Push.java @@ -41,6 +41,7 @@ public class Push extends Spider { if (flag.equals("直連")) return Result.get().url(id).subs(getSubs(id)).string(); if (flag.equals("解析")) return Result.get().parse().jx().url(id).string(); if (flag.equals("嗅探")) return Result.get().parse().url(id).string(); + if (flag.equals("迅雷")) return Result.get().url(id).string(); return ali.playerContent(flag, id, vipFlags); } @@ -51,8 +52,10 @@ public class Push extends Spider { vod.setVodName(url.startsWith("file://") ? new File(url).getName() : url); if (url.startsWith("http") && url.contains("#")) url = url.replace("#", "***"); vod.setVodPic("https://pic.rmb.bdstatic.com/bjh/1d0b02d0f57f0a42201f92caba5107ed.jpeg"); - vod.setVodPlayFrom(TextUtils.join("$$$", Arrays.asList("直連", "嗅探", "解析"))); - vod.setVodPlayUrl(TextUtils.join("$$$", Arrays.asList("播放$" + url, "播放$" + url, "播放$" + url))); + String play = "播放$" + url; + boolean thunder = Util.isThunder(url); + vod.setVodPlayUrl(thunder ? play : TextUtils.join("$$$", Arrays.asList(play, play, play))); + vod.setVodPlayFrom(thunder ? "迅雷" : TextUtils.join("$$$", Arrays.asList("直連", "嗅探", "解析"))); return vod; } diff --git a/app/src/main/java/com/github/catvod/utils/Util.java b/app/src/main/java/com/github/catvod/utils/Util.java index 17be2193..0b886b41 100644 --- a/app/src/main/java/com/github/catvod/utils/Util.java +++ b/app/src/main/java/com/github/catvod/utils/Util.java @@ -26,6 +26,7 @@ import java.util.regex.Pattern; 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 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/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 MEDIA = Arrays.asList("mp4", "mkv", "wmv", "flv", "avi", "iso", "mpg", "ts", "mp3", "aac", "flac", "m4a", "ape", "ogg"); @@ -43,6 +44,14 @@ public class Util { return false; } + public static boolean isThunder(String url) { + return THUNDER.matcher(url).find() || isTorrent(url); + } + + public static boolean isTorrent(String url) { + return !url.startsWith("magnet") && url.split(";")[0].endsWith(".torrent"); + } + public static boolean isVideoFormat(String url) { if (url.contains("url=http") || url.contains(".js") || url.contains(".css") || url.contains(".html")) return false; return RULE.matcher(url).find(); diff --git a/jar/custom_spider.jar b/jar/custom_spider.jar index 2206472b..c3bd10af 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 04203bbe..3e1d3ffc 100644 --- a/jar/custom_spider.jar.md5 +++ b/jar/custom_spider.jar.md5 @@ -1 +1 @@ -c9ca7c1293ba0af3ebbf0f84be1d5ba7 +034284ac61c7bc4f5e9acf7937889bb3