From 5e64b2eb62e9aa1f5e7b6471f8c120eec3fe5e75 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Wed, 5 Feb 2025 17:15:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcJyAliPublic.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcJyAliPublic.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/SrcJyAliPublic.js b/SrcJyAliPublic.js index d0c90c7..30d1cee 100644 --- a/SrcJyAliPublic.js +++ b/SrcJyAliPublic.js @@ -324,7 +324,6 @@ function getOpenToken(authorization) { headers['authorization'] = authorization; headers['x-canary'] = "client=web,app=adrive,version=v4.3.1"; function alistOpenApi(refresh_token) { - refresh_token ='eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIzNDI2YWQ4ZWJhYTA0ZTFlYTllZTAxYmQ5OThkMDZkNCIsImF1ZCI6Ijc2OTE3Y2NjY2Q0NDQxYzM5NDU3YTA0ZjYwODRmYjJmIiwiZXhwIjoxNzQ2NTE3NDM2LCJpYXQiOjE3Mzg3NDE0MzYsImp0aSI6ImE3ODU2MDliOTQ5MTQ5Y2RiMDY3ZDQ0NWU0Zjc3YWVjIn0.L0wsQKyM0fGXnc2MsY-1QRk7bK1UJHWGpmeqa-fSVcWvO-wc6T7OxpFvgpPgO1ZYFq8LSsLxmk8fXHbOf9owTA'; let variable; let data = {}; if (refresh_token) { @@ -336,17 +335,19 @@ function getOpenToken(authorization) { log('1111'); } else { 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, body: { "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', timeout: 8000 })); 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" } log(data); variable = 0; @@ -354,10 +355,14 @@ function getOpenToken(authorization) { let json2 = {}; try { 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) { 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; return json2; }