This commit is contained in:
GH Action - Upstream Sync 2023-12-18 12:32:28 +00:00
commit f740224dc3
6 changed files with 22 additions and 6 deletions

View File

@ -476,6 +476,7 @@ public class AliYun {
public Object[] proxyVideo(Map<String, String> params) throws Exception { public Object[] proxyVideo(Map<String, String> params) throws Exception {
String templateId = params.get("templateId"); String templateId = params.get("templateId");
String response = params.get("response");
String shareId = params.get("shareId"); String shareId = params.get("shareId");
String mediaId = params.get("mediaId"); String mediaId = params.get("mediaId");
String fileId = params.get("fileId"); String fileId = params.get("fileId");
@ -501,6 +502,7 @@ public class AliYun {
downloadUrl = mediaUrl; downloadUrl = mediaUrl;
} }
if ("url".equals(response)) return new Object[]{200, "text/plain; charset=utf-8", new ByteArrayInputStream(downloadUrl.getBytes("UTF-8"))};
Map<String, String> headers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); Map<String, String> headers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
for (String key : params.keySet()) headers.put(key, params.get(key)); for (String key : params.keySet()) headers.put(key, params.get(key));
headers.remove("do"); headers.remove("do");

View File

@ -4,10 +4,13 @@ import static fi.iki.elonen.NanoHTTPD.Response.Status;
import static fi.iki.elonen.NanoHTTPD.newFixedLengthResponse; import static fi.iki.elonen.NanoHTTPD.newFixedLengthResponse;
import android.os.SystemClock; import android.os.SystemClock;
import android.text.TextUtils;
import com.github.catvod.net.OkHttp; import com.github.catvod.net.OkHttp;
import com.github.catvod.spider.Proxy; import com.github.catvod.spider.Proxy;
import org.json.JSONObject;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
@ -20,12 +23,23 @@ public class ProxyVideo {
private static final String GO_SERVER = "http://127.0.0.1:7777/"; private static final String GO_SERVER = "http://127.0.0.1:7777/";
public static void go() { public static void go() {
if (OkHttp.string(GO_SERVER).isEmpty()) OkHttp.string("http://127.0.0.1:" + Proxy.getPort() + "/go"); boolean close = OkHttp.string(GO_SERVER).isEmpty();
while (OkHttp.string(GO_SERVER).isEmpty()) SystemClock.sleep(20); if (close) OkHttp.string("http://127.0.0.1:" + Proxy.getPort() + "/go");
if (close) while (OkHttp.string(GO_SERVER).isEmpty()) SystemClock.sleep(20);
}
public static String goVer() {
try {
go();
String result = OkHttp.string(GO_SERVER + "version");
return new JSONObject(result).optString("version");
} catch (Exception e) {
return "";
}
} }
public static String url(String url, int thread) { public static String url(String url, int thread) {
go(); if (!TextUtils.isEmpty(goVer()) && url.contains("/proxy?")) url += "&response=url";
return String.format(Locale.getDefault(), "%s?url=%s&thread=%d", GO_SERVER, URLEncoder.encode(url), thread); return String.format(Locale.getDefault(), "%s?url=%s&thread=%d", GO_SERVER, URLEncoder.encode(url), thread);
} }

Binary file not shown.

View File

@ -1 +1 @@
0c59c1b070bb5ea028cd239464653435 d793cc92ea62550b731392d15bacb859

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://fm.t4tv.hz.cz/jar/custom_spider.jar;md5;0c59c1b070bb5ea028cd239464653435", "spider": "https://fm.t4tv.hz.cz/jar/custom_spider.jar;md5;d793cc92ea62550b731392d15bacb859",
"wallpaper": "https://gao.chuqiuyu.workers.dev", "wallpaper": "https://gao.chuqiuyu.workers.dev",
"sites": [ "sites": [
{ {

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://fm.t4tv.hz.cz/jar/custom_spider.jar;md5;0c59c1b070bb5ea028cd239464653435", "spider": "https://fm.t4tv.hz.cz/jar/custom_spider.jar;md5;d793cc92ea62550b731392d15bacb859",
"wallpaper": "http://饭太硬.top/深色壁纸/api.php", "wallpaper": "http://饭太硬.top/深色壁纸/api.php",
"sites": [ "sites": [
{ {