|
|
|
|
@ -3,7 +3,6 @@ package com.undcover.freedom.pyramid; |
|
|
|
|
import android.content.Context; |
|
|
|
|
|
|
|
|
|
import com.chaquo.python.PyObject; |
|
|
|
|
import com.github.catvod.Proxy; |
|
|
|
|
import com.github.catvod.utils.Path; |
|
|
|
|
import com.github.catvod.utils.UriUtil; |
|
|
|
|
import com.github.catvod.utils.Util; |
|
|
|
|
@ -72,7 +71,7 @@ public class Spider extends com.github.catvod.crawler.Spider { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String playerContent(String flag, String id, List<String> vipFlags) { |
|
|
|
|
return replaceProxy(app.callAttr("playerContent", obj, flag, id, gson.toJson(vipFlags)).toString()); |
|
|
|
|
return app.callAttr("playerContent", obj, flag, id, gson.toJson(vipFlags)).toString(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@ -108,7 +107,7 @@ public class Spider extends com.github.catvod.crawler.Spider { |
|
|
|
|
if (o.type().toString().contains("bytes")) { |
|
|
|
|
return new ByteArrayInputStream(o.toJava(byte[].class)); |
|
|
|
|
} else { |
|
|
|
|
String content = replaceProxy(o.toString()); |
|
|
|
|
String content = o.toString(); |
|
|
|
|
if (base64 && content.contains("base64,")) content = content.split("base64,")[1]; |
|
|
|
|
return new ByteArrayInputStream(base64 ? Util.decode(content) : content.getBytes()); |
|
|
|
|
} |
|
|
|
|
@ -119,8 +118,4 @@ public class Spider extends com.github.catvod.crawler.Spider { |
|
|
|
|
String url = UriUtil.resolve(api, name); |
|
|
|
|
app.callAttr("download", path, url); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private String replaceProxy(String content) { |
|
|
|
|
return content.replace("http://127.0.0.1:UndCover/proxy", Proxy.getUrl(true)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|