This commit is contained in:
FongMi 2023-08-29 00:43:46 +08:00
parent 7ca416bb00
commit 3aa9a86597
5 changed files with 7 additions and 5 deletions

View File

@ -153,7 +153,8 @@ public class AliYun {
url = url.startsWith("https") ? url : "https://api.aliyundrive.com/" + url;
OkResult result = OkHttp.postJson(url, json, getHeaderAuth());
SpiderDebug.log(result.getCode() + "," + url + "," + result.getBody());
if (retry && (result.getCode() == 400 || result.getCode() == 401) && refreshAccessToken()) return auth(url, json, false);
if (retry && result.getCode() == 400 && refreshShareToken()) return auth(url, json, false);
if (retry && result.getCode() == 401 && refreshAccessToken()) return auth(url, json, false);
if (retry && result.getCode() == 429) return auth(url, json, false);
return result.getBody();
}
@ -178,7 +179,7 @@ public class AliYun {
return false;
}
private void refreshShareToken() {
private boolean refreshShareToken() {
SpiderDebug.log("refreshShareToken...");
JsonObject param = new JsonObject();
param.addProperty("share_id", shareId);
@ -186,6 +187,7 @@ public class AliYun {
String json = post("v2/share_link/get_share_token", param);
shareToken = Share.objectFrom(json).getShareToken();
if (shareToken.isEmpty()) Utils.notify("來晚啦,該分享已失效。");
return shareToken.length() > 0;
}
private boolean refreshAccessToken() {

Binary file not shown.

View File

@ -1 +1 @@
30fd1651e2c4f539d0b702eed0bb8e3f
22b3579498649b93fdfa3aab84792568

View File

@ -1,5 +1,5 @@
{
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;30fd1651e2c4f539d0b702eed0bb8e3f",
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;22b3579498649b93fdfa3aab84792568",
"wallpaper": "https://gao.chuqiuyu.tk",
"sites": [
{

View File

@ -1,5 +1,5 @@
{
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;30fd1651e2c4f539d0b702eed0bb8e3f",
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;22b3579498649b93fdfa3aab84792568",
"wallpaper": "http://饭太硬.top/深色壁纸/api.php",
"sites": [
{