Fix bug
This commit is contained in:
parent
e22068f2bf
commit
567c69bb6f
|
|
@ -93,7 +93,6 @@ public class AliYun {
|
||||||
m3u8MediaMap = new HashMap<>();
|
m3u8MediaMap = new HashMap<>();
|
||||||
shareDownloadMap = new HashMap<>();
|
shareDownloadMap = new HashMap<>();
|
||||||
cache = Cache.objectFrom(Path.read(getCache()));
|
cache = Cache.objectFrom(Path.read(getCache()));
|
||||||
OkHttp.string("http://127.0.0.1:" + Proxy.getPort() + "/go");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRefreshToken(String token) {
|
public void setRefreshToken(String token) {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,10 @@ package com.github.catvod.utils;
|
||||||
import static fi.iki.elonen.NanoHTTPD.Response.Status;
|
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 com.github.catvod.net.OkHttp;
|
import com.github.catvod.net.OkHttp;
|
||||||
|
import com.github.catvod.spider.Proxy;
|
||||||
|
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
@ -14,8 +17,12 @@ import okhttp3.Response;
|
||||||
|
|
||||||
public class ProxyVideo {
|
public class ProxyVideo {
|
||||||
|
|
||||||
|
private static final String GO_SERVER = "http://127.0.0.1:7777/";
|
||||||
|
|
||||||
public static NanoHTTPD.Response multi(String url, Map<String, String> headers, int thread) throws Exception {
|
public static NanoHTTPD.Response multi(String url, Map<String, String> headers, int thread) throws Exception {
|
||||||
return proxy(String.format(Locale.getDefault(), "http://127.0.0.1:7777/?url=%s&thread=%d", URLEncoder.encode(url), thread), headers);
|
if (OkHttp.string(GO_SERVER).isEmpty()) OkHttp.string("http://127.0.0.1:" + Proxy.getPort() + "/go");
|
||||||
|
while (OkHttp.string(GO_SERVER).isEmpty()) SystemClock.sleep(250);
|
||||||
|
return proxy(String.format(Locale.getDefault(), "%s?url=%s&thread=%d", GO_SERVER, URLEncoder.encode(url), thread), headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static NanoHTTPD.Response proxy(String url, Map<String, String> headers) throws Exception {
|
public static NanoHTTPD.Response proxy(String url, Map<String, String> headers) throws Exception {
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
5b3460279d173de4e0288eb56fac596f
|
22534319dabee7086d31f194a1e19e6a
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue