Merge branch 'main' of https://github.com/FongMi/CatVodSpider
This commit is contained in:
commit
a478ae08a4
|
|
@ -7,7 +7,10 @@ public class Auth {
|
|||
private String refreshToken;
|
||||
private String accessToken;
|
||||
private String shareToken;
|
||||
private String signature;
|
||||
private String deviceId;
|
||||
private String shareId;
|
||||
private String userId;
|
||||
|
||||
public String getRefreshToken() {
|
||||
return TextUtils.isEmpty(refreshToken) ? "" : refreshToken;
|
||||
|
|
@ -33,6 +36,22 @@ public class Auth {
|
|||
this.shareToken = shareToken;
|
||||
}
|
||||
|
||||
public String getSignature() {
|
||||
return signature;
|
||||
}
|
||||
|
||||
public void setSignature(String signature) {
|
||||
this.signature = signature;
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getShareId() {
|
||||
return TextUtils.isEmpty(shareId) ? "" : shareId;
|
||||
}
|
||||
|
|
@ -41,6 +60,14 @@ public class Auth {
|
|||
this.shareId = shareId;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return getAccessToken().isEmpty();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class OkHttp {
|
|||
return new OkHttpClient.Builder().dns(safeDns()).readTimeout(30, TimeUnit.SECONDS).writeTimeout(30, TimeUnit.SECONDS).connectTimeout(30, TimeUnit.SECONDS).hostnameVerifier(SSLSocketFactoryCompat.hostnameVerifier).sslSocketFactory(new SSLSocketFactoryCompat(), SSLSocketFactoryCompat.trustAllCert);
|
||||
}
|
||||
|
||||
private static OkHttpClient client() {
|
||||
public static OkHttpClient client() {
|
||||
return get().client;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import android.graphics.Color;
|
|||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
|
|
@ -74,7 +75,8 @@ public class Ali {
|
|||
|
||||
private HashMap<String, String> getAuthHeader() {
|
||||
HashMap<String, String> headers = getHeaders();
|
||||
headers.put("authorization", auth.getAccessToken());
|
||||
headers.put("content-type", "application/json");
|
||||
headers.put("Authorization", auth.getAccessToken());
|
||||
headers.put("x-share-token", auth.getShareToken());
|
||||
return headers;
|
||||
}
|
||||
|
|
@ -112,11 +114,7 @@ public class Ali {
|
|||
public String playerContent(String flag, String id) {
|
||||
String[] ids = id.split("\\+");
|
||||
if (auth.isEmpty()) refreshAccessToken();
|
||||
if (flag.equals("原畫")) {
|
||||
return Result.get().url(getDownloadUrl(ids[0])).subs(getSub(ids)).header(getHeaders()).string();
|
||||
} else {
|
||||
return Result.get().url(getPreviewUrl(ids[0])).subs(getSub(ids)).header(getHeaders()).string();
|
||||
}
|
||||
return Result.get().url(getDownloadUrl(ids[0])).subs(getSub(ids)).header(getHeaders()).string();
|
||||
}
|
||||
|
||||
private Vod getVod(String url, String fileId) throws Exception {
|
||||
|
|
@ -138,7 +136,7 @@ public class Ali {
|
|||
vod.setVodPic(object.getString("avatar"));
|
||||
vod.setVodName(object.getString("share_name"));
|
||||
vod.setVodPlayUrl(TextUtils.join("$$$", sourceUrls));
|
||||
vod.setVodPlayFrom("原畫$$$普畫");
|
||||
vod.setVodPlayFrom("原畫");
|
||||
vod.setTypeName("阿里雲盤");
|
||||
return vod;
|
||||
}
|
||||
|
|
@ -194,6 +192,8 @@ public class Ali {
|
|||
body.put("refresh_token", token);
|
||||
body.put("grant_type", "refresh_token");
|
||||
JSONObject object = new JSONObject(post("https://auth.aliyundrive.com/v2/account/token", body));
|
||||
auth.setUserId(object.getString("user_id"));
|
||||
auth.setDeviceId(object.getString("device_id"));
|
||||
auth.setAccessToken(object.getString("token_type") + " " + object.getString("access_token"));
|
||||
auth.setRefreshToken(object.getString("refresh_token"));
|
||||
return true;
|
||||
|
|
@ -287,6 +287,7 @@ public class Ali {
|
|||
body.put("share_id", auth.getShareId());
|
||||
body.put("expire_sec", 600);
|
||||
String json = postAuth("v2/file/get_share_link_download_url", body);
|
||||
Log.e("DDD", json);
|
||||
String url = new JSONObject(json).optString("download_url");
|
||||
Map<String, List<String>> respHeaders = new HashMap<>();
|
||||
OkHttp.stringNoRedirect(url, getHeaders(), respHeaders);
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
c8bba231546a63b3431cf31e5d856794
|
||||
029605ba89c58f14982a8aa1665cbeef
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"spider": "https://gh-proxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;c8bba231546a63b3431cf31e5d856794",
|
||||
"spider": "https://gh-proxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;029605ba89c58f14982a8aa1665cbeef",
|
||||
"wallpaper": "https://gao.chuqiuyu.tk",
|
||||
"lives": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"spider": "https://gh-proxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;c8bba231546a63b3431cf31e5d856794",
|
||||
"spider": "https://gh-proxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;029605ba89c58f14982a8aa1665cbeef",
|
||||
"wallpaper": "http://www.kf666888.cn/api/tvbox/img",
|
||||
"lives": [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue