This commit is contained in:
唐三 2023-08-05 19:04:13 +08:00
parent a430fd6a90
commit e56221d6d2
4 changed files with 6 additions and 12 deletions

View File

@ -157,8 +157,7 @@ public class API {
url = url.startsWith("https") ? url : "https://api.aliyundrive.com/" + url; url = url.startsWith("https") ? url : "https://api.aliyundrive.com/" + url;
OkResult result = OkHttp.postJson(url, json, getHeaderAuth()); OkResult result = OkHttp.postJson(url, json, getHeaderAuth());
SpiderDebug.log(result.getCode() + "," + url + "," + result.getBody()); SpiderDebug.log(result.getCode() + "," + url + "," + result.getBody());
if (retry && (result.getCode() == 400 || result.getCode() == 401) && refreshAccessToken()) if (retry && (result.getCode() == 400 || result.getCode() == 401) && refreshAccessToken()) return auth(url, json, false);
return auth(url, json, false);
if (retry && result.getCode() == 429) return auth(url, json, false); if (retry && result.getCode() == 429) return auth(url, json, false);
return result.getBody(); return result.getBody();
} }
@ -167,8 +166,7 @@ public class API {
url = url.startsWith("https") ? url : "https://open.aliyundrive.com/adrive/v1.0/" + url; url = url.startsWith("https") ? url : "https://open.aliyundrive.com/adrive/v1.0/" + url;
OkResult result = OkHttp.postJson(url, json, getHeaderOpen()); OkResult result = OkHttp.postJson(url, json, getHeaderOpen());
SpiderDebug.log(result.getCode() + "," + url + "," + result.getBody()); SpiderDebug.log(result.getCode() + "," + url + "," + result.getBody());
if (retry && (result.getCode() == 400 || result.getCode() == 401) && refreshOpenToken()) if (retry && (result.getCode() == 400 || result.getCode() == 401) && refreshOpenToken()) return oauth(url, json, false);
return oauth(url, json, false);
return result.getBody(); return result.getBody();
} }
@ -292,8 +290,7 @@ public class API {
List<String> playFrom = Arrays.asList("原畫", "超清", "高清"); List<String> playFrom = Arrays.asList("原畫", "超清", "高清");
List<String> episode = new ArrayList<>(); List<String> episode = new ArrayList<>();
List<String> playUrl = new ArrayList<>(); List<String> playUrl = new ArrayList<>();
for (Item file : files) for (Item file : files) episode.add(file.getDisplayName() + "$" + file.getFileId() + findSubs(file.getName(), subs));
episode.add(file.getDisplayName() + "$" + file.getFileId() + findSubs(file.getName(), subs));
for (int i = 0; i < playFrom.size(); i++) playUrl.add(TextUtils.join("#", episode)); for (int i = 0; i < playFrom.size(); i++) playUrl.add(TextUtils.join("#", episode));
Vod vod = new Vod(); Vod vod = new Vod();
vod.setVodId(url); vod.setVodId(url);
@ -359,8 +356,7 @@ public class API {
pair(Utils.removeExt(name1).toLowerCase(), items, subs); pair(Utils.removeExt(name1).toLowerCase(), items, subs);
if (subs.isEmpty()) subs.addAll(items); if (subs.isEmpty()) subs.addAll(items);
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (Item sub : subs) for (Item sub : subs) sb.append("+").append(Utils.removeExt(sub.getName())).append("@@@").append(sub.getExt()).append("@@@").append(sub.getFileId());
sb.append("+").append(Utils.removeExt(sub.getName())).append("@@@").append(sub.getExt()).append("@@@").append(sub.getFileId());
return sb.toString(); return sb.toString();
} }

View File

@ -48,9 +48,7 @@ public class User {
public void setRefreshToken(String refreshToken) { public void setRefreshToken(String refreshToken) {
this.refreshToken = refreshToken; this.refreshToken = refreshToken;
} }
public void setDriveId(String driveId) {
this.driveId = driveId;
}
public String getAuthorization() { public String getAuthorization() {
return getTokenType() + " " + getAccessToken(); return getTokenType() + " " + getAccessToken();
} }

Binary file not shown.

View File

@ -1 +1 @@
04cfe6ba366acf7e94a7d44795fc0bc3 8cfcd8600726cbd0dac219ec7d7e1a8b