|
|
@ -324,7 +324,6 @@ function getOpenToken(authorization) { |
|
|
|
headers['authorization'] = authorization; |
|
|
|
headers['authorization'] = authorization; |
|
|
|
headers['x-canary'] = "client=web,app=adrive,version=v4.3.1"; |
|
|
|
headers['x-canary'] = "client=web,app=adrive,version=v4.3.1"; |
|
|
|
function alistOpenApi(refresh_token) { |
|
|
|
function alistOpenApi(refresh_token) { |
|
|
|
refresh_token ='eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIzNDI2YWQ4ZWJhYTA0ZTFlYTllZTAxYmQ5OThkMDZkNCIsImF1ZCI6Ijc2OTE3Y2NjY2Q0NDQxYzM5NDU3YTA0ZjYwODRmYjJmIiwiZXhwIjoxNzQ2NTE3NDM2LCJpYXQiOjE3Mzg3NDE0MzYsImp0aSI6ImE3ODU2MDliOTQ5MTQ5Y2RiMDY3ZDQ0NWU0Zjc3YWVjIn0.L0wsQKyM0fGXnc2MsY-1QRk7bK1UJHWGpmeqa-fSVcWvO-wc6T7OxpFvgpPgO1ZYFq8LSsLxmk8fXHbOf9owTA'; |
|
|
|
|
|
|
|
let variable; |
|
|
|
let variable; |
|
|
|
let data = {}; |
|
|
|
let data = {}; |
|
|
|
if (refresh_token) { |
|
|
|
if (refresh_token) { |
|
|
@ -336,17 +335,19 @@ function getOpenToken(authorization) { |
|
|
|
log('1111'); |
|
|
|
log('1111'); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
log('2222'); |
|
|
|
log('2222'); |
|
|
|
let json = JSON.parse(request('https://open.aliyundrive.com/oauth/users/authorize?client_id=76917ccccd4441c39457a04f6084fb2f&redirect_uri=https://alist.nn.ci/tool/aliyundrive/callback&scope=user:base,file:all:read,file:all:write&state=', { |
|
|
|
let json = JSON.parse(request('https://open.aliyundrive.com/oauth/users/authorize?client_id=76917ccccd4441c39457a04f6084fb2f&redirect_uri=https://alist.nn.ci/tool/aliyundrive/callback&scope=user:base,file:all:read,file:all:write&state=Ojo=&response_type=code', { |
|
|
|
headers: headers, |
|
|
|
headers: headers, |
|
|
|
body: { |
|
|
|
body: { |
|
|
|
"authorize": 1, |
|
|
|
"authorize": 1, |
|
|
|
"scope": "user:base,file:all:read,file:all:write" |
|
|
|
"scope": "user:base,file:all:read,file:all:write", |
|
|
|
|
|
|
|
"drives": ["backup","resource"], |
|
|
|
|
|
|
|
"folder": "" |
|
|
|
}, |
|
|
|
}, |
|
|
|
method: 'POST', |
|
|
|
method: 'POST', |
|
|
|
timeout: 8000 |
|
|
|
timeout: 8000 |
|
|
|
})); |
|
|
|
})); |
|
|
|
log(json); |
|
|
|
log(json); |
|
|
|
let code = json.redirectUri.split("code=")[1]; |
|
|
|
let code = json.redirectUri.split("code=")[1].split("&state")[0]; |
|
|
|
data = { "code": code, "grant_type": "authorization_code" } |
|
|
|
data = { "code": code, "grant_type": "authorization_code" } |
|
|
|
log(data); |
|
|
|
log(data); |
|
|
|
variable = 0; |
|
|
|
variable = 0; |
|
|
@ -354,10 +355,14 @@ function getOpenToken(authorization) { |
|
|
|
let json2 = {}; |
|
|
|
let json2 = {}; |
|
|
|
try { |
|
|
|
try { |
|
|
|
json2 = JSON.parse(request('https://api.xhofe.top/alist/ali_open/code', { body: data, method: 'POST', timeout: 8000 })); |
|
|
|
json2 = JSON.parse(request('https://api.xhofe.top/alist/ali_open/code', { body: data, method: 'POST', timeout: 8000 })); |
|
|
|
|
|
|
|
log("api.xhofe.top"); |
|
|
|
|
|
|
|
log(json2); |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
json2 = JSON.parse(request('https://api-cf.nn.ci/alist/ali_open/token', { body: data, method: 'POST', timeout: 8000 })); |
|
|
|
json2 = JSON.parse(request('https://api-cf.nn.ci/alist/ali_open/token', { body: data, method: 'POST', timeout: 8000 })); |
|
|
|
|
|
|
|
log("api-cf.nn.ci"); |
|
|
|
|
|
|
|
log(json2); |
|
|
|
} |
|
|
|
} |
|
|
|
log(json2); |
|
|
|
|
|
|
|
json2.variable = variable; |
|
|
|
json2.variable = variable; |
|
|
|
return json2; |
|
|
|
return json2; |
|
|
|
} |
|
|
|
} |
|
|
|