更新 'SrcJyAliDisk.js'

main
src48597962 2 years ago
parent 24b2b31ad1
commit 545551d32c
  1. 58
      SrcJyAliDisk.js

@ -5,7 +5,16 @@ function aliShare(share_id, folder_id, share_pwd) {
share_pwd = share_pwd || "";
try{
let sharetoken = JSON.parse(request('https://api.aliyundrive.com/v2/share_link/get_share_token', { headers: headers, body: { "share_pwd": share_pwd, "share_id": share_id }, method: 'POST', timeout: 6000 })).share_token;
let postdata = { "share_id": share_id, "parent_file_id": folder_id || "root", "limit": 200, "image_thumbnail_process": "image/resize,w_256/format,jpeg", "image_url_process": "image/resize,w_1920/format,jpeg/interlace,1", "video_thumbnail_process": "video/snapshot,t_1000,f_jpg,ar_auto,w_256", "order_by": "name", "order_direction": "DESC" };
let orders = {
名称正序: 'name#ASC',
名称倒序: 'name#DESC',
时间正序: 'updated_at#ASC',
时间倒序: 'updated_at#DESC',
聚影排序: 'name#DESC'
};
let ordersKeys = Object.keys(orders);
let orderskey = orders[getItem('aliyun_order', '聚影排序')];
let postdata = { "share_id": share_id, "parent_file_id": folder_id || "root", "limit": 200, "image_thumbnail_process": "image/resize,w_256/format,jpeg", "image_url_process": "image/resize,w_1920/format,jpeg/interlace,1", "video_thumbnail_process": "video/snapshot,t_1000,f_jpg,ar_auto,w_256", "order_by": orderskey.split('#')[0], "order_direction": orderskey.split('#')[1] };
headers['x-share-token'] = sharetoken;
let sharelist = JSON.parse(request('https://api.aliyundrive.com/adrive/v2/file/list_by_share', { headers: headers, body: postdata, method: 'POST' })).items;
if(sharelist.length>0){
@ -23,11 +32,54 @@ function aliShare(share_id, folder_id, share_pwd) {
col_type: 'text_center_1'
})
}
/*
d.push({
title: "💾保存到我的云盘☁",
url: "smartdrive://share/browse?shareId="+share_id+"&sharePwd="+share_pwd,
col_type: 'text_center_1'
})
*/
d.push(
{
title: getItem('aliyun_style', 'avatar'),
url: $(['text_1', 'movie_2', 'card_pic_3', 'avatar']).select(() => {
setItem('aliyun_style', input);
refreshPage();
return 'toast://已切换';
}),
col_type: 'icon_round_small_4',
img: 'https://hikerfans.com/img/ali_icon.svg',
},
{
title: getItem('aliyun_order', '聚影排序'),
url: $(ordersKeys, 2).select(() => {
setItem('aliyun_order', input);
refreshPage();
return 'toast://切换成功';
}),
col_type: 'icon_round_small_4',
img: 'https://hikerfans.com/img/ali_sort.svg',
},
{
title: getItem('aliyun_playMode', '组合') + '播放',
url: $(['转码', '原画', '组合']).select(() => {
setItem('aliyun_playMode', input);
refreshPage();
return 'toast://切换成功';
}),
col_type: 'icon_round_small_4',
img: 'https://hikerfans.com/img/ali_play.svg',
},
{
title: '转存网盘',
url: `smartdrive://share/browse?shareId=${share_id}&sharePwd=${share_pwd}`,
col_type: 'icon_round_small_4',
img: 'https://hikerfans.com/img/ali_fileinto.svg',
},
{
col_type: 'line_blank',
}
)
let sublist = sharelist.filter(item => {
return item.type == "file" && /srt|vtt|ass/.test(item.file_extension);
})
@ -51,7 +103,9 @@ function aliShare(share_id, folder_id, share_pwd) {
let filelist = sharelist.filter((item) => {
return item.type == "file";
})
filelist.sort(SortList);
if(getItem('aliyun_order')=="聚影排序"){
filelist.sort(SortList);
}
filelist.forEach((item) => {
if (item.category == "video") {
let sub_file_id;

Loading…
Cancel
Save