pull/496/head
FongMi 2 years ago
parent 05e741ce7f
commit d5871c3324
  1. BIN
      app/src/arm64_v8a/assets/go_proxy_video
  2. BIN
      app/src/armeabi_v7a/assets/go_proxy_video
  3. 25
      app/src/main/java/com/fongmi/android/tv/server/Go.java
  4. 12
      app/src/main/java/com/fongmi/android/tv/server/Nano.java
  5. BIN
      app/src/x86/assets/go_proxy_video

@ -1,25 +0,0 @@
package com.fongmi.android.tv.server;
import com.github.catvod.utils.Asset;
import com.github.catvod.utils.Path;
import com.github.catvod.utils.Shell;
import java.io.File;
public class Go {
private static final String GO = "go_proxy_video";
public static void start() {
new Thread(() -> {
File file = Path.cache(GO);
if (!file.exists()) Path.copy(Asset.open(GO), file);
Shell.exec("killall -9 " + GO);
Shell.exec("nohup " + file);
}).start();
}
public static void stop() {
new Thread(() -> Shell.exec("killall -9 " + GO)).start();
}
}

@ -71,7 +71,6 @@ public class Nano extends NanoHTTPD {
Map<String, String> files = new HashMap<>();
if (session.getMethod() == Method.POST) parse(session, files);
if (url.contains("?")) url = url.substring(0, url.indexOf('?'));
if (url.startsWith("/go")) return go();
if (url.startsWith("/m3u8")) return m3u8(session);
if (url.startsWith("/proxy")) return proxy(session);
if (url.startsWith("/tvbus")) return success(LiveConfig.getResp());
@ -94,11 +93,6 @@ public class Nano extends NanoHTTPD {
}
}
private Response go() {
Go.start();
return success();
}
private Response m3u8(IHTTPSession session) {
String url = session.getParms().get("url");
String result = M3U8.get(url, session.getHeaders());
@ -126,10 +120,4 @@ public class Nano extends NanoHTTPD {
return newFixedLengthResponse(Response.Status.NOT_FOUND, MIME_HTML, null);
}
}
@Override
public void stop() {
super.stop();
Go.stop();
}
}

Binary file not shown.
Loading…
Cancel
Save