更新 'SrcJyAliPublic.js'

main
src48597962 7 months ago
parent e6320fdf90
commit 2aa5944841
  1. 41
      SrcJyAliPublic.js

@ -377,40 +377,33 @@ function getOpenToken(authorization) {
} }
variable = 1; variable = 1;
} else { } else {
let res = post("http://api.extscreen.com/aliyundrive/qrcode", { let sid = JSON.parse(request("http://api.extscreen.com/aliyundrive/qrcode", {
body: JSON.stringify({ body: {
"scopes": 'user:base,file:all:read,file:all:write', "scopes": 'user:base,file:all:read,file:all:write',
"width": 500, "width": 500,
"height": 500, "height": 500,
}), },
}); method: 'POST',
timeout: 8000
let data = JSON.parse(res).data; })).data.sid;
let sid = data["sid"];
function get_qrcode_code(sid) {
let res = fetch("https://openapi.aliyundrive.com/oauth/qrcode/" + sid + "/status");
return JSON.parse(res).authCode;
}
log(get_qrcode_code(sid));
let json = JSON.parse(request('http://api.extscreen.com/aliyundrive/token', { let json = JSON.parse(request('https://open.aliyundrive.com/oauth/users/qrcode/authorize?sid=' + sid, {
body: get_qrcode_code(sid), headers: headers,
body: {
"authorize": 1,
"scope": "user:base,file:all:read,file:all:write"
},
method: 'POST', method: 'POST',
timeout: 8000 timeout: 8000
})); }));
if(json.result){
log(json); let code = JSON.parse(request("https://openapi.aliyundrive.com/oauth/qrcode/" + sid + "/status")).authCode;
return json; data = { "code": code, "grant_type": "authorization_code" }
//let code = json.redirectUri.split("code=")[1]; }
//data = { "code": code, "grant_type": "authorization_code" }
variable = 0; variable = 0;
} }
let json2 = {}; let json2 = {};
try { json2 = JSON.parse(request('http://api.extscreen.com/aliyundrive/token', { body: data, method: 'POST', timeout: 8000 })).data;
json2 = JSON.parse(request('https://api.xhofe.top/alist/ali_open/code', { body: data, method: 'POST', timeout: 8000 }));
} catch (e) {
json2 = JSON.parse(request('https://api-cf.nn.ci/alist/ali_open/code', { body: data, method: 'POST', timeout: 8000 }));
}
json2.variable = variable; json2.variable = variable;
return json2; return json2;
} }

Loading…
Cancel
Save