Fix ali expection

This commit is contained in:
FongMi 2023-04-28 17:06:25 +08:00
parent b86e21d976
commit f8deea72c6
5 changed files with 11 additions and 6 deletions

View File

@ -399,17 +399,22 @@ public class API {
} }
private void deleteAll() { private void deleteAll() {
for (String tempId : tempIds) delete(tempId); Iterator<String> iterator = tempIds.iterator();
while (iterator.hasNext()) {
boolean deleted = delete(iterator.next());
if (deleted) iterator.remove();
}
} }
private void delete(String fileId) { private boolean delete(String fileId) {
try { try {
SpiderDebug.log("Delete..." + fileId); SpiderDebug.log("Delete..." + fileId);
String json = "{\"requests\":[{\"body\":{\"drive_id\":\"%s\",\"file_id\":\"%s\"},\"headers\":{\"Content-Type\":\"application/json\"},\"id\":\"%s\",\"method\":\"POST\",\"url\":\"/file/delete\"}],\"resource\":\"file\"}"; String json = "{\"requests\":[{\"body\":{\"drive_id\":\"%s\",\"file_id\":\"%s\"},\"headers\":{\"Content-Type\":\"application/json\"},\"id\":\"%s\",\"method\":\"POST\",\"url\":\"/file/delete\"}],\"resource\":\"file\"}";
json = String.format(json, user.getDriveId(), fileId, fileId); json = String.format(json, user.getDriveId(), fileId, fileId);
String result = auth("adrive/v2/batch", json, true); String result = auth("adrive/v2/batch", json, true);
if (result.length() == 211) tempIds.remove(fileId); return result.length() == 211;
} catch (Exception ignored) { } catch (Exception ignored) {
return false;
} }
} }

Binary file not shown.

View File

@ -1 +1 @@
1da9b9d6b4241ada175c741d4b4b9cf9 9eb909e7a180e28b617c5fd15bda5b22

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;1da9b9d6b4241ada175c741d4b4b9cf9", "spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;9eb909e7a180e28b617c5fd15bda5b22",
"wallpaper": "https://gao.chuqiuyu.tk", "wallpaper": "https://gao.chuqiuyu.tk",
"sites": [ "sites": [
{ {

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;1da9b9d6b4241ada175c741d4b4b9cf9", "spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;9eb909e7a180e28b617c5fd15bda5b22",
"wallpaper": "http://饭太硬.ga/深色壁纸/api.php", "wallpaper": "http://饭太硬.ga/深色壁纸/api.php",
"sites": [ "sites": [
{ {