pull/69/head
FongMi 3 years ago
parent e80fac6d50
commit 3ac9f333d6
  1. 15
      app/src/main/java/com/github/catvod/spider/Push.java
  2. BIN
      jar/custom_spider.jar
  3. 2
      jar/custom_spider.jar.md5

@ -59,22 +59,21 @@ public class Push extends Ali {
private void setHttpSub(String url, List<Sub> subs) {
try {
String ext = Utils.getExt(url);
if (!ext.equals("mp4") && !ext.equals("mkv")) return;
List<String> types = Arrays.asList(".srt", ".ass");
for (String type : types) detectSub(Utils.removeExt(url).concat(type), subs);
List<String> vodTypes = Arrays.asList("mp4", "mkv");
List<String> subTypes = Arrays.asList("srt", "ass");
if (!vodTypes.contains(Utils.getExt(url))) return;
for (String ext : subTypes) detectSub(url, ext, subs);
} catch (Exception e) {
e.printStackTrace();
}
}
private void detectSub(String url, List<Sub> subs) throws Exception {
if (OkHttp.newCall(url).code() == 200) {
String ext = Utils.getExt(url);
private void detectSub(String url, String ext, List<Sub> subs) throws Exception {
url = Utils.removeExt(url).concat(".").concat(ext);
if (OkHttp.newCall(url).code() != 200) return;
String name = Uri.parse(url).getLastPathSegment();
subs.add(Sub.create().name(name).ext(ext).url(url));
}
}
private void setFileSub(String url, List<Sub> subs) {
File file = new File(url.replace("file://", ""));

Binary file not shown.

@ -1 +1 @@
d0ac4c362ded4782f74f467bfa3420be
d02ea3eb2cda4c0a98f3758125eb667e

Loading…
Cancel
Save