|
|
|
@ -268,69 +268,11 @@ function aliOpenPlayUrl(file_id, sharedata, drive_id, preview) { |
|
|
|
|
try { |
|
|
|
|
drive_id = drive_id || alidrive_id; |
|
|
|
|
|
|
|
|
|
function fcopy(obj) { |
|
|
|
|
try { |
|
|
|
|
let json = JSON.parse(fetch('https://api.aliyundrive.com/adrive/v2/batch', { |
|
|
|
|
headers: { |
|
|
|
|
'User-Agent': PC_UA, |
|
|
|
|
'Referer': 'https://www.aliyundrive.com/', |
|
|
|
|
'authorization': authorization, |
|
|
|
|
'x-canary': 'client=web,app=share,version=v2.3.1', |
|
|
|
|
'x-share-token': obj.sharetoken |
|
|
|
|
}, |
|
|
|
|
body: { |
|
|
|
|
"requests": [{ |
|
|
|
|
"body": { |
|
|
|
|
"file_id": obj.file_id, |
|
|
|
|
"share_id": obj.share_id, |
|
|
|
|
"auto_rename": true, |
|
|
|
|
"to_parent_file_id": "root", |
|
|
|
|
"to_drive_id": obj.drive_id |
|
|
|
|
}, |
|
|
|
|
"headers": { "Content-Type": "application/json" }, "id": "0", "method": "POST", "url": "/file/copy" |
|
|
|
|
}], |
|
|
|
|
"resource": "file" |
|
|
|
|
}, |
|
|
|
|
method: 'POST' |
|
|
|
|
})).responses[0].body; |
|
|
|
|
if (/size/.test(json.message)) { |
|
|
|
|
log('云盘没有空间,无法操作转存'); |
|
|
|
|
} |
|
|
|
|
return json.file_id; |
|
|
|
|
} catch (e) { |
|
|
|
|
log("原画copy转存异常>" + e.message); |
|
|
|
|
return ""; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
function fdel(obj) { |
|
|
|
|
fetch('https://api.aliyundrive.com/adrive/v2/batch', { |
|
|
|
|
headers: { |
|
|
|
|
'User-Agent': PC_UA, |
|
|
|
|
'Referer': 'https://www.aliyundrive.com/', |
|
|
|
|
'authorization': authorization, |
|
|
|
|
'x-canary': 'client=web,app=share,version=v2.3.1', |
|
|
|
|
'x-share-token': obj.sharetoken |
|
|
|
|
}, |
|
|
|
|
body: { |
|
|
|
|
"requests": [{ |
|
|
|
|
"body": { |
|
|
|
|
"drive_id": obj.drive_id, |
|
|
|
|
"file_id": obj.file_id |
|
|
|
|
}, |
|
|
|
|
"headers": { "Content-Type": "application/json" }, |
|
|
|
|
"id": obj.file_id, |
|
|
|
|
"method": "POST", |
|
|
|
|
"url": "/file/delete" |
|
|
|
|
}], |
|
|
|
|
"resource": "file" |
|
|
|
|
}, |
|
|
|
|
method: 'POST' |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
let newfile_id; |
|
|
|
|
if (sharedata) { |
|
|
|
|
sharedata.file_id = file_id; |
|
|
|
|
sharedata.drive_id = drive_id; |
|
|
|
|
sharedata.authorization = authorization; |
|
|
|
|
newfile_id = fcopy(sharedata); |
|
|
|
|
if (!newfile_id) { |
|
|
|
|
return ""; |
|
|
|
@ -448,3 +390,4 @@ function getOpenToken(authorization) { |
|
|
|
|
} |
|
|
|
|
return open_access_token || ""; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|