mirror of https://github.com/FongMi/TV.git
parent
98b8b37111
commit
28146a7444
@ -0,0 +1,26 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="zh-TW"> |
||||
|
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes"> |
||||
<title>解析</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<div id="container"></div> |
||||
<script> |
||||
const jxs = "%s"; |
||||
const url = "%s"; |
||||
const list = jxs.split(";"); |
||||
const container = document.getElementById('container'); |
||||
list.forEach(item => { |
||||
const iframe = document.createElement('iframe'); |
||||
iframe.src = item + url; |
||||
iframe.sandbox = 'allow-scripts allow-same-origin allow-forms'; |
||||
container.appendChild(iframe); |
||||
}); |
||||
</script> |
||||
</body> |
||||
|
||||
</html> |
||||
@ -0,0 +1,29 @@ |
||||
package com.fongmi.android.tv.server.process; |
||||
|
||||
import com.fongmi.android.tv.server.Nano; |
||||
import com.github.catvod.utils.Asset; |
||||
|
||||
import java.util.Map; |
||||
|
||||
import fi.iki.elonen.NanoHTTPD; |
||||
|
||||
public class Parse implements Process { |
||||
|
||||
@Override |
||||
public boolean isRequest(NanoHTTPD.IHTTPSession session, String path) { |
||||
return "/parse".equals(path); |
||||
} |
||||
|
||||
@Override |
||||
public NanoHTTPD.Response doResponse(NanoHTTPD.IHTTPSession session, String path, Map<String, String> files) { |
||||
try { |
||||
Map<String, String> params = session.getParms(); |
||||
String jxs = params.get("jxs"); |
||||
String url = params.get("url"); |
||||
String html = String.format(Asset.read("parse.html"), jxs, url); |
||||
return NanoHTTPD.newFixedLengthResponse(NanoHTTPD.Response.Status.OK, NanoHTTPD.MIME_HTML, html); |
||||
} catch (Exception e) { |
||||
return Nano.error(e.getMessage()); |
||||
} |
||||
} |
||||
} |
||||
Loading…
Reference in new issue