Merge branch 'FongMi:main' into main
This commit is contained in:
commit
7e3acb9a0f
|
|
@ -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");
|
||||||
|
|
|
||||||
|
|
@ -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.
|
|
@ -1 +1 @@
|
||||||
0c59c1b070bb5ea028cd239464653435
|
d793cc92ea62550b731392d15bacb859
|
||||||
|
|
|
||||||
|
|
@ -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": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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": [
|
||||||
{
|
{
|
||||||
|
|
@ -418,6 +418,7 @@
|
||||||
"10.3333",
|
"10.3333",
|
||||||
"16.0599",
|
"16.0599",
|
||||||
"8.1748",
|
"8.1748",
|
||||||
|
"12.33",
|
||||||
"10.85"
|
"10.85"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue