更新 'test.js'

master
src48597962 2 years ago
parent 7dd26d5431
commit 176fbaf8c6
  1. 11
      test.js

@ -1,19 +1,16 @@
function(input) { function(input) {
let headers = {
'content-type': 'application/json;charset=UTF-8',
"referer": "https://www.aliyundrive.com/",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.41",
};
require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJyAliPublic.js'); require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJyAliPublic.js');
log('aaa');
headers.authorization = "Bearer " + userinfo.access_token; headers.authorization = "Bearer " + userinfo.access_token;
let drive_id = userinfo.default_drive_id; let drive_id = userinfo.default_drive_id;
let body = {"drive_id":drive_id,"limit":20,"query":"name match \""+input+"\" and type = \"folder\"","image_thumbnail_process":"image/resize,w_200/format,jpeg","image_url_process":"image/resize,w_1920/format,jpeg","video_thumbnail_process":"video/snapshot,t_1000,f_jpg,ar_auto,w_300","order_by":"updated_at DESC"} let postdata = {"drive_id":drive_id,"limit":100,"query":"name match \""+input+"\" and type = \"folder\"","image_thumbnail_process":"image/resize,w_200/format,jpeg","image_url_process":"image/resize,w_1920/format,jpeg","video_thumbnail_process":"video/snapshot,t_1000,f_jpg,ar_auto,w_300","order_by":"updated_at DESC"}
let list = JSON.parse(request('https://api.aliyundrive.com/adrive/v3/file/search', { headers: headers, body: body, method: 'POST', timeout: 3000 })); let list = JSON.parse(request('https://api.aliyundrive.com/adrive/v3/file/search', { headers: headers, body: postdata, method: 'POST', timeout: 3000 }));
let data = list.map(item => { let data = list.map(item => {
return { return {
title: item.name, title: item.name,
url: item.file_id url: item.file_id
} }
}) })
log(data);
return data; return data;
} }
Loading…
Cancel
Save