uc test
This commit is contained in:
parent
f054ef4159
commit
1483f5181f
|
|
@ -58,6 +58,8 @@ public class UCApi {
|
||||||
|
|
||||||
public Object[] proxyVideo(Map<String, String> params) throws Exception {
|
public Object[] proxyVideo(Map<String, String> params) throws Exception {
|
||||||
String url = Util.base64Decode(params.get("url"));
|
String url = Util.base64Decode(params.get("url"));
|
||||||
|
SpiderDebug.log("proxy url :" + url);
|
||||||
|
SpiderDebug.log("proxy header :" + Util.base64Decode(params.get("header")));
|
||||||
Map header = new Gson().fromJson(Util.base64Decode(params.get("header")), Map.class);
|
Map header = new Gson().fromJson(Util.base64Decode(params.get("header")), Map.class);
|
||||||
if (header == null) header = new HashMap<>();
|
if (header == null) header = new HashMap<>();
|
||||||
List<String> arr = List.of("Range", "Accept", "Accept-Encoding", "Accept-Language", "Cookie", "Origin", "Referer", "Sec-Ch-Ua", "Sec-Ch-Ua-Mobile", "Sec-Ch-Ua-Platform", "Sec-Fetch-Dest", "Sec-Fetch-Mode", "Sec-Fetch-Site", "User-Agent");
|
List<String> arr = List.of("Range", "Accept", "Accept-Encoding", "Accept-Language", "Cookie", "Origin", "Referer", "Sec-Ch-Ua", "Sec-Ch-Ua-Mobile", "Sec-Ch-Ua-Platform", "Sec-Fetch-Dest", "Sec-Fetch-Mode", "Sec-Fetch-Site", "User-Agent");
|
||||||
|
|
@ -83,7 +85,7 @@ public class UCApi {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Object[] getM3u8(String url, Map header) {
|
private Object[] getM3u8(String url, Map header) {
|
||||||
|
SpiderDebug.log("m3u8 url :" + url);
|
||||||
OkResult result = OkHttp.get(url, new HashMap<>(), header);
|
OkResult result = OkHttp.get(url, new HashMap<>(), header);
|
||||||
String[] m3u8Arr = result.getBody().split("\n");
|
String[] m3u8Arr = result.getBody().split("\n");
|
||||||
List<String> listM3u8 = new ArrayList<>();
|
List<String> listM3u8 = new ArrayList<>();
|
||||||
|
|
@ -92,9 +94,13 @@ public class UCApi {
|
||||||
int mediaId = 0;
|
int mediaId = 0;
|
||||||
for (String oneLine : m3u8Arr) {
|
for (String oneLine : m3u8Arr) {
|
||||||
String thisOne = oneLine;
|
String thisOne = oneLine;
|
||||||
|
|
||||||
if (oneLine.contains(".ts")) {
|
if (oneLine.contains(".ts")) {
|
||||||
thisOne = proxyVideoUrl(site + thisOne, header);
|
|
||||||
mediaId++;
|
mediaId++;
|
||||||
|
thisOne = proxyVideoUrl(site + thisOne, header);
|
||||||
|
SpiderDebug.log("m3u8 line " + mediaId + ":" + oneLine);
|
||||||
|
SpiderDebug.log("m3u8 proxyed line " + mediaId + " :" + thisOne);
|
||||||
|
|
||||||
}
|
}
|
||||||
listM3u8.add(thisOne);
|
listM3u8.add(thisOne);
|
||||||
}
|
}
|
||||||
|
|
@ -141,7 +147,7 @@ public class UCApi {
|
||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initQuark(String cookie) throws Exception {
|
public void initUc(String cookie) throws Exception {
|
||||||
this.ckey = Util.MD5(cookie);
|
this.ckey = Util.MD5(cookie);
|
||||||
this.cookie = cookie;
|
this.cookie = cookie;
|
||||||
this.isVip = getVip();
|
this.isVip = getVip();
|
||||||
|
|
@ -192,12 +198,12 @@ public class UCApi {
|
||||||
vod.setVodName("");
|
vod.setVodName("");
|
||||||
vod.setVodPlayUrl(TextUtils.join("$$$", playUrl));
|
vod.setVodPlayUrl(TextUtils.join("$$$", playUrl));
|
||||||
vod.setVodPlayFrom(TextUtils.join("$$$", playFrom));
|
vod.setVodPlayFrom(TextUtils.join("$$$", playFrom));
|
||||||
vod.setTypeName("夸克云盘");
|
vod.setTypeName("uc云盘");
|
||||||
return vod;
|
return vod;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String playerContent(String[] split, String flag) throws Exception {
|
public String playerContent(String[] split, String flag) throws Exception {
|
||||||
|
SpiderDebug.log("flag:" + flag);
|
||||||
String fileId = split[0], fileToken = split[1], shareId = split[2], stoken = split[3];
|
String fileId = split[0], fileToken = split[1], shareId = split[2], stoken = split[3];
|
||||||
String playUrl = "";
|
String playUrl = "";
|
||||||
if (flag.contains("uc原画")) {
|
if (flag.contains("uc原画")) {
|
||||||
|
|
@ -205,6 +211,7 @@ public class UCApi {
|
||||||
} else {
|
} else {
|
||||||
playUrl = this.getLiveTranscoding(shareId, stoken, fileId, fileToken, flag);
|
playUrl = this.getLiveTranscoding(shareId, stoken, fileId, fileToken, flag);
|
||||||
}
|
}
|
||||||
|
SpiderDebug.log("origin playUrl:" + playUrl);
|
||||||
Map<String, String> header = getHeaders();
|
Map<String, String> header = getHeaders();
|
||||||
header.remove("Host");
|
header.remove("Host");
|
||||||
header.remove("Content-Type");
|
header.remove("Content-Type");
|
||||||
|
|
@ -269,8 +276,8 @@ public class UCApi {
|
||||||
}
|
}
|
||||||
//获取到cookie,初始化uc,并且把cookie缓存一次
|
//获取到cookie,初始化uc,并且把cookie缓存一次
|
||||||
if (StringUtils.isNoneBlank(cookie) && cookie.contains("__pus")) {
|
if (StringUtils.isNoneBlank(cookie) && cookie.contains("__pus")) {
|
||||||
SpiderDebug.log(" initQuark ...");
|
SpiderDebug.log(" initUc ...");
|
||||||
initQuark(this.cookie);
|
initUc(this.cookie);
|
||||||
cache.setUser(User.objectFrom(this.cookie));
|
cache.setUser(User.objectFrom(this.cookie));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -294,7 +301,7 @@ public class UCApi {
|
||||||
|
|
||||||
cache.setUser(User.objectFrom(this.cookie));
|
cache.setUser(User.objectFrom(this.cookie));
|
||||||
if (cache.getUser().getCookie().isEmpty()) throw new Exception(this.cookie);
|
if (cache.getUser().getCookie().isEmpty()) throw new Exception(this.cookie);
|
||||||
initQuark(this.cookie);
|
initUc(this.cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -317,7 +324,7 @@ public class UCApi {
|
||||||
params.put("client_id", "381");
|
params.put("client_id", "381");
|
||||||
params.put("v", "1.2");
|
params.put("v", "1.2");
|
||||||
params.put("request_id", UUID.randomUUID().toString());
|
params.put("request_id", UUID.randomUUID().toString());
|
||||||
OkResult res = OkHttp.post("https://api.open.uc.cn/cas/ajax/getTokenForQrcodeLogin?__dt="+ RandomUtils.nextInt(1000,100000) +"&__t="+new Date().getTime(), params, new HashMap<>());
|
OkResult res = OkHttp.post("https://api.open.uc.cn/cas/ajax/getTokenForQrcodeLogin?__dt=" + RandomUtils.nextInt(1000, 100000) + "&__t=" + new Date().getTime(), params, new HashMap<>());
|
||||||
if (this.cookie.isEmpty()) {
|
if (this.cookie.isEmpty()) {
|
||||||
List<String> cookies = res.getResp().get("set-Cookie");
|
List<String> cookies = res.getResp().get("set-Cookie");
|
||||||
List<String> cookieList = new ArrayList<>();
|
List<String> cookieList = new ArrayList<>();
|
||||||
|
|
@ -348,19 +355,122 @@ public class UCApi {
|
||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void startFlow() {
|
||||||
|
Init.run(this::showInput);
|
||||||
|
}
|
||||||
|
|
||||||
public ShareData getShareData(String url) {
|
private void showInput() {
|
||||||
Pattern pattern = Pattern.compile("https://pan\\.quark\\.cn/s/([^\\\\|#/]+)");
|
try {
|
||||||
Matcher matcher = pattern.matcher(url);
|
int margin = ResUtil.dp2px(16);
|
||||||
if (matcher.find()) {
|
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
return new ShareData(matcher.group(1), "0");
|
FrameLayout frame = new FrameLayout(Init.context());
|
||||||
|
params.setMargins(margin, margin, margin, margin);
|
||||||
|
EditText input = new EditText(Init.context());
|
||||||
|
frame.addView(input, params);
|
||||||
|
dialog = new AlertDialog.Builder(Init.getActivity()).setTitle("请输入UC cookie").setView(frame).setNeutralButton("QRCode", (dialog, which) -> onNeutral()).setNegativeButton(android.R.string.cancel, null).setPositiveButton(android.R.string.ok, (dialog, which) -> onPositive(input.getText().toString())).show();
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onNeutral() {
|
||||||
|
dismiss();
|
||||||
|
Init.execute(this::getQRCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onPositive(String text) {
|
||||||
|
dismiss();
|
||||||
|
Init.execute(() -> {
|
||||||
|
if (text.startsWith("http")) setToken(OkHttp.string(text));
|
||||||
|
else setToken(text);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getQRCode() {
|
||||||
|
String token = getQrCodeToken();
|
||||||
|
|
||||||
|
Init.run(() -> openApp(token));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openApp(String token) {
|
||||||
|
try {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||||
|
intent.setClassName("com.alicloud.databox", "com.taobao.login4android.scan.QrScanActivity");
|
||||||
|
intent.putExtra("key_scanParam", token);
|
||||||
|
Init.getActivity().startActivity(intent);
|
||||||
|
} catch (Exception e) {
|
||||||
|
showQRCode("https://su.uc.cn/1_n0ZCv?uc_param_str=dsdnfrpfbivesscpgimibtbmnijblauputogpintnwktprchmt&token=" + token + "&client_id=381&uc_biz_str=S%3Acustom%7CC%3Atitlebar_fix");
|
||||||
|
} finally {
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
|
map.put("token", token);
|
||||||
|
Init.execute(() -> startService(map));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showQRCode(String content) {
|
||||||
|
try {
|
||||||
|
int size = ResUtil.dp2px(240);
|
||||||
|
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(size, size);
|
||||||
|
ImageView image = new ImageView(Init.context());
|
||||||
|
image.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||||
|
image.setImageBitmap(QRCode.getBitmap(content, size, 2));
|
||||||
|
FrameLayout frame = new FrameLayout(Init.context());
|
||||||
|
params.gravity = Gravity.CENTER;
|
||||||
|
frame.addView(image, params);
|
||||||
|
dialog = new AlertDialog.Builder(Init.getActivity()).setView(frame).setOnCancelListener(this::dismiss).setOnDismissListener(this::dismiss).show();
|
||||||
|
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
Notify.show("请使用uc网盘App扫描二维码");
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startService(Map<String, String> params) {
|
||||||
|
SpiderDebug.log("----startservice");
|
||||||
|
params.put("client_id", "381");
|
||||||
|
params.put("v", "1.2");
|
||||||
|
params.put("request_id", UUID.randomUUID().toString());
|
||||||
|
service = Executors.newScheduledThreadPool(1);
|
||||||
|
|
||||||
|
service.scheduleWithFixedDelay(() -> {
|
||||||
|
SpiderDebug.log("----scheduleAtFixedRate" + new Date().toString());
|
||||||
|
String result = OkHttp.string("https://api.open.uc.cn/cas/ajax/getServiceTicketByQrcodeToken?__dt=" + RandomUtils.nextInt(1000, 100000) + "&__t=" + new Date().getTime(), params, getWebHeaders());
|
||||||
|
Map<String, Object> json = Json.parseSafe(result, Map.class);
|
||||||
|
if (json.get("status").equals(new Double(2000000))) {
|
||||||
|
setToken((String) ((Map<String, Object>) ((Map<String, Object>) json.get("data")).get("members")).get("service_ticket"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}, 1, 3, TimeUnit.SECONDS);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setToken(String value) {
|
||||||
|
this.serviceTicket = value;
|
||||||
|
SpiderDebug.log("ServiceTicket:" + value);
|
||||||
|
Notify.show("ServiceTicket:" + value);
|
||||||
|
initUserInfo();
|
||||||
|
stopService();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void stopService() {
|
||||||
|
if (service != null) service.shutdownNow();
|
||||||
|
|
||||||
|
|
||||||
|
Init.run(this::dismiss);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dismiss(DialogInterface dialog) {
|
||||||
|
stopService();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dismiss() {
|
||||||
|
try {
|
||||||
|
if (dialog != null) dialog.dismiss();
|
||||||
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean getVip() throws Exception {
|
private boolean getVip() throws Exception {
|
||||||
Map<String, Object> listData = Json.parseSafe(api("member?pr=ucpro&fr=pc&uc_param_str=&fetch_subscribe=true&_ch=home&fetch_identity=true", null, null, 0, "GET"), Map.class);
|
Map<String, Object> listData = Json.parseSafe(api("member?pr=ucpro&fr=pc&uc_param_str=&fetch_subscribe=true&_ch=home&fetch_identity=true", null, null, 0, "GET"), Map.class);
|
||||||
return ((Map<String, String>) listData.get("data")).get("member_type").contains("VIP");
|
return false;//((Map<String, String>) listData.get("data")).get("member_type").contains("VIP");
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getPlayFormatList() {
|
public List<String> getPlayFormatList() {
|
||||||
|
|
@ -371,7 +481,7 @@ public class UCApi {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String> getPlayFormatQuarkList() {
|
private List<String> getPlayFormatUcList() {
|
||||||
if (this.isVip) {
|
if (this.isVip) {
|
||||||
return Arrays.asList("4k", "2k", "super", "high", "normal", "low");
|
return Arrays.asList("4k", "2k", "super", "high", "normal", "low");
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -379,6 +489,16 @@ public class UCApi {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ShareData getShareData(String url) {
|
||||||
|
Pattern pattern = Pattern.compile("https://drive\\.uc\\.cn/s/([^?]+)");
|
||||||
|
Matcher matcher = pattern.matcher(url);
|
||||||
|
if (matcher.find()) {
|
||||||
|
return new ShareData(matcher.group(1), "0");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void getShareToken(ShareData shareData) throws Exception {
|
private void getShareToken(ShareData shareData) throws Exception {
|
||||||
if (!this.shareTokenCache.containsKey(shareData.getShareId())) {
|
if (!this.shareTokenCache.containsKey(shareData.getShareId())) {
|
||||||
this.shareTokenCache.remove(shareData.getShareId());
|
this.shareTokenCache.remove(shareData.getShareId());
|
||||||
|
|
@ -536,9 +656,9 @@ public class UCApi {
|
||||||
if (transcoding.get("data") != null && ((Map<Object, Object>) transcoding.get("data")).get("video_list") != null) {
|
if (transcoding.get("data") != null && ((Map<Object, Object>) transcoding.get("data")).get("video_list") != null) {
|
||||||
String flagId = flag.split("-")[flag.split("-").length - 1];
|
String flagId = flag.split("-")[flag.split("-").length - 1];
|
||||||
int index = Util.findAllIndexes(getPlayFormatList(), flagId);
|
int index = Util.findAllIndexes(getPlayFormatList(), flagId);
|
||||||
String quarkFormat = getPlayFormatQuarkList().get(index);
|
String ucFormat = getPlayFormatUcList().get(index);
|
||||||
for (Map<String, Object> video : (List<Map<String, Object>>) ((Map<Object, Object>) transcoding.get("data")).get("video_list")) {
|
for (Map<String, Object> video : (List<Map<String, Object>>) ((Map<Object, Object>) transcoding.get("data")).get("video_list")) {
|
||||||
if (video.get("resolution").equals(quarkFormat)) {
|
if (video.get("resolution").equals(ucFormat)) {
|
||||||
return (String) ((Map<String, Object>) video.get("video_info")).get("url");
|
return (String) ((Map<String, Object>) video.get("video_info")).get("url");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -578,118 +698,6 @@ public class UCApi {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startFlow() {
|
|
||||||
Init.run(this::showInput);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void showInput() {
|
|
||||||
try {
|
|
||||||
int margin = ResUtil.dp2px(16);
|
|
||||||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
|
||||||
FrameLayout frame = new FrameLayout(Init.context());
|
|
||||||
params.setMargins(margin, margin, margin, margin);
|
|
||||||
EditText input = new EditText(Init.context());
|
|
||||||
frame.addView(input, params);
|
|
||||||
dialog = new AlertDialog.Builder(Init.getActivity()).setTitle("请输入cookie").setView(frame).setNeutralButton("QRCode", (dialog, which) -> onNeutral()).setNegativeButton(android.R.string.cancel, null).setPositiveButton(android.R.string.ok, (dialog, which) -> onPositive(input.getText().toString())).show();
|
|
||||||
} catch (Exception ignored) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onNeutral() {
|
|
||||||
dismiss();
|
|
||||||
Init.execute(this::getQRCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onPositive(String text) {
|
|
||||||
dismiss();
|
|
||||||
Init.execute(() -> {
|
|
||||||
if (text.startsWith("http")) setToken(OkHttp.string(text));
|
|
||||||
else setToken(text);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void getQRCode() {
|
|
||||||
String token = getQrCodeToken();
|
|
||||||
|
|
||||||
Init.run(() -> openApp(token));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void openApp(String token) {
|
|
||||||
try {
|
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
|
||||||
intent.setClassName("com.alicloud.databox", "com.taobao.login4android.scan.QrScanActivity");
|
|
||||||
intent.putExtra("key_scanParam", token);
|
|
||||||
Init.getActivity().startActivity(intent);
|
|
||||||
} catch (Exception e) {
|
|
||||||
showQRCode("https://su.uc.cn/1_n0ZCv?uc_param_str=dsdnfrpfbivesscpgimibtbmnijblauputogpintnwktprchmt&token=" + token + "&client_id=381&uc_biz_str=S%3Acustom%7CC%3Atitlebar_fix");
|
|
||||||
} finally {
|
|
||||||
Map<String, String> map = new HashMap<>();
|
|
||||||
map.put("token", token);
|
|
||||||
Init.execute(() -> startService(map));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void showQRCode(String content) {
|
|
||||||
try {
|
|
||||||
int size = ResUtil.dp2px(240);
|
|
||||||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(size, size);
|
|
||||||
ImageView image = new ImageView(Init.context());
|
|
||||||
image.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
|
||||||
image.setImageBitmap(QRCode.getBitmap(content, size, 2));
|
|
||||||
FrameLayout frame = new FrameLayout(Init.context());
|
|
||||||
params.gravity = Gravity.CENTER;
|
|
||||||
frame.addView(image, params);
|
|
||||||
dialog = new AlertDialog.Builder(Init.getActivity()).setView(frame).setOnCancelListener(this::dismiss).setOnDismissListener(this::dismiss).show();
|
|
||||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
|
||||||
Notify.show("请使用夸克网盘App扫描二维码");
|
|
||||||
} catch (Exception ignored) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void startService(Map<String, String> params) {
|
|
||||||
SpiderDebug.log("----startservice");
|
|
||||||
params.put("client_id", "381");
|
|
||||||
params.put("v", "1.2");
|
|
||||||
params.put("request_id", UUID.randomUUID().toString());
|
|
||||||
service = Executors.newScheduledThreadPool(1);
|
|
||||||
|
|
||||||
service.scheduleWithFixedDelay(() -> {
|
|
||||||
SpiderDebug.log("----scheduleAtFixedRate" + new Date().toString());
|
|
||||||
String result = OkHttp.string("https://api.open.uc.cn/cas/ajax/getServiceTicketByQrcodeToken?__dt="+ RandomUtils.nextInt(1000,100000) +"&__t="+new Date().getTime(), params, getWebHeaders());
|
|
||||||
Map<String, Object> json = Json.parseSafe(result, Map.class);
|
|
||||||
if (json.get("status").equals(new Double(2000000))) {
|
|
||||||
setToken((String) ((Map<String, Object>) ((Map<String, Object>) json.get("data")).get("members")).get("service_ticket"));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}, 1, 3, TimeUnit.SECONDS);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setToken(String value) {
|
|
||||||
this.serviceTicket = value;
|
|
||||||
SpiderDebug.log("ServiceTicket:" + value);
|
|
||||||
Notify.show("ServiceTicket:" + value);
|
|
||||||
initUserInfo();
|
|
||||||
stopService();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void stopService() {
|
|
||||||
if (service != null) service.shutdownNow();
|
|
||||||
|
|
||||||
|
|
||||||
Init.run(this::dismiss);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void dismiss(DialogInterface dialog) {
|
|
||||||
stopService();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void dismiss() {
|
|
||||||
try {
|
|
||||||
if (dialog != null) dialog.dismiss();
|
|
||||||
} catch (Exception ignored) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ public class SpiderDebug {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void log(String msg) {
|
public static void log(String msg) {
|
||||||
|
System.out.println(msg);
|
||||||
Log.d(TAG, msg);
|
Log.d(TAG, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,7 @@ import android.widget.Button;
|
||||||
import com.github.catvod.R;
|
import com.github.catvod.R;
|
||||||
import com.github.catvod.crawler.Spider;
|
import com.github.catvod.crawler.Spider;
|
||||||
import com.github.catvod.net.OkHttp;
|
import com.github.catvod.net.OkHttp;
|
||||||
import com.github.catvod.spider.Init;
|
import com.github.catvod.spider.*;
|
||||||
import com.github.catvod.spider.NG;
|
|
||||||
import com.github.catvod.spider.PTT;
|
|
||||||
import com.github.catvod.spider.Wogg;
|
|
||||||
import com.github.catvod.spider.Zxzj;
|
|
||||||
import com.github.catvod.utils.Util;
|
import com.github.catvod.utils.Util;
|
||||||
import com.orhanobut.logger.AndroidLogAdapter;
|
import com.orhanobut.logger.AndroidLogAdapter;
|
||||||
import com.orhanobut.logger.Logger;
|
import com.orhanobut.logger.Logger;
|
||||||
|
|
@ -28,13 +24,12 @@ public class MainActivity extends Activity {
|
||||||
|
|
||||||
private ExecutorService executor;
|
private ExecutorService executor;
|
||||||
private Spider spider;
|
private Spider spider;
|
||||||
private QuickJSContext context;;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
QuickJSLoader.init();
|
|
||||||
context = QuickJSContext.create();
|
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
Button homeContent = findViewById(R.id.homeContent);
|
Button homeContent = findViewById(R.id.homeContent);
|
||||||
Button homeVideoContent = findViewById(R.id.homeVideoContent);
|
Button homeVideoContent = findViewById(R.id.homeVideoContent);
|
||||||
|
|
@ -95,8 +90,8 @@ public class MainActivity extends Activity {
|
||||||
|
|
||||||
public void detailContent() {
|
public void detailContent() {
|
||||||
try {
|
try {
|
||||||
Logger.t("detailContent").d(spider.detailContent(Arrays.asList("/voddetail/86346.html")));
|
// Logger.t("detailContent").d(spider.detailContent(Arrays.asList("https://drive.uc.cn/s/1bc52309b62f4?public=1")));
|
||||||
// Logger.t("detailContent").d(spider.detailContent(Arrays.asList("/voddetail/81612.html")));
|
Logger.t("detailContent").d(spider.detailContent(Arrays.asList("/voddetail/88220.html")));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
@ -104,7 +99,7 @@ public class MainActivity extends Activity {
|
||||||
|
|
||||||
public void playerContent() {
|
public void playerContent() {
|
||||||
try {
|
try {
|
||||||
Logger.t("playerContent").d(spider.playerContent("quark4K", "a2b40ca04eaa408f9008c161b685a722++a02c38f9ee9a99a5345f91ed4fb4e453++38c5e16d71f7++Yh7f4+dwB7CRa/HMcWOy0Sl1fepgjXCR3lVbyVFeNoY=", new ArrayList<>()));
|
Logger.t("playerContent").d(spider.playerContent("Uc4K", "c346b2883f0346d793b2aab7dbf6c08c++6924b088a6f624fd5baa769bf48ae337++1bc52309b62f4++YmXbBVC2f9W1Frq2ji2l0p0TxSaJhSr7HjrKRat1E6c=", new ArrayList<>()));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,16 @@ import java.util.List;
|
||||||
public class Cloud extends Spider {
|
public class Cloud extends Spider {
|
||||||
private Quark quark = null;
|
private Quark quark = null;
|
||||||
private Ali ali = null;
|
private Ali ali = null;
|
||||||
|
private UC uc = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Context context, String extend) throws Exception {
|
public void init(Context context, String extend) throws Exception {
|
||||||
JsonObject ext = Json.safeObject(extend);
|
JsonObject ext = Json.safeObject(extend);
|
||||||
quark = new Quark();
|
quark = new Quark();
|
||||||
|
uc = new UC();
|
||||||
ali = new Ali();
|
ali = new Ali();
|
||||||
quark.init(context, ext.has("cookie") ? ext.get("cookie").getAsString() : "");
|
quark.init(context, ext.has("cookie") ? ext.get("cookie").getAsString() : "");
|
||||||
|
uc.init(context, ext.has("uccookie") ? ext.get("uccookie").getAsString() : "");
|
||||||
ali.init(context, ext.has("token") ? ext.get("token").getAsString() : "");
|
ali.init(context, ext.has("token") ? ext.get("token").getAsString() : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -32,26 +35,41 @@ public class Cloud extends Spider {
|
||||||
return ali.detailContent(shareUrl);
|
return ali.detailContent(shareUrl);
|
||||||
} else if (shareUrl.get(0).matches(Util.patternQuark)) {
|
} else if (shareUrl.get(0).matches(Util.patternQuark)) {
|
||||||
return quark.detailContent(shareUrl);
|
return quark.detailContent(shareUrl);
|
||||||
|
} else if (shareUrl.get(0).matches(Util.patternUC)) {
|
||||||
|
return uc.detailContent(shareUrl);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
|
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
|
||||||
return flag.contains("quark") ? quark.playerContent(flag, id, vipFlags) : ali.playerContent(flag, id, vipFlags);
|
if (flag.contains("quark")) {
|
||||||
|
return quark.playerContent(flag, id, vipFlags);
|
||||||
|
} else if (flag.contains("uc")) {
|
||||||
|
return uc.playerContent(flag, id, vipFlags);
|
||||||
|
} else {
|
||||||
|
return ali.playerContent(flag, id, vipFlags);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String detailContentVodPlayFrom(List<String> shareLinks) {
|
protected String detailContentVodPlayFrom(List<String> shareLinks) {
|
||||||
List<String> from = new ArrayList<>();
|
List<String> from = new ArrayList<>();
|
||||||
List<String> aliShare = new ArrayList<>();
|
List<String> aliShare = new ArrayList<>();
|
||||||
List<String> quarkShare = new ArrayList<>();
|
List<String> quarkShare = new ArrayList<>();
|
||||||
|
List<String> ucShare = new ArrayList<>();
|
||||||
for (String shareLink : shareLinks) {
|
for (String shareLink : shareLinks) {
|
||||||
if (shareLink.matches(Util.patternAli)) {
|
if (shareLink.matches(Util.patternAli)) {
|
||||||
aliShare.add(shareLink);
|
aliShare.add(shareLink);
|
||||||
} else if (shareLink.matches(Util.patternQuark)) {
|
} else if (shareLink.matches(Util.patternQuark)) {
|
||||||
quarkShare.add(shareLink);
|
quarkShare.add(shareLink);
|
||||||
|
} else if (shareLink.matches(Util.patternUC)) {
|
||||||
|
ucShare.add(shareLink);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ucShare.isEmpty()) {
|
||||||
|
from.add(uc.detailContentVodPlayFrom(ucShare));
|
||||||
|
}
|
||||||
if (!quarkShare.isEmpty()) {
|
if (!quarkShare.isEmpty()) {
|
||||||
from.add(quark.detailContentVodPlayFrom(quarkShare));
|
from.add(quark.detailContentVodPlayFrom(quarkShare));
|
||||||
}
|
}
|
||||||
|
|
@ -69,6 +87,8 @@ public class Cloud extends Spider {
|
||||||
urls.add(ali.detailContentVodPlayUrl(List.of(shareLink)));
|
urls.add(ali.detailContentVodPlayUrl(List.of(shareLink)));
|
||||||
} else if (shareLink.matches(Util.patternQuark)) {
|
} else if (shareLink.matches(Util.patternQuark)) {
|
||||||
urls.add(quark.detailContentVodPlayUrl(List.of(shareLink)));
|
urls.add(quark.detailContentVodPlayUrl(List.of(shareLink)));
|
||||||
|
} else if (shareLink.matches(Util.patternUC)) {
|
||||||
|
urls.add(uc.detailContentVodPlayUrl(List.of(shareLink)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TextUtils.join("$$$", urls);
|
return TextUtils.join("$$$", urls);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
package com.github.catvod.spider;
|
package com.github.catvod.spider;
|
||||||
|
|
||||||
import android.util.Base64;
|
|
||||||
|
|
||||||
import com.github.catvod.crawler.Spider;
|
import com.github.catvod.crawler.Spider;
|
||||||
import com.github.catvod.crawler.SpiderDebug;
|
import com.github.catvod.crawler.SpiderDebug;
|
||||||
import com.github.catvod.net.OkHttp;
|
import com.github.catvod.net.OkHttp;
|
||||||
|
|
@ -10,7 +8,6 @@ import com.github.catvod.utils.Util;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.nio.charset.Charset;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -28,6 +25,8 @@ public class Proxy extends Spider {
|
||||||
return Ali.proxy(params);
|
return Ali.proxy(params);
|
||||||
case "quark":
|
case "quark":
|
||||||
return Quark.proxy(params);
|
return Quark.proxy(params);
|
||||||
|
case "uc":
|
||||||
|
return UC.proxy(params);
|
||||||
case "bili":
|
case "bili":
|
||||||
return Bili.proxy(params);
|
return Bili.proxy(params);
|
||||||
case "webdav":
|
case "webdav":
|
||||||
|
|
@ -47,7 +46,7 @@ public class Proxy extends Spider {
|
||||||
String url = Util.base64Decode(params.get("url"));
|
String url = Util.base64Decode(params.get("url"));
|
||||||
Map<String, String> header = new Gson().fromJson(Util.base64Decode(params.get("header")), Map.class);
|
Map<String, String> header = new Gson().fromJson(Util.base64Decode(params.get("header")), Map.class);
|
||||||
if (header == null) header = new HashMap<>();
|
if (header == null) header = new HashMap<>();
|
||||||
List<String> keys = Arrays.asList( "range", "connection", "accept-encoding");
|
List<String> keys = Arrays.asList("range", "connection", "accept-encoding");
|
||||||
for (String key : params.keySet()) {
|
for (String key : params.keySet()) {
|
||||||
if (keys.contains(key.toLowerCase())) {
|
if (keys.contains(key.toLowerCase())) {
|
||||||
header.put(key, params.get(key));
|
header.put(key, params.get(key));
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@ package com.github.catvod.spider;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import com.github.catvod.api.UCApi;
|
import com.github.catvod.api.UCApi;
|
||||||
import com.github.catvod.bean.Result;
|
import com.github.catvod.bean.Result;
|
||||||
import com.github.catvod.bean.uc.ShareData;
|
import com.github.catvod.bean.uc.ShareData;
|
||||||
import com.github.catvod.crawler.Spider;
|
import com.github.catvod.crawler.Spider;
|
||||||
|
import com.github.catvod.crawler.SpiderDebug;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -35,8 +35,9 @@ public class UC extends Spider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
|
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
|
||||||
return UCApi.get().playerContent(id.split("\\+\\+"), flag);
|
String playContent = UCApi.get().playerContent(id.split("\\+\\+"), flag);
|
||||||
|
SpiderDebug.log("playContent:" + playContent);
|
||||||
|
return playContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ import java.util.regex.Pattern;
|
||||||
public class Util {
|
public class Util {
|
||||||
public static final String patternAli = "(https:\\/\\/www\\.aliyundrive\\.com\\/s\\/[^\"]+|https:\\/\\/www\\.alipan\\.com\\/s\\/[^\"]+)";
|
public static final String patternAli = "(https:\\/\\/www\\.aliyundrive\\.com\\/s\\/[^\"]+|https:\\/\\/www\\.alipan\\.com\\/s\\/[^\"]+)";
|
||||||
public static final String patternQuark = "(https:\\/\\/pan\\.quark\\.cn\\/s\\/[^\"]+)";
|
public static final String patternQuark = "(https:\\/\\/pan\\.quark\\.cn\\/s\\/[^\"]+)";
|
||||||
|
public static final String patternUC = "(https:\\/\\/drive\\.uc\\.cn\\/s\\/[^\"]+)";
|
||||||
public static final Pattern RULE = Pattern.compile("http((?!http).){12,}?\\.(m3u8|mp4|mkv|flv|mp3|m4a|aac)\\?.*|http((?!http).){12,}\\.(m3u8|mp4|mkv|flv|mp3|m4a|aac)|http((?!http).)*?video/tos*");
|
public static final Pattern RULE = Pattern.compile("http((?!http).){12,}?\\.(m3u8|mp4|mkv|flv|mp3|m4a|aac)\\?.*|http((?!http).){12,}\\.(m3u8|mp4|mkv|flv|mp3|m4a|aac)|http((?!http).)*?video/tos*");
|
||||||
public static final Pattern THUNDER = Pattern.compile("(magnet|thunder|ed2k):.*");
|
public static final Pattern THUNDER = Pattern.compile("(magnet|thunder|ed2k):.*");
|
||||||
public static final String CHROME = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36";
|
public static final String CHROME = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36";
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,8 @@ public class WoggTest {
|
||||||
spider = new Wogg();
|
spider = new Wogg();
|
||||||
Server.get().start();
|
Server.get().start();
|
||||||
// spider.init(mockContext, "{\"cookie\":\"b-user-id=89ede34e-0efc-e1dd-c997-f16aaa792d0c; _UP_A4A_11_=wb9661c6dfb642f88f73d8e0c7edd398; b-user-id=89ede34e-0efc-e1dd-c997-f16aaa792d0c; ctoken=wla6p3EUOLyn1FSB8IKp1SEW; grey-id=5583e32b-39df-4bf0-f39f-1adf83f604a2; grey-id.sig=p8ReBIMG2BeZu1sYvsuOAZxYbx-MVrsfKEiCv87MsTM; isQuark=true; isQuark.sig=hUgqObykqFom5Y09bll94T1sS9abT1X-4Df_lzgl8nM; _UP_F7E_8D_=ZkyvVHnrBLp1A1NFJIjWi0PwKLOVbxJPcg0RzQPI6KmBtV6ZMgPh38l93pgubgHDQqhaZ2Sfc0qv%2BRantbfg1mWGAUpRMP4RqXP78Wvu%2FCfvkWWGc5NhCTV71tGOIGgDBR3%2Bu6%2Fjj44KlE5biSNDOWW7Bigcz27lvOTidzNw8s%2FWtKAIxWbnCzZn4%2FJMBUub1SIMcW89g57k4mfPmDlCgpZKzxwl6beSfdtZ4RUWXmZOn5v5NkxVKhU4wR0Pq7NklczEGdRq2nIAcu7v22Uw2o%2FxMY0xBdeC9Korm5%2FNHnxl6K%2Bd6FXSoT9a3XIMQO359auZPiZWzrNlZe%2BqnOahXcx7KAhQIRqSOapSmL4ygJor4r5isJhRuDoXy7vJAVuH%2FRDtEJJ8rZTq0BdC23Bz%2B0MrsdgbK%2BiW; _UP_D_=pc; __wpkreporterwid_=3d3f74a7-99b7-4916-3f78-911fc2eb9d87; tfstk=fIoZNxjnbhKwPOu0TWZ4LsaRqirTcudSSmNbnxD0C5VgClMm8xMyB-GsnSu4tjpOflAOmSD-9PNiGl120XrgkVNb1SrqHbJBN3tSBAEYoQOWVUUg9qZ8n1bGGkD3CqGYINKSBABhjnXgp3_Vywz6gSc0Syj3BWf0mr2DLW24eZfiiovEKWefj1q0swq3E82iNEMinMy7SLrcpA4Fh3z_ZAViCfih3PbtdW5N_DuU77AaTijmYRkL2Wq54ENoy5a7ZXxCbok33XzS7QSZgxD-oyoVsdGotql0p2dVu7umC4nLStbiLmParc4FELHrI-c0u2dPVRrs8zoZWKCnIbNZrlHfUCMUz2z8KyXVSlgSFmUojh58OzeqTzgwaGll4YCYKwctDV5coP2LL79eKHxpNTXHmre1kZU32JPWCR_AkP2LL79eLZQY-WeUNdw1.; __pus=2051c82285199d8be553be41dd5a2100AAQ+mmv35G4FDDZ5x+3Mhe2OMbNgweQ1ODbW8zDt9YuP1LQVqHUuAAz9KWLsPjpNtim0AVGHusN4MCosTmbq/khM; __kp=e6604120-6051-11ef-bfe4-c31b6cdd0766; __kps=AATcZArVgS76EPn0FMaV4HEj; __ktd=sii/iz4ePzEaoVirXul7QQ==; __uid=AATcZArVgS76EPn0FMaV4HEj; __itrace_wid=5829b95d-dac1-48d3-bfd5-f60cd9462786; __puus=7da0b96cb710fa1b376934485f977e05AATp/q8/QupT7IiBR1GWqZhxlIRT677smMvoHlLxQA0Lk6CkP0YJBOTl+p9DZgzlMz6w4hPXPgWsokukk8PW7ZfhFfPmv8tKMgLpCGLW+tk57luhNghmSdTeVPkAF59STtyCPBEtiNzNAd/zZJ6qILJDi5ywEBAAAg+gOyWHoLHNUR+QxeHRuQa8g5WWA95J8jebIlrr8rCvI1vjTbtiYktT\",\"token\":\"26fc6787afff43e78b78992e782502f1\"}");
|
// spider.init(mockContext, "{\"cookie\":\"b-user-id=89ede34e-0efc-e1dd-c997-f16aaa792d0c; _UP_A4A_11_=wb9661c6dfb642f88f73d8e0c7edd398; b-user-id=89ede34e-0efc-e1dd-c997-f16aaa792d0c; ctoken=wla6p3EUOLyn1FSB8IKp1SEW; grey-id=5583e32b-39df-4bf0-f39f-1adf83f604a2; grey-id.sig=p8ReBIMG2BeZu1sYvsuOAZxYbx-MVrsfKEiCv87MsTM; isQuark=true; isQuark.sig=hUgqObykqFom5Y09bll94T1sS9abT1X-4Df_lzgl8nM; _UP_F7E_8D_=ZkyvVHnrBLp1A1NFJIjWi0PwKLOVbxJPcg0RzQPI6KmBtV6ZMgPh38l93pgubgHDQqhaZ2Sfc0qv%2BRantbfg1mWGAUpRMP4RqXP78Wvu%2FCfvkWWGc5NhCTV71tGOIGgDBR3%2Bu6%2Fjj44KlE5biSNDOWW7Bigcz27lvOTidzNw8s%2FWtKAIxWbnCzZn4%2FJMBUub1SIMcW89g57k4mfPmDlCgpZKzxwl6beSfdtZ4RUWXmZOn5v5NkxVKhU4wR0Pq7NklczEGdRq2nIAcu7v22Uw2o%2FxMY0xBdeC9Korm5%2FNHnxl6K%2Bd6FXSoT9a3XIMQO359auZPiZWzrNlZe%2BqnOahXcx7KAhQIRqSOapSmL4ygJor4r5isJhRuDoXy7vJAVuH%2FRDtEJJ8rZTq0BdC23Bz%2B0MrsdgbK%2BiW; _UP_D_=pc; __wpkreporterwid_=3d3f74a7-99b7-4916-3f78-911fc2eb9d87; tfstk=fIoZNxjnbhKwPOu0TWZ4LsaRqirTcudSSmNbnxD0C5VgClMm8xMyB-GsnSu4tjpOflAOmSD-9PNiGl120XrgkVNb1SrqHbJBN3tSBAEYoQOWVUUg9qZ8n1bGGkD3CqGYINKSBABhjnXgp3_Vywz6gSc0Syj3BWf0mr2DLW24eZfiiovEKWefj1q0swq3E82iNEMinMy7SLrcpA4Fh3z_ZAViCfih3PbtdW5N_DuU77AaTijmYRkL2Wq54ENoy5a7ZXxCbok33XzS7QSZgxD-oyoVsdGotql0p2dVu7umC4nLStbiLmParc4FELHrI-c0u2dPVRrs8zoZWKCnIbNZrlHfUCMUz2z8KyXVSlgSFmUojh58OzeqTzgwaGll4YCYKwctDV5coP2LL79eKHxpNTXHmre1kZU32JPWCR_AkP2LL79eLZQY-WeUNdw1.; __pus=2051c82285199d8be553be41dd5a2100AAQ+mmv35G4FDDZ5x+3Mhe2OMbNgweQ1ODbW8zDt9YuP1LQVqHUuAAz9KWLsPjpNtim0AVGHusN4MCosTmbq/khM; __kp=e6604120-6051-11ef-bfe4-c31b6cdd0766; __kps=AATcZArVgS76EPn0FMaV4HEj; __ktd=sii/iz4ePzEaoVirXul7QQ==; __uid=AATcZArVgS76EPn0FMaV4HEj; __itrace_wid=5829b95d-dac1-48d3-bfd5-f60cd9462786; __puus=7da0b96cb710fa1b376934485f977e05AATp/q8/QupT7IiBR1GWqZhxlIRT677smMvoHlLxQA0Lk6CkP0YJBOTl+p9DZgzlMz6w4hPXPgWsokukk8PW7ZfhFfPmv8tKMgLpCGLW+tk57luhNghmSdTeVPkAF59STtyCPBEtiNzNAd/zZJ6qILJDi5ywEBAAAg+gOyWHoLHNUR+QxeHRuQa8g5WWA95J8jebIlrr8rCvI1vjTbtiYktT\",\"token\":\"26fc6787afff43e78b78992e782502f1\"}");
|
||||||
spider.init(mockContext, "{\"cookie\":\"ctoken=rldVUeNBAbGyhJdbpC4wEUE-;__pus=75e54cf66f9ea5ed1497838782a90a78AATTBUV9c9w7KXUiHDEl6VdV8Wxki4L9R5kIIjSKQnX1wedJe3s8weva95YKUkRqI1aBY/MA+YBNvaTO0JkXvLp+;__kp=be6b9e10-74f8-11ef-aa08-7d8956cd7603;__kps=AATcZArVgS76EPn0FMaV4HEj;__ktd=sii/iz4ePzEaoVirXul7QQ==;__uid=AATcZArVgS76EPn0FMaV4HEj\"}");
|
spider.init(mockContext, "{\"uccookie\":\"_UP_28A_52_=519; _UP_A4A_11_=wb96b13a80d44eae9407596078d79493; _UP_D_=pc; tfstk=fRdEajNMTXhetGh7Nw5PuETdKgfdg6mjzQs5rUYlRMjnyvIlrG82OTmpPhSljwv7xwXhI87CPLslEg4pBnT0OBMdN75dw_mjcjGXReCRZQi_tWVdIZ8Gr72_NBgRw_mjfRNlpj5JDp4CGQYi7a_7twxlr50NPa_hZMXujRbcj_jkq9cGSZ_h-Jjh-R0NyGjlZTfoghpW387CKqMWqzlSpPOVmejHSFAMoosW-nN7rMSNL-8hb7Vksd_MEFjnHPsROMLh83hY96XyEB1MtccliKKwatfqF2BHzd-ROC0uKivBATdNQk2hu6SFnBXEw2CGEdRNOBm8HFTNxt56CAnCF6-eHiBnBcKy7MtkTOqEfg9X5BXwmcNw2TJkO1AnjjSyduQMpvOJwbePKNQNcVuw2tGY1PGkmU28eOfA7igCR8eRKNQNcVuae8BGXNSjRw1..; __pus=b53d5e3528975736692ad367fe0276ccAATHcuvAQPpM8qlCrY4RrF+6pZeokueQTJtP1GP9B/KlzCoM8BnjHtYnKPHRdGVEM8SrVm+nBqAxqGZfimoR13El; __kp=151a8750-9a86-11ef-bd21-670afe524949; __kps=AAQXoZxLp9Oe2Ps0d/hNBJl4; __ktd=2gPNadz6Z9c+2+FyQyQZUw==; __uid=AAQXoZxLp9Oe2Ps0d/hNBJl4; b-user-id=4eacf5e0-77a2-11ef-86f9-df0d3f1b47d6; __puus=0553ad1bddd035b3449c9152aeee5c9aAATQ3CFawxKtD39OztVJaqQFLCrKnmPPCSldlGnO+Fa7bYbqwjjoIdP6b3jWkwcfBYKm/6GlbvWRZSI9+Ulk6SQ/TaPUdvuLmi4y1YbzB0w1S27SpqionxP94jPdaDWTpHrXXjLeBV2Vl1QZKCGK9PCg41DmUBspov39QKgWy9fMGbegyHREpqXixPzlbhY2vVU=\"," +
|
||||||
|
"\"cookie\":\"b-user-id=89ede34e-0efc-e1dd-c997-f16aaa792d0c; _UP_A4A_11_=wb9661c6dfb642f88f73d8e0c7edd398; b-user-id=89ede34e-0efc-e1dd-c997-f16aaa792d0c; ctoken=wla6p3EUOLyn1FSB8IKp1SEW; grey-id=5583e32b-39df-4bf0-f39f-1adf83f604a2; grey-id.sig=p8ReBIMG2BeZu1sYvsuOAZxYbx-MVrsfKEiCv87MsTM; isQuark=true; isQuark.sig=hUgqObykqFom5Y09bll94T1sS9abT1X-4Df_lzgl8nM; _UP_F7E_8D_=ZkyvVHnrBLp1A1NFJIjWi0PwKLOVbxJPcg0RzQPI6KmBtV6ZMgPh38l93pgubgHDQqhaZ2Sfc0qv%2BRantbfg1mWGAUpRMP4RqXP78Wvu%2FCfvkWWGc5NhCTV71tGOIGgDBR3%2Bu6%2Fjj44KlE5biSNDOWW7Bigcz27lvOTidzNw8s%2FWtKAIxWbnCzZn4%2FJMBUub1SIMcW89g57k4mfPmDlCgpZKzxwl6beSfdtZ4RUWXmZOn5v5NkxVKhU4wR0Pq7NklczEGdRq2nIAcu7v22Uw2o%2FxMY0xBdeC9Korm5%2FNHnxl6K%2Bd6FXSoT9a3XIMQO359auZPiZWzrNlZe%2BqnOahXcx7KAhQIRqSOapSmL4ygJor4r5isJhRuDoXy7vJAVuH%2FRDtEJJ8rZTq0BdC23Bz%2B0MrsdgbK%2BiW; _UP_D_=pc; __wpkreporterwid_=3d3f74a7-99b7-4916-3f78-911fc2eb9d87; tfstk=fIoZNxjnbhKwPOu0TWZ4LsaRqirTcudSSmNbnxD0C5VgClMm8xMyB-GsnSu4tjpOflAOmSD-9PNiGl120XrgkVNb1SrqHbJBN3tSBAEYoQOWVUUg9qZ8n1bGGkD3CqGYINKSBABhjnXgp3_Vywz6gSc0Syj3BWf0mr2DLW24eZfiiovEKWefj1q0swq3E82iNEMinMy7SLrcpA4Fh3z_ZAViCfih3PbtdW5N_DuU77AaTijmYRkL2Wq54ENoy5a7ZXxCbok33XzS7QSZgxD-oyoVsdGotql0p2dVu7umC4nLStbiLmParc4FELHrI-c0u2dPVRrs8zoZWKCnIbNZrlHfUCMUz2z8KyXVSlgSFmUojh58OzeqTzgwaGll4YCYKwctDV5coP2LL79eKHxpNTXHmre1kZU32JPWCR_AkP2LL79eLZQY-WeUNdw1.; __pus=2051c82285199d8be553be41dd5a2100AAQ+mmv35G4FDDZ5x+3Mhe2OMbNgweQ1ODbW8zDt9YuP1LQVqHUuAAz9KWLsPjpNtim0AVGHusN4MCosTmbq/khM; __kp=e6604120-6051-11ef-bfe4-c31b6cdd0766; __kps=AATcZArVgS76EPn0FMaV4HEj; __ktd=sii/iz4ePzEaoVirXul7QQ==; __uid=AATcZArVgS76EPn0FMaV4HEj; __itrace_wid=5829b95d-dac1-48d3-bfd5-f60cd9462786; __puus=7da0b96cb710fa1b376934485f977e05AATp/q8/QupT7IiBR1GWqZhxlIRT677smMvoHlLxQA0Lk6CkP0YJBOTl+p9DZgzlMz6w4hPXPgWsokukk8PW7ZfhFfPmv8tKMgLpCGLW+tk57luhNghmSdTeVPkAF59STtyCPBEtiNzNAd/zZJ6qILJDi5ywEBAAAg+gOyWHoLHNUR+QxeHRuQa8g5WWA95J8jebIlrr8rCvI1vjTbtiYktT\",\"token\":\"26fc6787afff43e78b78992e782502f1\"}");
|
||||||
// spider.init(mockContext, "");
|
// spider.init(mockContext, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -66,7 +67,7 @@ public class WoggTest {
|
||||||
@org.junit.Test
|
@org.junit.Test
|
||||||
public void detailContent() throws Exception {
|
public void detailContent() throws Exception {
|
||||||
|
|
||||||
String content = spider.detailContent(Arrays.asList("/voddetail/86829.html"));
|
String content = spider.detailContent(Arrays.asList("/voddetail/88220.html"));
|
||||||
System.out.println("detailContent--" + content);
|
System.out.println("detailContent--" + content);
|
||||||
|
|
||||||
JsonObject map = Json.safeObject(content);
|
JsonObject map = Json.safeObject(content);
|
||||||
|
|
@ -77,7 +78,7 @@ public class WoggTest {
|
||||||
|
|
||||||
@org.junit.Test
|
@org.junit.Test
|
||||||
public void playerContent() throws Exception {
|
public void playerContent() throws Exception {
|
||||||
String content = spider.playerContent("quark原画", "81c9aa49887d4b07aba861d7dd76d0ac++b2a83edeb7211b3fe316b5ec1be6f19f++4be1d75e17aa++EBR0p92y9GDjeAk2mgUu959KWjj3KIx1w5UgMpVaubg=", new ArrayList<>());
|
String content = spider.playerContent("uc普画", "c346b2883f0346d793b2aab7dbf6c08c++870814f06ad04ebb4a2a4d89939e9a87++1bc52309b62f4++W/a0uygbijnst0uF2B6kvTDU7975oIx/U+6Rx4712O0=", new ArrayList<>());
|
||||||
System.out.println("playerContent--" + content);
|
System.out.println("playerContent--" + content);
|
||||||
JsonObject map = Json.safeObject(content);
|
JsonObject map = Json.safeObject(content);
|
||||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
13a45bcad9441a08c06c37760e5c5f24
|
70aca0970313d18413e56ebc6d176878
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;2fe07c737f0438bdbbb830d18d765697",
|
"spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;70aca0970313d18413e56ebc6d176878",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "直播ipv6",
|
"name": "直播ipv6",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;13a45bcad9441a08c06c37760e5c5f24",
|
"spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;70aca0970313d18413e56ebc6d176878",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "直播ipv6",
|
"name": "直播ipv6",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;13a45bcad9441a08c06c37760e5c5f24",
|
"spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;70aca0970313d18413e56ebc6d176878",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "直播ipv6",
|
"name": "直播ipv6",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue