This commit is contained in:
GH Action - Upstream Sync 2023-07-11 12:37:34 +00:00
commit d922b4576c
5 changed files with 7 additions and 58 deletions

View File

@ -32,7 +32,6 @@ public class Push extends Ali {
@Override @Override
public String playerContent(String flag, String id, List<String> vipFlags) { public String playerContent(String flag, String id, List<String> vipFlags) {
if (id.contains("youtube.com")) return Result.get().url(Youtube.fetch(id)).string();
if (flag.equals("直連")) return Result.get().url(id).subs(getSubs(id)).string(); if (flag.equals("直連")) return Result.get().url(id).subs(getSubs(id)).string();
if (flag.equals("嗅探")) return Result.get().parse().url(id).string(); if (flag.equals("嗅探")) return Result.get().parse().url(id).string();
if (flag.equals("解析")) return Result.get().parse().jx().url(id).string(); if (flag.equals("解析")) return Result.get().parse().jx().url(id).string();

View File

@ -1,49 +0,0 @@
package com.github.catvod.spider;
import com.github.catvod.net.OkHttp;
import com.github.catvod.utils.Utils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Youtube {
private static HashMap<String, String> getHeader() {
HashMap<String, String> headers = new HashMap<>();
headers.put("User-Agent", Utils.CHROME);
return headers;
}
public static String fetch(String url) {
try {
String result = OkHttp.string(url, getHeader());
Pattern pattern = Pattern.compile("hlsManifestUrl\\S*?(https\\S*?\\.m3u8)");
Matcher matcher = pattern.matcher(result);
if (!matcher.find()) return "";
String stable = matcher.group(1);
result = OkHttp.string(stable, getHeader());
String quality = find(result);
return quality.isEmpty() ? url : quality;
} catch (Exception e) {
e.printStackTrace();
return url;
}
}
private static String find(String result) {
String url = "";
List<String> items = Arrays.asList("301", "300", "96", "95", "94");
for (String item : items) if (!(url = find(result, "https:/.*/" + item + "/.*index.m3u8")).isEmpty()) break;
return url;
}
private static String find(String result, String rule) {
Pattern pattern = Pattern.compile(rule);
Matcher matcher = pattern.matcher(result);
if (matcher.find()) return matcher.group();
return "";
}
}

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;bdaba6bfae7ce2c142343af8e9731c4d", "spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;bdaba6bfae7ce2c142343af8e9731c4d",
"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;bdaba6bfae7ce2c142343af8e9731c4d", "spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;bdaba6bfae7ce2c142343af8e9731c4d",
"wallpaper": "http://饭太硬.top/深色壁纸/api.php", "wallpaper": "http://饭太硬.top/深色壁纸/api.php",
"sites": [ "sites": [
{ {
@ -17,7 +17,7 @@
"api": "csp_AList", "api": "csp_AList",
"searchable": 1, "searchable": 1,
"changeable": 0, "changeable": 0,
"ext": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/json/alist.json" "ext": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/json/alist.json"
}, },
{ {
"key": "WebDAV", "key": "WebDAV",
@ -26,7 +26,7 @@
"api": "csp_WebDAV", "api": "csp_WebDAV",
"searchable": 1, "searchable": 1,
"changeable": 0, "changeable": 0,
"ext": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/json/webdav.json" "ext": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/json/webdav.json"
}, },
{ {
"key": "哔哩", "key": "哔哩",
@ -63,7 +63,7 @@
"api": "csp_XPathMacFilter", "api": "csp_XPathMacFilter",
"searchable": 1, "searchable": 1,
"changeable": 1, "changeable": 1,
"ext": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/json/duboku.json" "ext": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/json/duboku.json"
}, },
{ {
"key": "傢伙", "key": "傢伙",
@ -289,8 +289,7 @@
"aws.ulivetv.net" "aws.ulivetv.net"
], ],
"regex": [ "regex": [
"#EXT-X-DISCONTINUITY\\r*\\n*#EXTINF:8,[\\s\\S]*?#EXT-X-DISCONTINUITY", "#EXT-X-DISCONTINUITY\\r*\\n*#EXTINF:8,[\\s\\S]*?#EXT-X-DISCONTINUITY"
"#EXT-X-DISCONTINUITY\\r*\\n*#EXTINF:9,[\\s\\S]*?#EXT-X-DISCONTINUITY"
] ]
}, },
{ {

View File

@ -51,7 +51,7 @@ public class Live {
for (Group group : groups) { for (Group group : groups) {
for (Channel channel : group.getChannel()) { for (Channel channel : group.getChannel()) {
channel.number(String.format(Locale.getDefault(), "%03d", ++number)); channel.number(String.format(Locale.getDefault(), "%03d", ++number));
channel.logo("https://ghproxy.com/https://raw.githubusercontent.com/FongMi/TV/release/app/src/main/res/drawable-xxhdpi/ic_img_empty.png"); channel.logo("https://fongmi.cachefly.net/FongMi/TV/release/app/src/main/res/drawable-xxhdpi/ic_img_empty.png");
combine(channel); combine(channel);
} }
} }