Update ali

This commit is contained in:
FongMi 2023-05-11 10:14:09 +08:00
parent ac3ad65be8
commit a65101065c
5 changed files with 6 additions and 7 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

View File

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

View File

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