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 refreshToken;
|
||||||
private String accessToken;
|
private String accessToken;
|
||||||
private String shareToken;
|
private String shareToken;
|
||||||
|
private String signature;
|
||||||
|
private String deviceId;
|
||||||
private String shareId;
|
private String shareId;
|
||||||
|
private String userId;
|
||||||
|
|
||||||
public String getRefreshToken() {
|
public String getRefreshToken() {
|
||||||
return TextUtils.isEmpty(refreshToken) ? "" : refreshToken;
|
return TextUtils.isEmpty(refreshToken) ? "" : refreshToken;
|
||||||
|
|
@ -33,6 +36,22 @@ public class Auth {
|
||||||
this.shareToken = shareToken;
|
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() {
|
public String getShareId() {
|
||||||
return TextUtils.isEmpty(shareId) ? "" : shareId;
|
return TextUtils.isEmpty(shareId) ? "" : shareId;
|
||||||
}
|
}
|
||||||
|
|
@ -41,6 +60,14 @@ public class Auth {
|
||||||
this.shareId = shareId;
|
this.shareId = shareId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserId(String userId) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
return getAccessToken().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);
|
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;
|
return get().client;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import android.graphics.Color;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
@ -74,7 +75,8 @@ public class Ali {
|
||||||
|
|
||||||
private HashMap<String, String> getAuthHeader() {
|
private HashMap<String, String> getAuthHeader() {
|
||||||
HashMap<String, String> headers = getHeaders();
|
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());
|
headers.put("x-share-token", auth.getShareToken());
|
||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
|
|
@ -112,11 +114,7 @@ public class Ali {
|
||||||
public String playerContent(String flag, String id) {
|
public String playerContent(String flag, String id) {
|
||||||
String[] ids = id.split("\\+");
|
String[] ids = id.split("\\+");
|
||||||
if (auth.isEmpty()) refreshAccessToken();
|
if (auth.isEmpty()) refreshAccessToken();
|
||||||
if (flag.equals("原畫")) {
|
return Result.get().url(getDownloadUrl(ids[0])).subs(getSub(ids)).header(getHeaders()).string();
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Vod getVod(String url, String fileId) throws Exception {
|
private Vod getVod(String url, String fileId) throws Exception {
|
||||||
|
|
@ -138,7 +136,7 @@ public class Ali {
|
||||||
vod.setVodPic(object.getString("avatar"));
|
vod.setVodPic(object.getString("avatar"));
|
||||||
vod.setVodName(object.getString("share_name"));
|
vod.setVodName(object.getString("share_name"));
|
||||||
vod.setVodPlayUrl(TextUtils.join("$$$", sourceUrls));
|
vod.setVodPlayUrl(TextUtils.join("$$$", sourceUrls));
|
||||||
vod.setVodPlayFrom("原畫$$$普畫");
|
vod.setVodPlayFrom("原畫");
|
||||||
vod.setTypeName("阿里雲盤");
|
vod.setTypeName("阿里雲盤");
|
||||||
return vod;
|
return vod;
|
||||||
}
|
}
|
||||||
|
|
@ -194,6 +192,8 @@ public class Ali {
|
||||||
body.put("refresh_token", token);
|
body.put("refresh_token", token);
|
||||||
body.put("grant_type", "refresh_token");
|
body.put("grant_type", "refresh_token");
|
||||||
JSONObject object = new JSONObject(post("https://auth.aliyundrive.com/v2/account/token", body));
|
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.setAccessToken(object.getString("token_type") + " " + object.getString("access_token"));
|
||||||
auth.setRefreshToken(object.getString("refresh_token"));
|
auth.setRefreshToken(object.getString("refresh_token"));
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -287,6 +287,7 @@ public class Ali {
|
||||||
body.put("share_id", auth.getShareId());
|
body.put("share_id", auth.getShareId());
|
||||||
body.put("expire_sec", 600);
|
body.put("expire_sec", 600);
|
||||||
String json = postAuth("v2/file/get_share_link_download_url", body);
|
String json = postAuth("v2/file/get_share_link_download_url", body);
|
||||||
|
Log.e("DDD", json);
|
||||||
String url = new JSONObject(json).optString("download_url");
|
String url = new JSONObject(json).optString("download_url");
|
||||||
Map<String, List<String>> respHeaders = new HashMap<>();
|
Map<String, List<String>> respHeaders = new HashMap<>();
|
||||||
OkHttp.stringNoRedirect(url, getHeaders(), respHeaders);
|
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",
|
"wallpaper": "https://gao.chuqiuyu.tk",
|
||||||
"lives": [
|
"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",
|
"wallpaper": "http://www.kf666888.cn/api/tvbox/img",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue