Fix torrent

pull/78/head^2
FongMi 2 years ago
parent 47b11e96bc
commit c3faf59813
  1. 7
      app/src/main/java/com/github/catvod/spider/Push.java
  2. 9
      app/src/main/java/com/github/catvod/utils/Util.java
  3. BIN
      jar/custom_spider.jar
  4. 2
      jar/custom_spider.jar.md5

@ -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;
}

@ -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<String> 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();

Binary file not shown.

@ -1 +1 @@
c9ca7c1293ba0af3ebbf0f84be1d5ba7
034284ac61c7bc4f5e9acf7937889bb3

Loading…
Cancel
Save