From 6d8863bdf14471fa90923b2ee8fd31b2212fc9aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E4=B8=89?= <89683694+Tangsan99999@users.noreply.github.com> Date: Sun, 6 Aug 2023 15:04:05 +0800 Subject: [PATCH] fix ali --- app/src/main/java/com/github/catvod/ali/API.java | 10 +++++----- jar/custom_spider.jar.md5 | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/github/catvod/ali/API.java b/app/src/main/java/com/github/catvod/ali/API.java index d07707a4..8973e2f2 100644 --- a/app/src/main/java/com/github/catvod/ali/API.java +++ b/app/src/main/java/com/github/catvod/ali/API.java @@ -83,7 +83,7 @@ public class API { tempIds = new ArrayList<>(); oauth = OAuth.objectFrom(FileUtil.read(getOAuthCache())); user = User.objectFrom(FileUtil.read(getUserCache())); - drive = Drive.objectFrom(FileUtil.read(getUserCache())); + drive = Drive.objectFrom(FileUtil.read(getDriveCache())); quality = new HashMap<>(); quality.put("4K", "UHD"); quality.put("2k", "QHD"); @@ -227,11 +227,11 @@ public class API { String result = auth("https://user.aliyundrive.com/v2/user/get", "{}", false); drive = Drive.objectFrom(result).save(); driveId = drive.getResourceDriveId().isEmpty() ? drive.getDriveId() : drive.getResourceDriveId(); - return true; + return false; } catch (Exception e) { e.printStackTrace(); drive.clean().save(); - return false; + return true; } } @@ -376,7 +376,7 @@ public class API { public String getDownloadUrl(String fileId) { try { SpiderDebug.log("getDownloadUrl..." + fileId); - if (!getDriveId()) throw new Exception("unable obtain drive id"); + if (getDriveId()) throw new Exception("unable obtain drive id"); tempIds.add(0, copy(fileId)); JSONObject body = new JSONObject(); body.put("file_id", tempIds.get(0)); @@ -394,7 +394,7 @@ public class API { public JSONObject getVideoPreviewPlayInfo(String fileId) { try { SpiderDebug.log("getVideoPreviewPlayInfo..." + fileId); - if (!getDriveId()) throw new Exception("unable obtain drive id"); + if (getDriveId()) throw new Exception("unable obtain drive id"); tempIds.add(0, copy(fileId)); JSONObject body = new JSONObject(); body.put("file_id", tempIds.get(0)); diff --git a/jar/custom_spider.jar.md5 b/jar/custom_spider.jar.md5 index f5ff06db..225258b7 100644 --- a/jar/custom_spider.jar.md5 +++ b/jar/custom_spider.jar.md5 @@ -1 +1 @@ -dc65fa8fabc0fba297b0dd6000af50be +742c1529e8ed74270c926574168ff55e