Add ali 400 check

This commit is contained in:
FongMi 2023-06-05 10:16:23 +08:00
parent b341fc6e2f
commit eaa7616518
3 changed files with 3 additions and 3 deletions

View File

@ -148,7 +148,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() == 401 && refreshAccessToken()) return auth(url, json, false); if (retry && (result.getCode() == 400 || result.getCode() == 401) && refreshAccessToken()) 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();
} }
@ -157,7 +157,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() == 401 && refreshOpenToken()) return oauth(url, json, false); if (retry && (result.getCode() == 400 || result.getCode() == 401) && refreshOpenToken()) return oauth(url, json, false);
return result.getBody(); return result.getBody();
} }

Binary file not shown.

View File

@ -1 +1 @@
83302c0b9c22927f527219dc290dc6ad b139859b3d28a4065f5efe531f81757d