|
|
@ -125,11 +125,6 @@ function aliShare(share_id, folder_id, share_pwd) { |
|
|
|
})); |
|
|
|
})); |
|
|
|
setPageTitle(typeof (MY_PARAMS) != "undefined" && MY_PARAMS.dirname ? MY_PARAMS.dirname : '云盘共享文件 | 聚影√'); |
|
|
|
setPageTitle(typeof (MY_PARAMS) != "undefined" && MY_PARAMS.dirname ? MY_PARAMS.dirname : '云盘共享文件 | 聚影√'); |
|
|
|
let d = []; |
|
|
|
let d = []; |
|
|
|
try { |
|
|
|
|
|
|
|
if (!userinfo.nick_name) { |
|
|
|
|
|
|
|
d = d.concat(myDiskMenu(0)); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
share_pwd = share_pwd || ""; |
|
|
|
|
|
|
|
let orders = { |
|
|
|
let orders = { |
|
|
|
名称正序: 'name#ASC', |
|
|
|
名称正序: 'name#ASC', |
|
|
|
名称倒序: 'name#DESC', |
|
|
|
名称倒序: 'name#DESC', |
|
|
@ -140,31 +135,9 @@ function aliShare(share_id, folder_id, share_pwd) { |
|
|
|
let ordersKeys = Object.keys(orders); |
|
|
|
let ordersKeys = Object.keys(orders); |
|
|
|
let orderskey = orders[getItem('aliyun_order', '聚影排序')]; |
|
|
|
let orderskey = orders[getItem('aliyun_order', '聚影排序')]; |
|
|
|
let style = getItem('aliyun_style', 'avatar'); |
|
|
|
let style = getItem('aliyun_style', 'avatar'); |
|
|
|
|
|
|
|
|
|
|
|
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' })).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": orderskey.split('#')[0], "order_direction": orderskey.split('#')[1] }; |
|
|
|
|
|
|
|
headers['x-share-token'] = sharetoken; |
|
|
|
|
|
|
|
let getShare = JSON.parse(request('https://api.aliyundrive.com/adrive/v2/file/list_by_share', { headers: headers, body: postdata, method: 'POST' })); |
|
|
|
|
|
|
|
if(errorCode[getShare.code]){ |
|
|
|
|
|
|
|
d.push({ |
|
|
|
|
|
|
|
title: errorCode[getShare.code], |
|
|
|
|
|
|
|
url: 'hiker://empty##', |
|
|
|
|
|
|
|
col_type: "text_center_1" |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
setResult(d); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
let sharelist = getShare.items || []; |
|
|
|
|
|
|
|
sharelist = sharelist.filter(item => { |
|
|
|
|
|
|
|
return item.type == "file" || (item.type == "folder" && !folderFilter.test(item.name)); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
if(sharelist.length==1 && sharelist[0].type=="folder"){ |
|
|
|
|
|
|
|
rulepages.length = rulepages.length-1; |
|
|
|
|
|
|
|
storage0.putMyVar('rulepages',rulepages); |
|
|
|
|
|
|
|
aliShare(share_id, sharelist[0].file_id, share_pwd); |
|
|
|
|
|
|
|
}else if (sharelist.length > 0) { |
|
|
|
|
|
|
|
d.push( |
|
|
|
d.push( |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "home", |
|
|
|
title: "换源", |
|
|
|
url: $().lazyRule((name) => { |
|
|
|
url: $().lazyRule((name) => { |
|
|
|
if(getMyVar('SrcJyDisk$back')=='1' || !name){ |
|
|
|
if(getMyVar('SrcJyDisk$back')=='1' || !name){ |
|
|
|
putMyVar('聚影云盘自动返回','1'); |
|
|
|
putMyVar('聚影云盘自动返回','1'); |
|
|
@ -188,8 +161,8 @@ function aliShare(share_id, folder_id, share_pwd) { |
|
|
|
}, name) |
|
|
|
}, name) |
|
|
|
} |
|
|
|
} |
|
|
|
},MY_PARAMS.name||""), |
|
|
|
},MY_PARAMS.name||""), |
|
|
|
col_type: 'icon_5',//icon_round_small_4
|
|
|
|
col_type: 'icon_5', |
|
|
|
img: 'https://hikerfans.com/img/ali_icon.svg', |
|
|
|
img: 'https://hikerfans.com/tubiao/grey/175.png', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: getItem('aliyun_style', 'avatar'), |
|
|
|
title: getItem('aliyun_style', 'avatar'), |
|
|
@ -199,7 +172,7 @@ function aliShare(share_id, folder_id, share_pwd) { |
|
|
|
return 'toast://已切换'; |
|
|
|
return 'toast://已切换'; |
|
|
|
}), |
|
|
|
}), |
|
|
|
col_type: 'icon_5',//icon_round_small_4
|
|
|
|
col_type: 'icon_5',//icon_round_small_4
|
|
|
|
img: 'https://hikerfans.com/img/ali_icon.svg', |
|
|
|
img: 'https://hikerfans.com/tubiao/grey/168.png', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: getItem('aliyun_order', '聚影排序'), |
|
|
|
title: getItem('aliyun_order', '聚影排序'), |
|
|
@ -209,7 +182,7 @@ function aliShare(share_id, folder_id, share_pwd) { |
|
|
|
return 'toast://切换成功'; |
|
|
|
return 'toast://切换成功'; |
|
|
|
}), |
|
|
|
}), |
|
|
|
col_type: 'icon_5', |
|
|
|
col_type: 'icon_5', |
|
|
|
img: 'https://hikerfans.com/img/ali_sort.svg', |
|
|
|
img: 'https://hikerfans.com/tubiao/grey/76.png', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: getItem('aliyun_playMode', '智能') + '播放', |
|
|
|
title: getItem('aliyun_playMode', '智能') + '播放', |
|
|
@ -231,6 +204,32 @@ function aliShare(share_id, folder_id, share_pwd) { |
|
|
|
col_type: 'line_blank', |
|
|
|
col_type: 'line_blank', |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
if (!userinfo.nick_name) { |
|
|
|
|
|
|
|
d = d.concat(myDiskMenu(0)); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
share_pwd = share_pwd || ""; |
|
|
|
|
|
|
|
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' })).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": orderskey.split('#')[0], "order_direction": orderskey.split('#')[1] }; |
|
|
|
|
|
|
|
headers['x-share-token'] = sharetoken; |
|
|
|
|
|
|
|
let getShare = JSON.parse(request('https://api.aliyundrive.com/adrive/v2/file/list_by_share', { headers: headers, body: postdata, method: 'POST' })); |
|
|
|
|
|
|
|
if(errorCode[getShare.code]){ |
|
|
|
|
|
|
|
d.push({ |
|
|
|
|
|
|
|
title: errorCode[getShare.code], |
|
|
|
|
|
|
|
url: 'hiker://empty##', |
|
|
|
|
|
|
|
col_type: "text_center_1" |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
setResult(d); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
let sharelist = getShare.items || []; |
|
|
|
|
|
|
|
sharelist = sharelist.filter(item => { |
|
|
|
|
|
|
|
return item.type == "file" || (item.type == "folder" && !folderFilter.test(item.name)); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
if(sharelist.length==1 && sharelist[0].type=="folder"){ |
|
|
|
|
|
|
|
rulepages.length = rulepages.length-1; |
|
|
|
|
|
|
|
storage0.putMyVar('rulepages',rulepages); |
|
|
|
|
|
|
|
aliShare(share_id, sharelist[0].file_id, share_pwd); |
|
|
|
|
|
|
|
}else if (sharelist.length > 0) { |
|
|
|
let sublist = sharelist.filter(item => { |
|
|
|
let sublist = sharelist.filter(item => { |
|
|
|
return item.type == "file" && /srt|vtt|ass/.test(item.file_extension); |
|
|
|
return item.type == "file" && /srt|vtt|ass/.test(item.file_extension); |
|
|
|
}) |
|
|
|
}) |
|
|
|