Fix upyun
This commit is contained in:
parent
7dd255db92
commit
c442ac4c30
|
|
@ -26,8 +26,9 @@ public class Item {
|
||||||
return TextUtils.isEmpty(insertTime) ? "" : insertTime;
|
return TextUtils.isEmpty(insertTime) ? "" : insertTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAli() {
|
public Item url(String pageUrl) {
|
||||||
return getPageUrl().contains("www.aliyundrive.com");
|
this.pageUrl = pageUrl;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vod getVod() {
|
public Vod getVod() {
|
||||||
|
|
|
||||||
|
|
@ -1,38 +1,41 @@
|
||||||
package com.github.catvod.spider;
|
package com.github.catvod.spider;
|
||||||
|
|
||||||
import android.util.Base64;
|
|
||||||
|
|
||||||
import com.github.catvod.bean.Result;
|
import com.github.catvod.bean.Result;
|
||||||
import com.github.catvod.bean.Vod;
|
import com.github.catvod.bean.Vod;
|
||||||
import com.github.catvod.bean.upyun.Data;
|
import com.github.catvod.bean.upyun.Data;
|
||||||
import com.github.catvod.bean.upyun.Item;
|
import com.github.catvod.bean.upyun.Item;
|
||||||
import com.github.catvod.net.OkHttp;
|
import com.github.catvod.net.OkHttp;
|
||||||
import com.github.catvod.utils.Utils;
|
import com.google.common.io.BaseEncoding;
|
||||||
|
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.spec.IvParameterSpec;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
|
||||||
public class UpYun extends Ali {
|
public class UpYun extends Ali {
|
||||||
|
|
||||||
private final String siteUrl = "https://www.upyunso.com/";
|
|
||||||
private final String apiUrl = "https://api.upyunso2.com/";
|
|
||||||
|
|
||||||
private Map<String, String> getHeaders() {
|
|
||||||
HashMap<String, String> headers = new HashMap<>();
|
|
||||||
headers.put("User-Agent", Utils.CHROME);
|
|
||||||
headers.put("Referer", siteUrl);
|
|
||||||
return headers;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String searchContent(String key, boolean quick) {
|
public String searchContent(String key, boolean quick) throws Exception {
|
||||||
String url = apiUrl + "search?keyword=" + URLEncoder.encode(key) + "&page=1&s_type=2";
|
String res = decode(OkHttp.string("https://zyb.upyunso.com/v15/search?keyword=" + URLEncoder.encode(key) + "&page=1&s_type=2"));
|
||||||
String res = new String(Base64.decode(OkHttp.string(url, getHeaders()), Base64.DEFAULT));
|
|
||||||
List<Vod> list = new ArrayList<>();
|
List<Vod> list = new ArrayList<>();
|
||||||
for (Item item : Data.objectFrom(res).getResult().getItems()) if (item.isAli() && item.getTitle().contains(key)) list.add(item.getVod());
|
for (Item item : Data.objectFrom(res).getResult().getItems()) {
|
||||||
|
String url = decode(item.getPageUrl());
|
||||||
|
if (!url.contains("www.aliyundrive.com")) continue;
|
||||||
|
if (item.getTitle().contains(key)) list.add(item.url(url).getVod());
|
||||||
|
}
|
||||||
return Result.string(list);
|
return Result.string(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String decode(String data) throws Exception {
|
||||||
|
SecretKeySpec keySpec = new SecretKeySpec("qq1920520460qqzz".getBytes(), "AES");
|
||||||
|
IvParameterSpec ivSpec = new IvParameterSpec("qq1920520460qqzz".getBytes());
|
||||||
|
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);
|
||||||
|
byte[] encryptDataBytes = BaseEncoding.base16().decode(data.toUpperCase());
|
||||||
|
byte[] decryptData = cipher.doFinal(encryptDataBytes);
|
||||||
|
return new String(decryptData, "UTF-8");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
e50bee173463b34db1d1faf3bbdffcaa
|
dfb5901a5b7325e193395db4ae6541b4
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue