MCPcopy Create free account
hub / github.com/FongMi/TV / proxy2

Method proxy2

quickjs/src/main/java/com/fongmi/quickjs/crawler/Spider.java:223–235  ·  view source on GitHub ↗
(Map<String, String> params)

Source from the content-addressed store, hash-verified

221 }
222
223 private Object[] proxy2(Map<String, String> params) throws Exception {
224 String url = params.get("url");
225 String header = params.get("header");
226 JSArray array = submit(() -> JSUtil.toArray(ctx, Arrays.asList(url.split("/")))).get();
227 Object object = submit(() -> ctx.parse(header)).get();
228 String proxy = (String) call("proxy", array, object);
229 Res res = Res.objectFrom(proxy);
230 Object[] result = new Object[3];
231 result[0] = res.getCode();
232 result[1] = res.getContentType();
233 result[2] = res.getStream();
234 return result;
235 }
236
237 private ByteArrayInputStream getStream(Object o, boolean base64) {
238 if (o instanceof byte[]) {

Callers 1

proxyMethod · 0.95

Calls 10

submitMethod · 0.95
toArrayMethod · 0.95
callMethod · 0.95
objectFromMethod · 0.95
getCodeMethod · 0.95
getContentTypeMethod · 0.95
getStreamMethod · 0.95
splitMethod · 0.80
getMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected