Update ali
This commit is contained in:
parent
dcabc66a01
commit
f7917415fb
|
|
@ -135,7 +135,9 @@ public class API {
|
||||||
|
|
||||||
private String post(String url, JSONObject body) {
|
private String post(String url, JSONObject body) {
|
||||||
url = url.startsWith("https") ? url : "https://api.aliyundrive.com/" + url;
|
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) {
|
private String auth(String url, String json, boolean retry) {
|
||||||
|
|
@ -192,7 +194,6 @@ public class API {
|
||||||
body.put("grant_type", "refresh_token");
|
body.put("grant_type", "refresh_token");
|
||||||
String result = post("https://auth.aliyundrive.com/v2/account/token", body);
|
String result = post("https://auth.aliyundrive.com/v2/account/token", body);
|
||||||
user = User.objectFrom(result).save();
|
user = User.objectFrom(result).save();
|
||||||
SpiderDebug.log(user.toString());
|
|
||||||
if (user.getAccessToken().isEmpty()) throw new Exception(result);
|
if (user.getAccessToken().isEmpty()) throw new Exception(result);
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -355,7 +356,6 @@ public class API {
|
||||||
body.put("file_id", tempIds.get(0));
|
body.put("file_id", tempIds.get(0));
|
||||||
body.put("drive_id", user.getDriveId());
|
body.put("drive_id", user.getDriveId());
|
||||||
String json = oauth("openFile/getDownloadUrl", body.toString(), true);
|
String json = oauth("openFile/getDownloadUrl", body.toString(), true);
|
||||||
SpiderDebug.log(json);
|
|
||||||
return new JSONObject(json).getString("url");
|
return new JSONObject(json).getString("url");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
@ -375,7 +375,6 @@ public class API {
|
||||||
body.put("category", "live_transcoding");
|
body.put("category", "live_transcoding");
|
||||||
body.put("url_expire_sec", "14400");
|
body.put("url_expire_sec", "14400");
|
||||||
String json = oauth("openFile/getVideoPreviewPlayInfo", body.toString(), true);
|
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");
|
JSONArray taskList = new JSONObject(json).getJSONObject("video_preview_play_info").getJSONArray("live_transcoding_task_list");
|
||||||
return getPreviewQuality(taskList, flag);
|
return getPreviewQuality(taskList, flag);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
77633695c1b9eb30846e021f48424a6d
|
89ad2d897321d371d01075fec070484b
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue