修复阿里
This commit is contained in:
parent
153a3bb785
commit
8cba2a0b0c
|
|
@ -106,6 +106,13 @@ public class AliYun {
|
|||
return headers;
|
||||
}
|
||||
|
||||
private HashMap<String, String> getHeaders() {
|
||||
HashMap<String, String> headers = getHeader();
|
||||
headers.put("x-share-token", share.getShareToken());
|
||||
headers.put("X-Canary", "client=Android,app=adrive,version=v4.3.1");
|
||||
return headers;
|
||||
}
|
||||
|
||||
private HashMap<String, String> getHeaderAuth() {
|
||||
HashMap<String, String> headers = getHeader();
|
||||
headers.put("x-share-token", share.getShareToken());
|
||||
|
|
@ -138,7 +145,12 @@ public class AliYun {
|
|||
|
||||
private String auth(String url, String json, boolean retry) {
|
||||
url = url.startsWith("https") ? url : "https://api.aliyundrive.com/" + url;
|
||||
OkResult result = OkHttp.post(url, json, getHeaderAuth());
|
||||
OkResult result;
|
||||
if (url.contains("file/list")) {
|
||||
result = OkHttp.post(url, json, getHeaders());
|
||||
} else {
|
||||
result = OkHttp.post(url, json, getHeaderAuth());
|
||||
}
|
||||
SpiderDebug.log(result.getCode() + "," + url + "," + result.getBody());
|
||||
if (retry && result.getCode() == 401 && refreshAccessToken()) return auth(url, json, false);
|
||||
if (retry && result.getCode() == 429) return auth(url, json, false);
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
2b4bff50bb61acef1e8f8654d9822f63
|
||||
7d 13 87 8c 01 ea 65 5d 71 6f d1 aa 39 b0 09 4e
|
||||
|
|
|
|||
Loading…
Reference in New Issue