Update ali

This commit is contained in:
FongMi 2023-05-11 10:14:09 +08:00
parent dcabc66a01
commit f7917415fb
3 changed files with 4 additions and 5 deletions

View File

@ -135,7 +135,9 @@ public class API {
private String post(String url, JSONObject body) {
url = url.startsWith("https") ? url : "https://api.aliyundrive.com/" + url;
return OkHttp.postJson(url, body.toString(), getHeader()).getBody();
OkResult result = OkHttp.postJson(url, body.toString(), getHeader());
SpiderDebug.log(result.getCode() + "," + url + "," + result.getBody());
return result.getBody();
}
private String auth(String url, String json, boolean retry) {
@ -192,7 +194,6 @@ public class API {
body.put("grant_type", "refresh_token");
String result = post("https://auth.aliyundrive.com/v2/account/token", body);
user = User.objectFrom(result).save();
SpiderDebug.log(user.toString());
if (user.getAccessToken().isEmpty()) throw new Exception(result);
return true;
} catch (Exception e) {
@ -355,7 +356,6 @@ public class API {
body.put("file_id", tempIds.get(0));
body.put("drive_id", user.getDriveId());
String json = oauth("openFile/getDownloadUrl", body.toString(), true);
SpiderDebug.log(json);
return new JSONObject(json).getString("url");
} catch (Exception e) {
e.printStackTrace();
@ -375,7 +375,6 @@ public class API {
body.put("category", "live_transcoding");
body.put("url_expire_sec", "14400");
String json = oauth("openFile/getVideoPreviewPlayInfo", body.toString(), true);
SpiderDebug.log(json);
JSONArray taskList = new JSONObject(json).getJSONObject("video_preview_play_info").getJSONArray("live_transcoding_task_list");
return getPreviewQuality(taskList, flag);
} catch (Exception e) {

Binary file not shown.

View File

@ -1 +1 @@
77633695c1b9eb30846e021f48424a6d
89ad2d897321d371d01075fec070484b