|
|
|
@ -93,7 +93,7 @@ function aliShare(share_id, folder_id, share_pwd) { |
|
|
|
|
}else{ |
|
|
|
|
return "toast://获取转码播放列表失败,阿里token无效"; |
|
|
|
|
} |
|
|
|
|
}, item.share_id, item.file_id, sub_file_id, share_pwd), |
|
|
|
|
}, item.share_id, item.file_id, sub_file_id||"", share_pwd), |
|
|
|
|
desc: filesize < 1024 ? filesize.toFixed(2) + 'MB' : (filesize/1024).toFixed(2) + 'GB', |
|
|
|
|
col_type: 'avatar', |
|
|
|
|
extra: { |
|
|
|
@ -234,6 +234,15 @@ function aliDiskSearch(input) { |
|
|
|
|
function aliMyDisk(folder_id,nofilter) { |
|
|
|
|
let d = []; |
|
|
|
|
setPageTitle(typeof(MY_PARAMS)!="undefined" && MY_PARAMS.dirname ? MY_PARAMS.dirname : '我的云盘文件 | 聚影√'); |
|
|
|
|
if(userinfo&&userinfo.user_id){ |
|
|
|
|
if(folder_id=="root"){ |
|
|
|
|
d.push({ |
|
|
|
|
title: userinfo.nick_name, |
|
|
|
|
url: "toast://已登录", |
|
|
|
|
img: userinfo.avatar, |
|
|
|
|
col_type: 'avatar' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
try{ |
|
|
|
|
let drive_id = userinfo.default_drive_id; |
|
|
|
|
let postdata = {"drive_id":drive_id,"parent_file_id":folder_id,"limit":200,"all":true,"url_expire_sec":86400,"image_thumbnail_process":"image/resize,w_400/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":"name","order_direction":"ASC"}; |
|
|
|
@ -283,25 +292,24 @@ function aliMyDisk(folder_id,nofilter) { |
|
|
|
|
url: $("hiker://empty##").lazyRule((file_id,file_url,sub_file_url) => { |
|
|
|
|
require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJyAliPublic.js'); |
|
|
|
|
if(alitoken){ |
|
|
|
|
file_url = base64Decode(file_url); |
|
|
|
|
sub_file_url = sub_file_url?base64Decode(sub_file_url):""; |
|
|
|
|
//file_url = base64Decode(file_url);
|
|
|
|
|
//sub_file_url = sub_file_url?base64Decode(sub_file_url):"";
|
|
|
|
|
let play = aliMyPlayUrl(file_id); |
|
|
|
|
if (play.urls) { |
|
|
|
|
if (sub_file_url) { |
|
|
|
|
play['subtitle'] = sub_file_url; |
|
|
|
|
} |
|
|
|
|
play.urls.unshift(file_url); |
|
|
|
|
play.urls.unshift(file_url+ "#isVideo=true##pre#"); |
|
|
|
|
play.names.unshift("原始 文件"); |
|
|
|
|
play.headers.unshift({'Referer':'https://www.aliyundrive.com/'}); |
|
|
|
|
log(play) |
|
|
|
|
return JSON.stringify(play); |
|
|
|
|
}else{ |
|
|
|
|
return "toast://"+play.message; |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
return "toast://未获取到阿里token"; |
|
|
|
|
} |
|
|
|
|
}, item.file_id, base64Encode(item.url), sub_file_url?base64Encode(sub_file_url):""), |
|
|
|
|
}//base64Encode(item.url)
|
|
|
|
|
}, item.file_id, item.url, sub_file_url||""), |
|
|
|
|
desc: filesize < 1024 ? filesize.toFixed(2) + 'MB' : (filesize/1024).toFixed(2) + 'GB', |
|
|
|
|
col_type: 'avatar', |
|
|
|
|
extra: { |
|
|
|
@ -321,6 +329,56 @@ function aliMyDisk(folder_id,nofilter) { |
|
|
|
|
log(e.message); |
|
|
|
|
toast('有异常,可查看日志'); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
d.push({ |
|
|
|
|
title: "登录云盘", |
|
|
|
|
url: $("hiker://empty##").rule(() => { |
|
|
|
|
var d = []; |
|
|
|
|
let url = 'https://auth.aliyundrive.com/v2/oauth/authorize?login_type=custom&response_type=code&redirect_uri=https%3A%2F%2Fwww.aliyundrive.com%2Fsign%2Fcallback&client_id=25dzX3vbYqktVxyX&state=%7B%22origin%22%3A%22*%22%7D#/login' |
|
|
|
|
var js = $.toString(() => { |
|
|
|
|
const tokenFunction = function () { |
|
|
|
|
var token = JSON.parse(localStorage.getItem('token')) |
|
|
|
|
if (token && token.user_id) { |
|
|
|
|
let token_url = 'hiker://files/rules/Joe/ali.json'; |
|
|
|
|
fy_bridge_app.writeFile(token_url, JSON.stringify(token)); |
|
|
|
|
let icy = "hiker://files/rules/icy/icy-ali-token.json"; |
|
|
|
|
let a = fy_bridge_app.fetch(icy); |
|
|
|
|
if (!a || a == "") { |
|
|
|
|
let b = []; |
|
|
|
|
b.push(token); |
|
|
|
|
fy_bridge_app.writeFile(icy, JSON.stringify(b)); |
|
|
|
|
} |
|
|
|
|
localStorage.clear(); |
|
|
|
|
//alert('TOKEN获取成功!');
|
|
|
|
|
fba.parseLazyRule(`hiker://empty@lazyRule=.js:putMyVar('getalitoken','0');back();`); |
|
|
|
|
//fy_bridge_app.back();
|
|
|
|
|
return; |
|
|
|
|
} else { |
|
|
|
|
token_timer(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
var token_timer = function () { |
|
|
|
|
setTimeout(tokenFunction, 500) |
|
|
|
|
}; |
|
|
|
|
token_timer(); |
|
|
|
|
tokenFunction(); |
|
|
|
|
}) |
|
|
|
|
d.push({ |
|
|
|
|
url: url, |
|
|
|
|
col_type: 'x5_webview_single', |
|
|
|
|
desc: '100%&&float', |
|
|
|
|
extra: { |
|
|
|
|
canBack: true, |
|
|
|
|
js: js |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
setResult(d); |
|
|
|
|
}), |
|
|
|
|
img: "https://lanmeiguojiang.com/tubiao/messy/158.svg", |
|
|
|
|
col_type: 'avatar' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
setResult(d); |
|
|
|
|
setLastChapterRule('js:' + $.toString(()=>{ |
|
|
|
|
setResult(''); |
|
|
|
|