ali will check quota and clean token
This commit is contained in:
parent
e8438a37fe
commit
2e66025f4a
|
|
@ -137,7 +137,7 @@ public class API {
|
|||
private boolean checkAuth(String result) {
|
||||
if (result.contains("AccessTokenInvalid")) return refreshAccessToken();
|
||||
if (result.contains("ShareLinkTokenInvalid") || result.contains("InvalidParameterNotMatch")) return refreshShareToken();
|
||||
return false;
|
||||
return checkQuotaExhausted(result);
|
||||
}
|
||||
|
||||
private boolean checkOpen(String result) {
|
||||
|
|
@ -145,6 +145,13 @@ public class API {
|
|||
return false;
|
||||
}
|
||||
|
||||
private boolean checkQuotaExhausted(String result) {
|
||||
if (!result.contains("QuotaExhausted")) return false;
|
||||
Init.show("容量不夠拉,趕快清一清。");
|
||||
auth.clean();
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean checkManyRequest(String result) {
|
||||
if (!result.contains("Too Many Requests")) return false;
|
||||
Init.show("洗洗睡吧,Too Many Requests。");
|
||||
|
|
|
|||
|
|
@ -80,12 +80,19 @@ public class Auth {
|
|||
return TextUtils.isEmpty(expireTime) ? "" : expireTime;
|
||||
}
|
||||
|
||||
public void setExpireTime(String expireTime) {
|
||||
this.expireTime = expireTime;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return getAccessToken().isEmpty();
|
||||
}
|
||||
|
||||
public void clean() {
|
||||
setRefreshToken("");
|
||||
setAccessToken("");
|
||||
setExpireTime("");
|
||||
save();
|
||||
}
|
||||
|
||||
public void save() {
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
46f550f87ace39f5b51a4fa8737c7029
|
||||
4a4931a4faa85b0fd02acc98e38f3bab
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;46f550f87ace39f5b51a4fa8737c7029",
|
||||
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;4a4931a4faa85b0fd02acc98e38f3bab",
|
||||
"wallpaper": "https://gao.chuqiuyu.tk",
|
||||
"sites": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;46f550f87ace39f5b51a4fa8737c7029",
|
||||
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;4a4931a4faa85b0fd02acc98e38f3bab",
|
||||
"wallpaper": "http://饭太硬.ga/深色壁纸/api.php",
|
||||
"sites": [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue