Update subtitle find rule for push

This commit is contained in:
FongMi 2023-06-15 11:42:57 +08:00
parent eabf997ab3
commit 5bc2ea0658
5 changed files with 9 additions and 13 deletions

View File

@ -58,19 +58,15 @@ public class Push extends Ali {
} }
private void setHttpSub(String url, List<Sub> subs) { private void setHttpSub(String url, List<Sub> subs) {
try {
List<String> vodTypes = Arrays.asList("mp4", "mkv"); List<String> vodTypes = Arrays.asList("mp4", "mkv");
List<String> subTypes = Arrays.asList("srt", "ass"); List<String> subTypes = Arrays.asList("srt", "ass");
if (!vodTypes.contains(Utils.getExt(url))) return; if (!vodTypes.contains(Utils.getExt(url))) return;
for (String ext : subTypes) detectSub(url, ext, subs); for (String ext : subTypes) detectSub(url, ext, subs);
} catch (Exception e) {
e.printStackTrace();
}
} }
private void detectSub(String url, String ext, List<Sub> subs) throws Exception { private void detectSub(String url, String ext, List<Sub> subs) {
url = Utils.removeExt(url).concat(".").concat(ext); url = Utils.removeExt(url).concat(".").concat(ext);
if (OkHttp.newCall(url).code() != 200) return; if (OkHttp.string(url).length() > 100) return;
String name = Uri.parse(url).getLastPathSegment(); String name = Uri.parse(url).getLastPathSegment();
subs.add(Sub.create().name(name).ext(ext).url(url)); subs.add(Sub.create().name(name).ext(ext).url(url));
} }

Binary file not shown.

View File

@ -1 +1 @@
690e9c8ef197edeca7d3e9372aadec95 a6934bc36ece4231bc9d2748f96ceaf9

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;690e9c8ef197edeca7d3e9372aadec95", "spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;a6934bc36ece4231bc9d2748f96ceaf9",
"wallpaper": "https://gao.chuqiuyu.tk", "wallpaper": "https://gao.chuqiuyu.tk",
"sites": [ "sites": [
{ {

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;690e9c8ef197edeca7d3e9372aadec95", "spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;a6934bc36ece4231bc9d2748f96ceaf9",
"wallpaper": "http://饭太硬.top/深色壁纸/api.php", "wallpaper": "http://饭太硬.top/深色壁纸/api.php",
"sites": [ "sites": [
{ {